aboutsummaryrefslogtreecommitdiffstats
path: root/fs/gfs2/glock.c
diff options
context:
space:
mode:
authorSteven Whitehouse <swhiteho@redhat.com>2006-07-05 13:16:19 -0400
committerSteven Whitehouse <swhiteho@redhat.com>2006-07-05 13:16:19 -0400
commit627add2d1385394d020c84533c91ad26bc37b166 (patch)
treea039b59e1d33ae40f5fd51d400aa734c2086db8d /fs/gfs2/glock.c
parentfd4de2d41a9de2d949b0850d637aa84616f87ab8 (diff)
[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)
1967 if (gfs2_glmutex_trylock(gl)) { 1967 if (gfs2_glmutex_trylock(gl)) {
1968 if (gl->gl_ops == &gfs2_inode_glops) { 1968 if (gl->gl_ops == &gfs2_inode_glops) {
1969 struct gfs2_inode *ip = gl->gl_object; 1969 struct gfs2_inode *ip = gl->gl_object;
1970 if (ip) 1970 if (ip == NULL) {
1971 struct gfs2_sbd *sdp = gl->gl_sbd;
1972 gfs2_assert_withdraw(sdp, gl->gl_state == LM_ST_UNLOCKED);
1971 goto out_schedule; 1973 goto out_schedule;
1974 }
1972 } 1975 }
1973 if (queue_empty(gl, &gl->gl_holders) && 1976 if (queue_empty(gl, &gl->gl_holders) &&
1974 gl->gl_state != LM_ST_UNLOCKED && 1977 gl->gl_state != LM_ST_UNLOCKED &&
@@ -1982,7 +1985,7 @@ static void scan_glock(struct gfs2_glock *gl)
1982 1985
1983 return; 1986 return;
1984 1987
1985 out_schedule: 1988out_schedule:
1986 gfs2_glmutex_unlock(gl); 1989 gfs2_glmutex_unlock(gl);
1987 gfs2_glock_schedule_for_reclaim(gl); 1990 gfs2_glock_schedule_for_reclaim(gl);
1988 gfs2_glock_put(gl); 1991 gfs2_glock_put(gl);