From a4178fd9ecb82a8fd21983761ded114c4b38ca0c Mon Sep 17 00:00:00 2001 From: Alex Zhuravlev Date: Mon, 16 Oct 2023 21:22:05 +0300 Subject: [PATCH] LU-17200 mdt: check object's locality remote object can disappear while we're getting an ldlm lock for it. we can't check object's attributes before we're sure it does exist. so check object's locality first. Signed-off-by: Alex Zhuravlev Change-Id: I86ad0f3e7c38b0dce51a9fd836ba2293b210fe4f Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/52716 Tested-by: jenkins Tested-by: Maloo Reviewed-by: Mikhail Pershin Reviewed-by: Oleg Drokin Reviewed-by: Andreas Dilger --- lustre/mdt/mdt_handler.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/lustre/mdt/mdt_handler.c b/lustre/mdt/mdt_handler.c index 794ed24..19e05d0 100644 --- a/lustre/mdt/mdt_handler.c +++ b/lustre/mdt/mdt_handler.c @@ -2465,8 +2465,13 @@ static int mdt_getattr_name_lock(struct mdt_thread_info *info, ldlm_set_ast_sent(lock); } - if (S_ISREG(lu_object_attr(&child->mot_obj)) && - !mdt_object_remote(child) && child != parent) { + /* + * check whether the object is remote as we can't + * really check attributes w/o explicit check for + * object's existence first. + */ + if (!mdt_object_remote(child) && child != parent && + S_ISREG(lu_object_attr(&child->mot_obj))) { mdt_object_put(info->mti_env, child); rc = mdt_pack_size2body(info, child_fid, &lhc->mlh_reg_lh); -- 1.8.3.1