From ca68e3d677a371497586167a2318268db1d94cab Mon Sep 17 00:00:00 2001 From: Sebastien Buisson Date: Thu, 31 Oct 2019 20:33:45 +0900 Subject: [PATCH] LU-12895 mdt: check if object exists first Make sure object exists before trying to get its attr. Test-Parameters: clientselinux mdtcount=4 envdefinitions=ONLY=185a testlist=sanity,sanity,sanity,sanity Test-Parameters: clientselinux mdtcount=4 testlist=sanity,recovery-small,sanity-sec Signed-off-by: Sebastien Buisson Change-Id: Idb2cd5d6e3fdf7998040b933be54a001a0e5391b Reviewed-on: https://review.whamcloud.com/36629 Reviewed-by: Alex Zhuravlev Tested-by: jenkins Tested-by: Maloo Reviewed-by: Andreas Dilger --- lustre/mdt/mdt_handler.c | 6 +++--- lustre/tests/sanity.sh | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/lustre/mdt/mdt_handler.c b/lustre/mdt/mdt_handler.c index ac39725..84e21d6 100644 --- a/lustre/mdt/mdt_handler.c +++ b/lustre/mdt/mdt_handler.c @@ -1927,9 +1927,9 @@ static int mdt_getattr_name_lock(struct mdt_thread_info *info, PLDLMRES(lock->l_resource), PFID(mdt_object_fid(child))); - if (S_ISREG(lu_object_attr(&child->mot_obj)) && - mdt_object_exists(child) && !mdt_object_remote(child) && - child != parent) { + if (mdt_object_exists(child) && + S_ISREG(lu_object_attr(&child->mot_obj)) && + !mdt_object_remote(child) && child != parent) { mdt_object_put(info->mti_env, child); rc = mdt_pack_size2body(info, child_fid, &lhc->mlh_reg_lh); diff --git a/lustre/tests/sanity.sh b/lustre/tests/sanity.sh index df92c36..6b08430 100644 --- a/lustre/tests/sanity.sh +++ b/lustre/tests/sanity.sh @@ -51,8 +51,8 @@ fi selinux_status=$(getenforce) if [ "$selinux_status" != "Disabled" ]; then - # bug number: LU-12895 LU-12469 LU-12469 - ALWAYS_EXCEPT+=" 185a 230b 230d" + # bug number: LU-12469 LU-12469 + ALWAYS_EXCEPT+=" 230b 230d" fi # skip the grant tests for ARM until they are fixed -- 1.8.3.1