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>
}
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
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"
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;