aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ocfs2/dlmglue.c
diff options
context:
space:
mode:
authorMark Fasheh <mark.fasheh@oracle.com>2006-09-14 00:02:29 -0400
committerMark Fasheh <mark.fasheh@oracle.com>2006-09-24 16:50:47 -0400
commitf7fbfdd1fc91543253ba742a926a29c289f8e6ca (patch)
tree6a4f9c824a744a1d53f3a3dc7c4d851641b3b3e8 /fs/ocfs2/dlmglue.c
parentb80fc012e03f8f207911b5eafe6916b000e03c8b (diff)
ocfs2: Check for refreshing locks in generic unblock function
Tidy up the exit path a bit too. Signed-off-by: Mark Fasheh <mark.fasheh@oracle.com>
Diffstat (limited to 'fs/ocfs2/dlmglue.c')
-rw-r--r--fs/ocfs2/dlmglue.c31
1 files changed, 19 insertions, 12 deletions
diff --git a/fs/ocfs2/dlmglue.c b/fs/ocfs2/dlmglue.c
index 40562185088a..ebc4a49801bd 100644
--- a/fs/ocfs2/dlmglue.c
+++ b/fs/ocfs2/dlmglue.c
@@ -2640,22 +2640,22 @@ recheck:
2640 /* if we're blocking an exclusive and we have *any* holders, 2640 /* if we're blocking an exclusive and we have *any* holders,
2641 * then requeue. */ 2641 * then requeue. */
2642 if ((lockres->l_blocking == LKM_EXMODE) 2642 if ((lockres->l_blocking == LKM_EXMODE)
2643 && (lockres->l_ex_holders || lockres->l_ro_holders)) { 2643 && (lockres->l_ex_holders || lockres->l_ro_holders))
2644 spin_unlock_irqrestore(&lockres->l_lock, flags); 2644 goto leave_requeue;
2645 ctl->requeue = 1;
2646 ret = 0;
2647 goto leave;
2648 }
2649 2645
2650 /* If it's a PR we're blocking, then only 2646 /* If it's a PR we're blocking, then only
2651 * requeue if we've got any EX holders */ 2647 * requeue if we've got any EX holders */
2652 if (lockres->l_blocking == LKM_PRMODE && 2648 if (lockres->l_blocking == LKM_PRMODE &&
2653 lockres->l_ex_holders) { 2649 lockres->l_ex_holders)
2654 spin_unlock_irqrestore(&lockres->l_lock, flags); 2650 goto leave_requeue;
2655 ctl->requeue = 1; 2651
2656 ret = 0; 2652 /*
2657 goto leave; 2653 * Can we get a lock in this state if the holder counts are
2658 } 2654 * zero? The meta data unblock code used to check this.
2655 */
2656 if ((lockres->l_ops->flags & LOCK_TYPE_REQUIRES_REFRESH)
2657 && (lockres->l_flags & OCFS2_LOCK_REFRESHING))
2658 goto leave_requeue;
2659 2659
2660 /* If we get here, then we know that there are no more 2660 /* If we get here, then we know that there are no more
2661 * incompatible holders (and anyone asking for an incompatible 2661 * incompatible holders (and anyone asking for an incompatible
@@ -2692,6 +2692,13 @@ downconvert:
2692leave: 2692leave:
2693 mlog_exit(ret); 2693 mlog_exit(ret);
2694 return ret; 2694 return ret;
2695
2696leave_requeue:
2697 spin_unlock_irqrestore(&lockres->l_lock, flags);
2698 ctl->requeue = 1;
2699
2700 mlog_exit(0);
2701 return 0;
2695} 2702}
2696 2703
2697static int ocfs2_data_convert_worker(struct ocfs2_lock_res *lockres, 2704static int ocfs2_data_convert_worker(struct ocfs2_lock_res *lockres,