From a32e3ca30a477407ed0e29bfaa99e68dc05266a1 Mon Sep 17 00:00:00 2001 From: Vitaly Fertman Date: Thu, 17 Jun 2010 15:01:04 +0400 Subject: [PATCH] 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 --- lustre/mdt/mdt_handler.c | 2 ++ lustre/mdt/mdt_open.c | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) 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); -- 1.8.3.1