diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2011-06-07 21:44:10 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2011-06-07 21:44:10 -0400 |
commit | d205df9955feb9c2ae63ac1387804e225ff22605 (patch) | |
tree | abae84cb6fc082f14072089bb0058b1bbd88c97a /fs/gfs2 | |
parent | 24210071e0dd7da1a945a2a1686b93f2b2f3b410 (diff) | |
parent | f90e5b5b136ede1f0fd15999e95f13124d6b0dbd (diff) |
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.c | 9 |
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) | |||
663 | drop_ref = 1; | 663 | drop_ref = 1; |
664 | } | 664 | } |
665 | spin_lock(&gl->gl_spin); | 665 | spin_lock(&gl->gl_spin); |
666 | if (test_and_clear_bit(GLF_PENDING_DEMOTE, &gl->gl_flags) && | 666 | if (test_bit(GLF_PENDING_DEMOTE, &gl->gl_flags) && |
667 | gl->gl_state != LM_ST_UNLOCKED && | 667 | gl->gl_state != LM_ST_UNLOCKED && |
668 | gl->gl_demote_state != LM_ST_EXCLUSIVE) { | 668 | gl->gl_demote_state != LM_ST_EXCLUSIVE) { |
669 | unsigned long holdtime, now = jiffies; | 669 | unsigned long holdtime, now = jiffies; |
670 | |||
670 | holdtime = gl->gl_tchange + gl->gl_ops->go_min_hold_time; | 671 | holdtime = gl->gl_tchange + gl->gl_ops->go_min_hold_time; |
671 | if (time_before(now, holdtime)) | 672 | if (time_before(now, holdtime)) |
672 | delay = holdtime - now; | 673 | delay = holdtime - now; |
673 | set_bit(delay ? GLF_PENDING_DEMOTE : GLF_DEMOTE, &gl->gl_flags); | 674 | |
675 | if (!delay) { | ||
676 | clear_bit(GLF_PENDING_DEMOTE, &gl->gl_flags); | ||
677 | set_bit(GLF_DEMOTE, &gl->gl_flags); | ||
678 | } | ||
674 | } | 679 | } |
675 | run_queue(gl, 0); | 680 | run_queue(gl, 0); |
676 | spin_unlock(&gl->gl_spin); | 681 | spin_unlock(&gl->gl_spin); |