Whamcloud - gitweb
LU-18059 utils: lfs migrate fails for ost striped file 47/55847/8
authorRajeev Mishra <rajeevm@hpe.com>
Tue, 23 Jul 2024 20:57:03 +0000 (20:57 +0000)
committerOleg Drokin <green@whamcloud.com>
Fri, 23 Aug 2024 21:59:06 +0000 (21:59 +0000)
The lfs migrate fails for the ost striped file
with following error message
lfs migrate: can't create composite layout from
file /mnt/lustre/d56xh.sanity.src:
Numerical result out of range

test_56ej has been added to sanity.sh to test this
scenario.

Signed-off-by: Rajeev Mishra <rajeevm@hpe.com>
HPE-bug-id: LUS-11815
Test-Parameters: trivial
Change-Id: Idc345c3662fde5db3d323019927b4d3a82b04816
Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/55847
Tested-by: Maloo <maloo@whamcloud.com>
Tested-by: jenkins <devops@whamcloud.com>
Reviewed-by: Petros Koutoupis <petros.koutoupis@hpe.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
lustre/tests/sanity.sh
lustre/utils/liblustreapi_layout.c

index 05af821..b10e7e4 100755 (executable)
@@ -9735,6 +9735,22 @@ test_56ei() {
 }
 run_test 56ei "test lfs find --printf prints correct projid for special files"
 
+test_56ej() {
+       test_mkdir $DIR/$tdir.src ||
+               error "mkdir failed on $DIR/$tdir.src"
+       test_mkdir $DIR/$tdir.dest ||
+               error "mkdir failed on $DIR/$tdir.dest"
+       local f_mgrt=$DIR/$tdir.dest/$tfile.mgrt
+
+       $LFS setstripe -o 1 $DIR/$tdir.src
+       $LFS setstripe -o 0 $DIR/$tdir.dest
+       dd if=/dev/random of=$f_mgrt bs=1M count=1
+
+       $LFS migrate  --non-block --copy $DIR/$tdir.src $f_mgrt ||
+               error "migrate remote dir error $DIR/$tdir.src $f_mgrt"
+}
+run_test 56ej "lfs migration --non-block copy"
+
 test_57a() {
        [ $PARALLEL == "yes" ] && skip "skip parallel run"
        # note test will not do anything if MDS is not local
index 498ed04..7e3ad0d 100644 (file)
@@ -464,6 +464,9 @@ static bool llapi_layout_lum_truncated(struct lov_user_md *lum, size_t lum_size)
        else if (lum->lmm_magic == LOV_MAGIC_V3 ||
                 lum->lmm_magic == __swab32(LOV_MAGIC_V3))
                magic = LOV_MAGIC_V3;
+       else if (lum->lmm_magic == LOV_MAGIC_SPECIFIC ||
+                lum->lmm_magic == __swab32(LOV_MAGIC_SPECIFIC))
+               magic = LOV_MAGIC_V3;
        else if (lum->lmm_magic == LOV_MAGIC_COMP_V1 ||
                 lum->lmm_magic == __swab32(LOV_MAGIC_COMP_V1))
                magic = LOV_MAGIC_COMP_V1;
@@ -588,7 +591,8 @@ struct llapi_layout *llapi_layout_get_by_xattr(void *lov_xattr,
                layout->llot_gen = comp_v1->lcm_layout_gen;
                layout->llot_flags = comp_v1->lcm_flags;
        } else if (lum->lmm_magic == LOV_MAGIC_V1 ||
-                  lum->lmm_magic == LOV_MAGIC_V3) {
+                  lum->lmm_magic == LOV_MAGIC_V3 ||
+                  lum->lmm_magic == LOV_MAGIC_SPECIFIC) {
                ent_count = 1;
                layout->llot_is_composite = false;