Whamcloud - gitweb
- fix the checking stale objects in mdt_getattr_name_lock
authortappro <tappro>
Wed, 11 Oct 2006 13:22:37 +0000 (13:22 +0000)
committertappro <tappro>
Wed, 11 Oct 2006 13:22:37 +0000 (13:22 +0000)
lustre/mdt/mdt_handler.c

index e3d7c8c..fcc0ef4 100644 (file)
@@ -566,6 +566,16 @@ static int mdt_getattr_name_lock(struct mdt_thread_info *info,
                PFID(mdt_object_fid(parent)), name, ldlm_rep);
 
         mdt_set_disposition(info, ldlm_rep, DISP_LOOKUP_EXECD);
+
+        rc = mdt_object_exists(parent);
+        if (rc == 0)
+                RETURN(-ESTALE);
+        else if (rc < 0) {
+                CERROR("Object "DFID" locates on remote server\n",
+                        PFID(mdt_object_fid(parent)));
+                LBUG();
+        }
+
         if (strlen(name) == 0) {
                 /* Only getattr on the child. Parent is on another node. */
                 mdt_set_disposition(info, ldlm_rep, DISP_LOOKUP_POS);
@@ -608,15 +618,6 @@ static int mdt_getattr_name_lock(struct mdt_thread_info *info,
                 GOTO(out, rc);
         }
 
-        rc = mdt_object_exists(parent);
-        if (rc == 0)
-                RETURN(-ESTALE);
-        else if (rc < 0) {
-                CERROR("Object "DFID" locates on remote server\n",
-                        PFID(mdt_object_fid(parent)));
-                LBUG();
-        }
-
         /*step 1: lock parent */
         lhp = &info->mti_lh[MDT_LH_PARENT];
         lhp->mlh_mode = LCK_CR;