diff options
author | Alexander Aring <aahringo@redhat.com> | 2020-10-26 10:52:29 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2020-11-18 18:26:23 +0100 |
commit | 07c4433dff1449db45a7de14fd9e5db8fbe358e0 (patch) | |
tree | 9d819e63d09f45716e0755afdc8bc79233605c6c /fs/gfs2 | |
parent | b0db2f09db7930ed3bce3b6115ecf04f0acde2b6 (diff) | |
download | linux-stable-07c4433dff1449db45a7de14fd9e5db8fbe358e0.tar.gz linux-stable-07c4433dff1449db45a7de14fd9e5db8fbe358e0.tar.bz2 linux-stable-07c4433dff1449db45a7de14fd9e5db8fbe358e0.zip |
gfs2: Wake up when sd_glock_disposal becomes zero
[ Upstream commit da7d554f7c62d0c17c1ac3cc2586473c2d99f0bd ]
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: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'fs/gfs2')
-rw-r--r-- | fs/gfs2/glock.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/fs/gfs2/glock.c b/fs/gfs2/glock.c index efd44d5645d8..f19e49a5d032 100644 --- a/fs/gfs2/glock.c +++ b/fs/gfs2/glock.c @@ -758,7 +758,8 @@ again: } 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); *glp = tmp; return ret; |