Whamcloud - gitweb
LU-7860 ldlm: revert part of commit 657bbc49 09/20509/4
authorBobi Jam <bobijam.xu@intel.com>
Tue, 31 May 2016 04:18:55 +0000 (12:18 +0800)
committerOleg Drokin <oleg.drokin@intel.com>
Mon, 20 Jun 2016 00:59:07 +0000 (00:59 +0000)
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 <bobijam.xu@intel.com>
Change-Id: I8841422d6e2f6bf92efa24d542583936123ead66
Reviewed-on: http://review.whamcloud.com/20509
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Reviewed-by: Liang Zhen <liang.zhen@intel.com>
Reviewed-by: Vitaly Fertman <vitaly.fertman@seagate.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
lustre/ldlm/ldlm_lock.c

index e973edc..10f8e8f 100644 (file)
@@ -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);