summaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorAlexander Aring <aahringo@redhat.com>2020-10-26 10:52:29 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2020-11-10 12:35:58 +0100
commitfe0af0efa7b1ecb8aebb5e8f44d00db07f564c6c (patch)
treeac3a60325758817beb14b86058f9be20edb331d7 /fs
parent361d82eb7c301e7473459cb7f1e0d7733cf5e7ec (diff)
downloadlinux-stable-fe0af0efa7b1ecb8aebb5e8f44d00db07f564c6c.tar.gz
linux-stable-fe0af0efa7b1ecb8aebb5e8f44d00db07f564c6c.tar.bz2
linux-stable-fe0af0efa7b1ecb8aebb5e8f44d00db07f564c6c.zip
gfs2: Wake up when sd_glock_disposal becomes zero
commit da7d554f7c62d0c17c1ac3cc2586473c2d99f0bd upstream. Commit fc0e38dae645 ("GFS2: Fix glock deallocation race") fixed a sd_glock_disposal accounting bug by adding a missing atomic_dec statement, but it failed to wake up sd_glock_wait when that decrement causes sd_glock_disposal to reach zero. As a consequence, gfs2_gl_hash_clear can now run into a 10-minute timeout instead of being woken up. Add the missing wakeup. Fixes: fc0e38dae645 ("GFS2: Fix glock deallocation race") Cc: stable@vger.kernel.org # v2.6.39+ Signed-off-by: Alexander Aring <aahringo@redhat.com> Signed-off-by: Andreas Gruenbacher <agruenba@redhat.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'fs')
-rw-r--r--fs/gfs2/glock.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/fs/gfs2/glock.c b/fs/gfs2/glock.c
index ccdd8c821abd..c20d71d86812 100644
--- a/fs/gfs2/glock.c
+++ b/fs/gfs2/glock.c
@@ -870,7 +870,8 @@ int gfs2_glock_get(struct gfs2_sbd *sdp, u64 number,
out_free:
kfree(gl->gl_lksb.sb_lvbptr);
kmem_cache_free(cachep, gl);
- atomic_dec(&sdp->sd_glock_disposal);
+ if (atomic_dec_and_test(&sdp->sd_glock_disposal))
+ wake_up(&sdp->sd_glock_wait);
out:
return ret;