From 62a859fade43e23636170d054a4385d5b669774c Mon Sep 17 00:00:00 2001 From: Bobi Jam Date: Tue, 31 May 2016 12:18:55 +0800 Subject: [PATCH] LU-7860 ldlm: revert part of commit 657bbc49 During ldlm_lock_cancel()->ldlm_cancel_callback(), the lock could possibly be added back to waiting list with no resource lock holding. Put back the second checking and removing from the waiting list. Signed-off-by: Bobi Jam Change-Id: I8841422d6e2f6bf92efa24d542583936123ead66 Reviewed-on: http://review.whamcloud.com/20509 Tested-by: Jenkins Tested-by: Maloo Reviewed-by: Andreas Dilger Reviewed-by: Liang Zhen Reviewed-by: Vitaly Fertman Reviewed-by: Oleg Drokin --- lustre/ldlm/ldlm_lock.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lustre/ldlm/ldlm_lock.c b/lustre/ldlm/ldlm_lock.c index e973edc..10f8e8f 100644 --- a/lustre/ldlm/ldlm_lock.c +++ b/lustre/ldlm/ldlm_lock.c @@ -2273,7 +2273,10 @@ void ldlm_lock_cancel(struct ldlm_lock *lock) /* Releases cancel callback. */ ldlm_cancel_callback(lock); - LASSERT(!ldlm_is_waited(lock)); + /* Yes, second time, just in case it was added again while we were + * running with no res lock in ldlm_cancel_callback */ + if (ldlm_is_waited(lock)) + ldlm_del_waiting_lock(lock); ldlm_resource_unlink_lock(lock); ldlm_lock_destroy_nolock(lock); -- 1.8.3.1