From: huanghua Date: Thu, 12 Oct 2006 07:30:29 +0000 (+0000) Subject: fix return value for mdt_is_subdir(). X-Git-Tag: v1_8_0_110~486^2~594 X-Git-Url: https://git.whamcloud.com/?a=commitdiff_plain;h=acd7b139500aeb209455c9fca83d0702dbaff02f;p=fs%2Flustre-release.git fix return value for mdt_is_subdir(). --- diff --git a/lustre/mdt/mdt_handler.c b/lustre/mdt/mdt_handler.c index fcc0ef4..c46f556 100644 --- a/lustre/mdt/mdt_handler.c +++ b/lustre/mdt/mdt_handler.c @@ -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: diff --git a/lustre/mdt/mdt_open.c b/lustre/mdt/mdt_open.c index 6aab3b3..fad899d 100644 --- a/lustre/mdt/mdt_open.c +++ b/lustre/mdt/mdt_open.c @@ -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); }