"lfs setstripe --commponent-add" missed setting component pattern,
which causes some setting missing, like overstriping, compression.
Lustre-change: https://review.whamcloud.com/53817
Lustre-commit: TBD (from
3849e3efdc58d535ee6858aafa22cfdc665ba2d7)
Signed-off-by: Bobi Jam <bobijam@whamcloud.com>
Change-Id: I7ad746a550f1afea54a6f5b68823a79a85a44082
Reviewed-on: https://review.whamcloud.com/c/ex/lustre-release/+/53811
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Sebastien Buisson <sbuisson@ddn.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
lod_comp->llc_stripe_size = v1->lmm_stripe_size;
lod_comp->llc_stripe_count = v1->lmm_stripe_count;
+ lod_comp->llc_pattern = v1->lmm_pattern;
/**
* limit stripe count so that it's less than/equal to
* extent_size / stripe_size.
lod_comp->llc_compr_type =
comp_v1->lcm_entries[i].lcme_compr_type;
-
lod_comp->llc_compr_lvl =
comp_v1->lcm_entries[i].lcme_compr_lvl;
lod_comp->llc_compr_chunk_log_bits =
}
run_test 0b "compression types negotiation between client and MDT"
+test_1a() {
+ local tf=$DIR/$tfile
+ stack_trap "rm -f $tf; disable_compression"
+ enable_compression
+
+ $LFS setstripe -E1M $tf || error "setstripe failed"
+ $LFS setstripe -Eeof --component-add -Z gzip $tf ||
+ error "add compression component failed"
+
+ $LFS getstripe -I2 --compr-type $tf | grep "gzip" || {
+ $LFS getstripe -v $tf
+ error "added component should be a compression one"
+ }
+}
+run_test 1a "add a compression component"
+
test_sanity()
{
always_except LU-16928 56wb
}
run_test 27Ch "overstriping with -C -1 in mdt_dump_lmm"
+test_27Ci() {
+ local tf=$DIR/$tfile
+
+ stack_trap "rm -f $DIR/$tfile"
+
+ $LFS setstripe -E1M $tf || error "create $tf failed"
+ $LFS setstripe -Eeof --component-add -C 100 $tf ||
+ error "add component failed"
+
+ $LFS getstripe -I2 $tf | awk '/lmm_pattern/ { print $2 }' |
+ grep "overstriped" || {
+ $LFS getstripe $tf
+ echo "lose overstriping setting"
+ }
+ sc=$($LFS getstripe -I2 --stripe-count $tf)
+ (( $sc == 100 )) || {
+ $LFS getstripe $tf
+ echo "lose overstriping setting"
+ }
+
+ stack_trap "rm -f $tf"
+ dd if=/dev/zero of=$tf bs=1M count=10 || error "write $tf"
+ sc=$($LFS getstripe -I2 --stripe-count $tf)
+ (( $sc == 100 )) || {
+ $LFS getstripe $tf
+ echo "lose overstriping setting after instantiation"
+ }
+}
+run_test 27Ci "add an overstriping component"
+
test_27D() {
[ $OSTCOUNT -lt 2 ] && skip_env "needs >= 2 OSTs"
[ -n "$FILESET" ] && skip "SKIP due to FILESET set"