Skip to content

Commit 483087b

Browse files
amotinbehlendorf
authored andcommitted
ZTS: Avoid embedded blocks in bclone/bclone_prop_sync
If we write less than 113 bytes with enabled compression we get embeded block, which then fails check for number of cloned blocks in bclone_test. Reviewed-by: Brian Behlendorf <[email protected]> Reviewed-by: Pawel Jakub Dawidek <[email protected]> Reviewed-by: Brian Atkinson <[email protected]> Signed-off-by: Alexander Motin <[email protected]> Sponsored by: iXsystems, Inc. Closes #16740
1 parent 648873f commit 483087b

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

tests/zfs-tests/tests/functional/bclone/bclone_prop_sync.ksh

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,11 @@ log_must zfs set compress=zle $TESTDSTFS
4141

4242
for prop in "${sync_prop_vals[@]}"; do
4343
log_must zfs set sync=$prop $TESTSRCFS
44+
# 15*8=120, which is greater than 113, so we are sure the data won't
45+
# be embedded into BP.
4446
# 32767*8=262136, which is larger than a single default recordsize of
4547
# 131072.
46-
FILESIZE=$(random_int_between 1 32767)
48+
FILESIZE=$(random_int_between 15 32767)
4749
FILESIZE=$((FILESIZE * 8))
4850
bclone_test random $FILESIZE false $TESTSRCDIR $TESTSRCDIR
4951
done
@@ -52,9 +54,11 @@ for srcprop in "${sync_prop_vals[@]}"; do
5254
log_must zfs set sync=$srcprop $TESTSRCFS
5355
for dstprop in "${sync_prop_vals[@]}"; do
5456
log_must zfs set sync=$dstprop $TESTDSTFS
57+
# 15*8=120, which is greater than 113, so we are sure the data won't
58+
# be embedded into BP.
5559
# 32767*8=262136, which is larger than a single default recordsize of
5660
# 131072.
57-
FILESIZE=$(random_int_between 1 32767)
61+
FILESIZE=$(random_int_between 15 32767)
5862
FILESIZE=$((FILESIZE * 8))
5963
bclone_test random $FILESIZE false $TESTSRCDIR $TESTDSTDIR
6064
done

0 commit comments

Comments
 (0)