From acd7b139500aeb209455c9fca83d0702dbaff02f Mon Sep 17 00:00:00 2001 From: huanghua Date: Thu, 12 Oct 2006 07:30:29 +0000 Subject: [PATCH] fix return value for mdt_is_subdir(). --- lustre/mdt/mdt_handler.c | 5 +---- lustre/mdt/mdt_open.c | 3 ++- 2 files changed, 3 insertions(+), 5 deletions(-) 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); } -- 1.8.3.1