diff options
-rw-r--r-- | fs/gfs2/glock.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/fs/gfs2/glock.c b/fs/gfs2/glock.c index 8d5450f3c3ef..cd0aa213fb2f 100644 --- a/fs/gfs2/glock.c +++ b/fs/gfs2/glock.c | |||
@@ -587,6 +587,7 @@ static void run_queue(struct gfs2_glock *gl, const int nonblock) | |||
587 | if (nonblock) | 587 | if (nonblock) |
588 | goto out_sched; | 588 | goto out_sched; |
589 | set_bit(GLF_DEMOTE_IN_PROGRESS, &gl->gl_flags); | 589 | set_bit(GLF_DEMOTE_IN_PROGRESS, &gl->gl_flags); |
590 | GLOCK_BUG_ON(gl, gl->gl_demote_state == LM_ST_EXCLUSIVE); | ||
590 | gl->gl_target = gl->gl_demote_state; | 591 | gl->gl_target = gl->gl_demote_state; |
591 | } else { | 592 | } else { |
592 | if (test_bit(GLF_DEMOTE, &gl->gl_flags)) | 593 | if (test_bit(GLF_DEMOTE, &gl->gl_flags)) |
@@ -617,7 +618,9 @@ static void glock_work_func(struct work_struct *work) | |||
617 | if (test_and_clear_bit(GLF_REPLY_PENDING, &gl->gl_flags)) | 618 | if (test_and_clear_bit(GLF_REPLY_PENDING, &gl->gl_flags)) |
618 | finish_xmote(gl, gl->gl_reply); | 619 | finish_xmote(gl, gl->gl_reply); |
619 | spin_lock(&gl->gl_spin); | 620 | spin_lock(&gl->gl_spin); |
620 | if (test_and_clear_bit(GLF_PENDING_DEMOTE, &gl->gl_flags)) { | 621 | if (test_and_clear_bit(GLF_PENDING_DEMOTE, &gl->gl_flags) && |
622 | gl->gl_state != LM_ST_UNLOCKED && | ||
623 | gl->gl_demote_state != LM_ST_EXCLUSIVE) { | ||
621 | unsigned long holdtime, now = jiffies; | 624 | unsigned long holdtime, now = jiffies; |
622 | holdtime = gl->gl_tchange + gl->gl_ops->go_min_hold_time; | 625 | holdtime = gl->gl_tchange + gl->gl_ops->go_min_hold_time; |
623 | if (time_before(now, holdtime)) | 626 | if (time_before(now, holdtime)) |