Skip to content

Commit da7d554

Browse files
Alexander AringAndreas Gruenbacher
authored andcommitted
gfs2: Wake up when sd_glock_disposal becomes zero
Commit fc0e38d ("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: fc0e38d ("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>
1 parent 6bd1c7b commit da7d554

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

fs/gfs2/glock.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1078,7 +1078,8 @@ int gfs2_glock_get(struct gfs2_sbd *sdp, u64 number,
10781078
out_free:
10791079
kfree(gl->gl_lksb.sb_lvbptr);
10801080
kmem_cache_free(cachep, gl);
1081-
atomic_dec(&sdp->sd_glock_disposal);
1081+
if (atomic_dec_and_test(&sdp->sd_glock_disposal))
1082+
wake_up(&sdp->sd_glock_wait);
10821083

10831084
out:
10841085
return ret;

0 commit comments

Comments
 (0)