Whamcloud - gitweb
Branch b1_6
authorvitaly <vitaly>
Tue, 16 Oct 2007 16:35:46 +0000 (16:35 +0000)
committervitaly <vitaly>
Tue, 16 Oct 2007 16:35:46 +0000 (16:35 +0000)
b=13693
i=adilger
i=green

do not forget to cancel locally locks with invalid import;
do not cancel locks in ldlm_lock_list_put() when 0 locks are to be canceled;

lustre/include/lustre_dlm.h
lustre/ldlm/ldlm_request.c

index 4d1d11c..020ce33 100644 (file)
@@ -621,11 +621,12 @@ do {                                            \
         struct ldlm_lock *_lock, *_next;                        \
         int c = count;                                          \
         list_for_each_entry_safe(_lock, _next, head, member) {  \
+                if (c-- == 0)                                   \
+                        break;                                  \
                 list_del_init(&_lock->member);                  \
                 LDLM_LOCK_PUT(_lock);                           \
-                if (--c == 0)                                   \
-                        break;                                  \
         }                                                       \
+        LASSERT(c <= 0);                                       \
 })
 
 struct ldlm_lock *ldlm_lock_get(struct ldlm_lock *lock);
index cb8c6e4..76aec4b 100644 (file)
@@ -877,7 +877,7 @@ int ldlm_cli_cancel_req(struct obd_export *exp,
                 if (imp == NULL || imp->imp_invalid) {
                         CDEBUG(D_DLMTRACE,
                                "skipping cancel on invalid import %p\n", imp);
-                        break;
+                        RETURN(count);
                 }
 
                 req = ptlrpc_prep_req(imp, LUSTRE_DLM_VERSION, LDLM_CANCEL, 2,