Skip to contentSkip to conversation

dlm: ignore cancel on granted lock

PATCH New David Teigland 1 participant 1 message Mar 24, 2009 Distributed lock manager (DLM)

lore
Share & tools
lore

David Teigland

author maintainer
#0 lore raw

PATCH 6/7 dlm: ignore cancel on granted lock

Return immediately from dlm_unlock(CANCEL) if the lock is granted and not being converted; there's nothing to cancel.

---
 fs/dlm/lock.c |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)
fs/dlm/lock.c +7 -0
index 8cb9204..205ec95 100644
@@ -2186,6 +2186,13 @@ static int validate_unlock_args(struct dlm_lkb *lkb, struct dlm_args *args)
 			goto out;
 		}
 
+		/* there's nothing to cancel */
+		if (lkb->lkb_status == DLM_LKSTS_GRANTED &&
+		    !lkb->lkb_wait_type) {
+			rv = -EBUSY;
+			goto out;
+		}
+
 		switch (lkb->lkb_wait_type) {
 		case DLM_MSG_LOOKUP:
 		case DLM_MSG_REQUEST:
Signature · 1 line
1.5.5.6