summaryrefslogtreecommitdiffstats
path: root/fs/gfs2/glock.c
diff options
context:
space:
mode:
authorSteven Whitehouse2006-07-05 19:16:19 +0200
committerSteven Whitehouse2006-07-05 19:16:19 +0200
commit627add2d1385394d020c84533c91ad26bc37b166 (patch)
treea039b59e1d33ae40f5fd51d400aa734c2086db8d /fs/gfs2/glock.c
parent[GFS2] Add cast for printk (diff)
downloadkernel-qcow2-linux-627add2d1385394d020c84533c91ad26bc37b166.tar.gz
kernel-qcow2-linux-627add2d1385394d020c84533c91ad26bc37b166.tar.xz
kernel-qcow2-linux-627add2d1385394d020c84533c91ad26bc37b166.zip
[GFS2] Correct logic in glock scanner
Under certain circumstances the glock scanning logic would demote locks which ought not to have been selected for demotion. Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
Diffstat (limited to 'fs/gfs2/glock.c')
-rw-r--r--fs/gfs2/glock.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/fs/gfs2/glock.c b/fs/gfs2/glock.c
index dbeb4ad836bd..7f362d0c3f7a 100644
--- a/fs/gfs2/glock.c
+++ b/fs/gfs2/glock.c
@@ -1967,8 +1967,11 @@ static void scan_glock(struct gfs2_glock *gl)
if (gfs2_glmutex_trylock(gl)) {
if (gl->gl_ops == &gfs2_inode_glops) {
struct gfs2_inode *ip = gl->gl_object;
- if (ip)
+ if (ip == NULL) {
+ struct gfs2_sbd *sdp = gl->gl_sbd;
+ gfs2_assert_withdraw(sdp, gl->gl_state == LM_ST_UNLOCKED);
goto out_schedule;
+ }
}
if (queue_empty(gl, &gl->gl_holders) &&
gl->gl_state != LM_ST_UNLOCKED &&
@@ -1982,7 +1985,7 @@ static void scan_glock(struct gfs2_glock *gl)
return;
- out_schedule:
+out_schedule:
gfs2_glmutex_unlock(gl);
gfs2_glock_schedule_for_reclaim(gl);
gfs2_glock_put(gl);