Whamcloud - gitweb
LU-17284 mdt: revalidate object for migration 87/53087/6
authorAlex Zhuravlev <bzzz@whamcloud.com>
Sat, 11 Nov 2023 12:21:48 +0000 (15:21 +0300)
committerOleg Drokin <green@whamcloud.com>
Tue, 23 Jan 2024 05:32:10 +0000 (05:32 +0000)
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 <bzzz@whamcloud.com>
Change-Id: I9896cdd011f858091ac68b50b74e2f1f027f7331
Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/53087
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Lai Siyao <lai.siyao@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
lustre/mdt/mdt_reint.c

index 4794ae7..81c531c 100644 (file)
@@ -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);