* [Cluster-devel] [RHEL8 fs] gfs2: Fix missed wakeups in find_insert_glock
@ 2019-03-08 16:56 Andreas Gruenbacher
2019-03-08 17:15 ` Andreas Gruenbacher
0 siblings, 1 reply; 2+ messages in thread
From: Andreas Gruenbacher @ 2019-03-08 16:56 UTC (permalink / raw)
To: cluster-devel.redhat.com
Bugzilla: 1678907
Upstream Status: git://git.kernel.org/pub/scm/linux/kernel/git/gfs2/linux-gfs2.git for-next
Build Info: https://brewweb.engineering.redhat.com/brew/taskinfo?taskID=20503365
commit 605b0487f0bc1ae9963bf52ece0f5c8055186f81
Author: Andreas Gruenbacher <agruenba@redhat.com>
Date: Wed Mar 6 15:41:57 2019 +0100
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>
Signed-off-by: Andreas Gruenbacher <agruenba@redhat.com>
---
fs/gfs2/glock.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/fs/gfs2/glock.c b/fs/gfs2/glock.c
index 05431324b262b..57cdce53b64bd 100644
--- a/fs/gfs2/glock.c
+++ b/fs/gfs2/glock.c
@@ -107,7 +107,7 @@ static int glock_wake_function(wait_queue_entry_t *wait, unsigned int mode,
static wait_queue_head_t *glock_waitqueue(struct lm_lockname *name)
{
- u32 hash = jhash2((u32 *)name, sizeof(*name) / 4, 0);
+ u32 hash = jhash2((u32 *)name, ht_parms.key_len / 4, 0);
return glock_wait_table + hash_32(hash, GLOCK_WAIT_TABLE_BITS);
}
--
2.20.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* [Cluster-devel] [RHEL8 fs] gfs2: Fix missed wakeups in find_insert_glock
2019-03-08 16:56 [Cluster-devel] [RHEL8 fs] gfs2: Fix missed wakeups in find_insert_glock Andreas Gruenbacher
@ 2019-03-08 17:15 ` Andreas Gruenbacher
0 siblings, 0 replies; 2+ messages in thread
From: Andreas Gruenbacher @ 2019-03-08 17:15 UTC (permalink / raw)
To: cluster-devel.redhat.com
On Fri, 8 Mar 2019 at 17:56, Andreas Gruenbacher <agruenba@redhat.com> wrote:
>
> Bugzilla: 1678907
> Upstream Status: git://git.kernel.org/pub/scm/linux/kernel/git/gfs2/linux-gfs2.git for-next
> Build Info: https://brewweb.engineering.redhat.com/brew/taskinfo?taskID=20503365
Wrong mailing list, please disregard.
Thanks,
Andreas
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2019-03-08 17:15 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-03-08 16:56 [Cluster-devel] [RHEL8 fs] gfs2: Fix missed wakeups in find_insert_glock Andreas Gruenbacher
2019-03-08 17:15 ` Andreas Gruenbacher
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.