Whamcloud - gitweb
Branch: b_new_cmd
authorwangdi <wangdi>
Mon, 21 Aug 2006 14:35:30 +0000 (14:35 +0000)
committerwangdi <wangdi>
Mon, 21 Aug 2006 14:35:30 +0000 (14:35 +0000)
only check stale when no fid allocation

lustre/mdc/mdc_locks.c

index 6ab7e49..722acc1 100644 (file)
@@ -704,12 +704,12 @@ int mdc_intent_lock(struct obd_export *exp, struct md_op_data *op_data,
         /* If we were revalidating a fid/name pair, mark the intent in
          * case we fail and get called again from lookup */
         if (fid_is_sane(&op_data->fid2) &&
-                        !it_disposition(it, DISP_OPEN_CREATE) && 
-                        !(it->it_op & IT_GETATTR)) {
+                     !(it->it_op & IT_GETATTR) && !(it->it_op & IT_CREAT)) {
                 it_set_disposition(it, DISP_ENQ_COMPLETE);
                 /* Also: did we find the same inode? */
-                if (!(it->it_op & IT_CREAT) && memcmp(&op_data->fid2, 
-                              &mdt_body->fid1, sizeof(op_data->fid2)))
+                if (!it_disposition(it, DISP_OPEN_CREATE) && 
+                    memcmp(&op_data->fid2, &mdt_body->fid1, 
+                            sizeof(op_data->fid2)))
                         RETURN(-ESTALE);
         }