Whamcloud - gitweb
LU-18421 utils: Do not inherit stripe size from DOM component 01/57501/5
authorRajeev Mishra <rajeevm@hpe.com>
Wed, 18 Dec 2024 05:16:11 +0000 (05:16 +0000)
committerOleg Drokin <green@whamcloud.com>
Sun, 2 Feb 2025 06:28:08 +0000 (06:28 +0000)
When a DOM file is created with multiple components,
the size of the first component is inherited by the
other components if their sizes are not explicitly specified.

This fix ensures that the size of subsequent components is
set to the default size when no size is provided.

New test added in
sanity-dom.sh:
Added test 8 to validate the creation of a default
stripe size when no stripe size is explicitly specified.

Modified test--
sanity-pfl.sh:
modified 21b test so that stripe size is 1MB
as test assumes 1MB size while doing find

Test-Parameters: testlist=sanity-dom
HPE-bug-id: LUS-12585
Signed-off-by: Rajeev Mishra <rajeevm@hpe.com>
Change-Id: I3388c289084769a96d8b87ae3a8268e5eb19a67e
Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/57501
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Patrick Farrell <pfarrell@whamcloud.com>
Reviewed-by: Mikhail Pershin <mpershin@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
lustre/tests/sanity-dom.sh
lustre/tests/sanity-pfl.sh
lustre/utils/lfs.c

index 3666ef1..3434c97 100644 (file)
@@ -168,6 +168,24 @@ test_7() {
 }
 run_test 7 "Stale pages after read-on-open"
 
+test_8() {
+        local file=$DIR/$tdir/$tfile
+       local def_stripe_size
+       local stripe_size
+
+        test_mkdir $DIR/$tdir
+        $LFS setstripe -E 128k -L mdt -E 8M -c 1 $file \
+       || error "setstripe failed"
+        def_stripe_size=$($LFS getstripe -S $MOUNT)
+        stripe_size=$($LFS getstripe -S --component-start=131072 \
+               --component-end=8388608 $file)
+       (($stripe_size == $def_stripe_size)) ||
+                        error "$f stripe size $stripe_size != $def_stripe_size"
+        rm -fr $DIR/$tdir
+}
+run_test 8 "verify the default size of component"
+
+
 test_fsx() {
        local file1=$DIR1/$tfile
        local file2=$DIR2/$tfile
index 268f851..578bb27 100755 (executable)
@@ -1940,8 +1940,8 @@ test_21b() {
        test_mkdir -p $DIR/$tdir
 
        # DoM, extendable component, further extendable component
-       $LFS setstripe -E 1M -L mdt -E 256M -i 0 -z 64M -E -1 -z 128M \
-               $comp_file || error "Create $comp_file failed"
+       $LFS setstripe -E 1M -L mdt -S 1M -E 256M -i 0 -z 64M -S 1M -E -1 \
+               -z 128M $comp_file || error "Create $comp_file failed"
 
        found=$($LFS find --comp-start 1M -E 1M $flg_opts $comp_file | wc -l)
        [ $found -eq 1 ] || error "Write: Zero length component not found"
index ad97fd5..e08a97d 100755 (executable)
@@ -2914,7 +2914,10 @@ static inline void setstripe_args_init_inherit(struct lfs_setstripe_args *lsa)
        long long stripe_count;
        char *pool_name = NULL;
 
-       stripe_size = lsa->lsa_stripe_size;
+       if (lsa->lsa_pattern == LLAPI_LAYOUT_MDT)
+               stripe_size = LLAPI_LAYOUT_DEFAULT;
+       else
+               stripe_size = lsa->lsa_stripe_size;
        stripe_count = lsa->lsa_stripe_count;
        pool_name = lsa->lsa_pool_name;