From: Bobi Jam Date: Tue, 31 May 2016 04:18:55 +0000 (+0800) Subject: LU-7860 ldlm: revert part of commit 657bbc49 X-Git-Tag: 2.8.55~1 X-Git-Url: https://git.whamcloud.com/?p=fs%2Flustre-release.git;a=commitdiff_plain;h=62a859fade43e23636170d054a4385d5b669774c 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 --- 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);