Whamcloud - gitweb
fix return value for mdt_is_subdir().
authorhuanghua <huanghua>
Thu, 12 Oct 2006 07:30:29 +0000 (07:30 +0000)
committerhuanghua <huanghua>
Thu, 12 Oct 2006 07:30:29 +0000 (07:30 +0000)
lustre/mdt/mdt_handler.c
lustre/mdt/mdt_open.c

index fcc0ef4..c46f556 100644 (file)
@@ -524,10 +524,9 @@ static int mdt_is_subdir(struct mdt_thread_info *info)
         repbody->mode = rc;
         repbody->valid = OBD_MD_FLMODE;
 
-        if (rc == EREMOTE)
+        if (rc == -EREMOTE)
                 repbody->valid |= OBD_MD_FLID;
 
-
         RETURN(0);
 }
 
@@ -692,8 +691,6 @@ static int mdt_getattr_name_lock(struct mdt_thread_info *info,
                                 mdt_pack_size2body(repbody, ma, child);
                         LDLM_LOCK_PUT(lock);
                 }
-
-
         }
         EXIT;
 out_child:
index 6aab3b3..fad899d 100644 (file)
@@ -150,7 +150,8 @@ int mdt_epoch_open(struct mdt_thread_info *info, struct mdt_object *o)
                 struct mdt_lock_handle  *lh = &info->mti_lh[MDT_LH_CHILD];
                 lh->mlh_mode = LCK_EX;
                 rc = mdt_object_lock(info, o, lh, MDS_INODELOCK_UPDATE);
-                mdt_object_unlock(info, o, lh, 1);
+                if (rc == 0)
+                        mdt_object_unlock(info, o, lh, 1);
         }
         RETURN(rc);
 }