Whamcloud - gitweb
- fix for sanity test 48a in CMD. lock can be lost in case of -ESTALE
authortappro <tappro>
Sun, 17 Sep 2006 22:36:39 +0000 (22:36 +0000)
committertappro <tappro>
Sun, 17 Sep 2006 22:36:39 +0000 (22:36 +0000)
lustre/lmv/lmv_intent.c

index 0453db8..4eabff0 100644 (file)
@@ -119,8 +119,7 @@ int lmv_intent_remote(struct obd_export *exp, void *lmm,
          */
         if (rc == 0) {
                 lmv_drop_intent_lock(it);
-                memcpy(&it->d.lustre.it_lock_handle, &plock,
-                       sizeof(plock));
+                memcpy(&it->d.lustre.it_lock_handle, &plock, sizeof(plock));
                 it->d.lustre.it_lock_mode = pmode;
         }
 
@@ -249,7 +248,12 @@ repeat:
                         /* client switches to new sequence, setup fld */
                         goto repeat;
                 }
+        } else if (rc == -ESTALE && it->d.lustre.it_lock_mode) {
+                /* cross-ref open can have lookup lock on child */
+                ldlm_lock_decref(&it->d.lustre.it_lock_handle,
+                                 it->d.lustre.it_lock_mode);
         }
+
         if (rc != 0)
                 GOTO(out_free_sop_data, rc);