aboutsummaryrefslogtreecommitdiffstats
path: root/fs/dlm
diff options
context:
space:
mode:
Diffstat (limited to 'fs/dlm')
-rw-r--r--fs/dlm/lock.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/fs/dlm/lock.c b/fs/dlm/lock.c
index c2890efb0259..fa68e9b93651 100644
--- a/fs/dlm/lock.c
+++ b/fs/dlm/lock.c
@@ -2110,17 +2110,18 @@ static int validate_unlock_args(struct dlm_lkb *lkb, struct dlm_args *args)
2110 /* an lkb may be waiting for an rsb lookup to complete where the 2110 /* an lkb may be waiting for an rsb lookup to complete where the
2111 lookup was initiated by another lock */ 2111 lookup was initiated by another lock */
2112 2112
2113 if (args->flags & (DLM_LKF_CANCEL | DLM_LKF_FORCEUNLOCK)) { 2113 if (!list_empty(&lkb->lkb_rsb_lookup)) {
2114 if (!list_empty(&lkb->lkb_rsb_lookup)) { 2114 if (args->flags & (DLM_LKF_CANCEL | DLM_LKF_FORCEUNLOCK)) {
2115 log_debug(ls, "unlock on rsb_lookup %x", lkb->lkb_id); 2115 log_debug(ls, "unlock on rsb_lookup %x", lkb->lkb_id);
2116 list_del_init(&lkb->lkb_rsb_lookup); 2116 list_del_init(&lkb->lkb_rsb_lookup);
2117 queue_cast(lkb->lkb_resource, lkb, 2117 queue_cast(lkb->lkb_resource, lkb,
2118 args->flags & DLM_LKF_CANCEL ? 2118 args->flags & DLM_LKF_CANCEL ?
2119 -DLM_ECANCEL : -DLM_EUNLOCK); 2119 -DLM_ECANCEL : -DLM_EUNLOCK);
2120 unhold_lkb(lkb); /* undoes create_lkb() */ 2120 unhold_lkb(lkb); /* undoes create_lkb() */
2121 rv = -EBUSY;
2122 goto out;
2123 } 2121 }
2122 /* caller changes -EBUSY to 0 for CANCEL and FORCEUNLOCK */
2123 rv = -EBUSY;
2124 goto out;
2124 } 2125 }
2125 2126
2126 /* cancel not allowed with another cancel/unlock in progress */ 2127 /* cancel not allowed with another cancel/unlock in progress */