From: Vitaly Fertman Date: Thu, 17 Jun 2010 11:01:04 +0000 (+0400) Subject: b=22768 mdt open error handling X-Git-Tag: v2_0_0-rc1~34 X-Git-Url: https://git.whamcloud.com/?p=fs%2Flustre-release.git;a=commitdiff_plain;h=a32e3ca30a477407ed0e29bfaa99e68dc05266a1 b=22768 mdt open error handling i=green i=rread mdt_finish_open() may return an error, which must result in unlocking the object and returning it to client --- diff --git a/lustre/mdt/mdt_handler.c b/lustre/mdt/mdt_handler.c index 3583a2b..bf0f760 100644 --- a/lustre/mdt/mdt_handler.c +++ b/lustre/mdt/mdt_handler.c @@ -3411,6 +3411,8 @@ static int mdt_intent_reint(enum mdt_it_code opcode, * checked here. */ if (lustre_handle_is_used(&lhc->mlh_reg_lh)) { + LASSERTF(rc == 0, "Error occurred but lock handle " + "is still in use\n"); rep->lock_policy_res2 = 0; rc = mdt_intent_lock_replace(info, lockp, NULL, lhc, flags); RETURN(rc); diff --git a/lustre/mdt/mdt_open.c b/lustre/mdt/mdt_open.c index ee8d062..2aef7e7 100644 --- a/lustre/mdt/mdt_open.c +++ b/lustre/mdt/mdt_open.c @@ -1078,7 +1078,7 @@ static int mdt_open_anon_by_fid(struct mdt_thread_info* info, mdt_set_disposition(info, rep, DISP_OPEN_LOCK); rc = mdt_finish_open(info, NULL, o, flags, 0, rep); - if (!(flags & MDS_OPEN_LOCK)) + if (!(flags & MDS_OPEN_LOCK) || rc) mdt_object_unlock(info, o, lhc, 1); GOTO(out, rc);