Whamcloud - gitweb
- if fid2 exists and this was create operation, then it is not same as returned
authortappro <tappro>
Sun, 6 Aug 2006 21:20:50 +0000 (21:20 +0000)
committertappro <tappro>
Sun, 6 Aug 2006 21:20:50 +0000 (21:20 +0000)
  in case no creation happens. The result was 'Stale NFS file handle' error in
  some tests - 7b, 23. now 23 pass but in 7b the other nasty bug occurs.

lustre/mdc/mdc_locks.c

index 44fdcff..11099b4 100644 (file)
@@ -679,7 +679,9 @@ int mdc_intent_lock(struct obd_export *exp, struct md_op_data *op_data,
                         !it_disposition(it, DISP_OPEN_CREATE)) {
                 it_set_disposition(it, DISP_ENQ_COMPLETE);
                 /* Also: did we find the same inode? */
-                if (memcmp(&op_data->fid2, &mdt_body->fid1, sizeof(op_data->fid2)))
+                if (!((it->it_create_mode & O_CREAT) || it->it_op & IT_CREAT)
+                    && memcmp(&op_data->fid2, &mdt_body->fid1,
+                              sizeof(op_data->fid2)))
                         RETURN(-ESTALE);
         }