]> git.baikalelectronics.ru Git - kernel.git/commit
gfs2: Fix missed wakeups in find_insert_glock
authorAndreas Gruenbacher <agruenba@redhat.com>
Wed, 6 Mar 2019 14:41:57 +0000 (15:41 +0100)
committerAndreas Gruenbacher <agruenba@redhat.com>
Fri, 8 Mar 2019 14:49:01 +0000 (15:49 +0100)
commit2f393c8730738489e15eabab52d2891eb926bb9a
treed6cdf2eb071b40386ca7b75573b377d3413e35a0
parent99bcd2ef4f1d076b72bd50618bb18dfa2ca058b8
gfs2: Fix missed wakeups in find_insert_glock

Mark Syms has reported seeing tasks that are stuck waiting in
find_insert_glock.  It turns out that struct lm_lockname contains four padding
bytes on 64-bit architectures that function glock_waitqueue doesn't skip when
hashing the glock name.  As a result, we can end up waking up the wrong
waitqueue, and the waiting tasks may be stuck forever.

Fix that by using ht_parms.key_len instead of sizeof(struct lm_lockname) for
the key length.

Reported-by: Mark Syms <mark.syms@citrix.com>
Signed-off-by: Andreas Gruenbacher <agruenba@redhat.com>
Signed-off-by: Bob Peterson <rpeterso@redhat.com>
fs/gfs2/glock.c