Whamcloud - gitweb
Branch HEAD
authorvitaly <vitaly>
Tue, 16 Oct 2007 20:19:29 +0000 (20:19 +0000)
committervitaly <vitaly>
Tue, 16 Oct 2007 20:19:29 +0000 (20:19 +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 4680fab..49dcd79 100644 (file)
@@ -609,11 +609,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 6d4f672..b5ec3de 100644 (file)
@@ -891,7 +891,7 @@ int ldlm_cli_cancel_req(struct obd_export *exp, struct list_head *cancels,
                 if (imp == NULL || imp->imp_invalid) {
                         CDEBUG(D_HA, "skipping cancel on invalid import %p\n",
                                imp);
-                        break;
+                        RETURN(count);
                 }
 
                 req = ptlrpc_prep_req(imp, LUSTRE_DLM_VERSION, LDLM_CANCEL, 2,