Skip to content

Commit

Permalink
ZTS: Avoid embedded blocks in bclone/bclone_prop_sync
Browse files Browse the repository at this point in the history
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 <behlendorf1@llnl.gov>
Reviewed-by: Pawel Jakub Dawidek <pjd@FreeBSD.org>
Reviewed-by: Brian Atkinson <batkinson@lanl.gov>
Signed-off-by: Alexander Motin <mav@FreeBSD.org>
Sponsored by: iXsystems, Inc.
Closes openzfs#16740
  • Loading branch information
amotin authored and ixhamza committed Dec 2, 2024
1 parent 1e57941 commit e4001b4
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions tests/zfs-tests/tests/functional/bclone/bclone_prop_sync.ksh
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,11 @@ log_must zfs set compress=zle $TESTDSTFS

for prop in "${sync_prop_vals[@]}"; do
log_must zfs set sync=$prop $TESTSRCFS
# 15*8=120, which is greater than 113, so we are sure the data won't
# be embedded into BP.
# 32767*8=262136, which is larger than a single default recordsize of
# 131072.
FILESIZE=$(random_int_between 1 32767)
FILESIZE=$(random_int_between 15 32767)
FILESIZE=$((FILESIZE * 8))
bclone_test random $FILESIZE false $TESTSRCDIR $TESTSRCDIR
done
Expand All @@ -52,9 +54,11 @@ for srcprop in "${sync_prop_vals[@]}"; do
log_must zfs set sync=$srcprop $TESTSRCFS
for dstprop in "${sync_prop_vals[@]}"; do
log_must zfs set sync=$dstprop $TESTDSTFS
# 15*8=120, which is greater than 113, so we are sure the data won't
# be embedded into BP.
# 32767*8=262136, which is larger than a single default recordsize of
# 131072.
FILESIZE=$(random_int_between 1 32767)
FILESIZE=$(random_int_between 15 32767)
FILESIZE=$((FILESIZE * 8))
bclone_test random $FILESIZE false $TESTSRCDIR $TESTDSTDIR
done
Expand Down

0 comments on commit e4001b4

Please sign in to comment.