summaryrefslogtreecommitdiffstats
path: root/fs/gfs2
diff options
context:
space:
mode:
authorLinus Torvalds2011-06-08 03:44:10 +0200
committerLinus Torvalds2011-06-08 03:44:10 +0200
commitd205df9955feb9c2ae63ac1387804e225ff22605 (patch)
treeabae84cb6fc082f14072089bb0058b1bbd88c97a /fs/gfs2
parentMerge branch 'fbdev-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/ke... (diff)
parentGFS2: Processes waiting on inode glock that no processes are holding (diff)
downloadkernel-qcow2-linux-d205df9955feb9c2ae63ac1387804e225ff22605.tar.gz
kernel-qcow2-linux-d205df9955feb9c2ae63ac1387804e225ff22605.tar.xz
kernel-qcow2-linux-d205df9955feb9c2ae63ac1387804e225ff22605.zip
Merge git://git.kernel.org/pub/scm/linux/kernel/git/steve/gfs2-2.6-fixes
* git://git.kernel.org/pub/scm/linux/kernel/git/steve/gfs2-2.6-fixes: GFS2: Processes waiting on inode glock that no processes are holding
Diffstat (limited to 'fs/gfs2')
-rw-r--r--fs/gfs2/glock.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/fs/gfs2/glock.c b/fs/gfs2/glock.c
index 2792a790e50b..1c1336e7b3b2 100644
--- a/fs/gfs2/glock.c
+++ b/fs/gfs2/glock.c
@@ -663,14 +663,19 @@ static void glock_work_func(struct work_struct *work)
drop_ref = 1;
}
spin_lock(&gl->gl_spin);
- if (test_and_clear_bit(GLF_PENDING_DEMOTE, &gl->gl_flags) &&
+ if (test_bit(GLF_PENDING_DEMOTE, &gl->gl_flags) &&
gl->gl_state != LM_ST_UNLOCKED &&
gl->gl_demote_state != LM_ST_EXCLUSIVE) {
unsigned long holdtime, now = jiffies;
+
holdtime = gl->gl_tchange + gl->gl_ops->go_min_hold_time;
if (time_before(now, holdtime))
delay = holdtime - now;
- set_bit(delay ? GLF_PENDING_DEMOTE : GLF_DEMOTE, &gl->gl_flags);
+
+ if (!delay) {
+ clear_bit(GLF_PENDING_DEMOTE, &gl->gl_flags);
+ set_bit(GLF_DEMOTE, &gl->gl_flags);
+ }
}
run_queue(gl, 0);
spin_unlock(&gl->gl_spin);