From e1a53a32637b0f2269009450f123cc5d419366c7 Mon Sep 17 00:00:00 2001 From: Alex Zhuravlev Date: Sat, 11 Nov 2023 15:21:48 +0300 Subject: [PATCH] LU-17284 mdt: revalidate object for migration if the source object is remote, then we should revlidate it once the object's ldlm lock is granted. otherwise we can't use the object's attributes: lu_object_attr()) ASSERTION( ((o)->lo_header->loh_attr & LOHA_EXISTS) != 0 Signed-off-by: Alex Zhuravlev Change-Id: I9896cdd011f858091ac68b50b74e2f1f027f7331 Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/53087 Tested-by: jenkins Tested-by: Maloo Reviewed-by: Lai Siyao Reviewed-by: Oleg Drokin Reviewed-by: Andreas Dilger --- lustre/mdt/mdt_reint.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/lustre/mdt/mdt_reint.c b/lustre/mdt/mdt_reint.c index 4794ae7..81c531c 100644 --- a/lustre/mdt/mdt_reint.c +++ b/lustre/mdt/mdt_reint.c @@ -2303,6 +2303,14 @@ lock_parent: if (rc) GOTO(unlock_links, rc); + if (mdt_object_remote(sobj)) { + struct md_attr *ma2 = &info->mti_attr2; + ma2->ma_need = MA_INODE; + rc = mo_attr_get(env, mdt_object_child(sobj), ma2); + if (rc) + GOTO(unlock_source, rc); + } + if (S_ISREG(lu_object_attr(&sobj->mot_obj))) { /* TODO: DoM migration is not supported, migrate dirent only */ rc = mdt_stripe_get(info, sobj, ma, XATTR_NAME_LOV); -- 1.8.3.1