From: Sebastien Buisson Date: Thu, 31 Oct 2019 11:33:45 +0000 (+0900) Subject: LU-12895 mdt: check if object exists first X-Git-Tag: 2.12.4-RC1~25 X-Git-Url: https://git.whamcloud.com/?a=commitdiff_plain;h=e3d4d6b91434c72e39196ec795abe3fb8631100a;p=fs%2Flustre-release.git LU-12895 mdt: check if object exists first Make sure object exists before trying to get its attr. Lustre-change: https://review.whamcloud.com/36629 Lustre-commit: ca68e3d677a371497586167a2318268db1d94cab 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/37032 Reviewed-by: Andreas Dilger Tested-by: jenkins Tested-by: Maloo --- diff --git a/lustre/mdt/mdt_handler.c b/lustre/mdt/mdt_handler.c index 85f1ce2..da2547d 100644 --- a/lustre/mdt/mdt_handler.c +++ b/lustre/mdt/mdt_handler.c @@ -1884,9 +1884,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) { LDLM_LOCK_PUT(lock); mdt_object_put(info->mti_env, child); /* NB: call the mdt_pack_size2body always after