tests: user_property: Clarify comments

Reviewed-by: Tony Hutter <hutter2@llnl.gov>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Alexander Motin <mav@FreeBSD.org>
Reviewed-by: Tino Reichardt <milky-zfs@mcmilk.de>
Reviewed-by: Allan Jude <allan@klarasystems.com>
Signed-off-by: Mateusz Piotrowski <0mp@FreeBSD.org>
Sponsored-by: Klara, Inc.
Sponsored-by: Wasabi Technology, Inc.
Closes #16248
This commit is contained in:
Mateusz Piotrowski 2024-05-31 16:02:06 +02:00 committed by Brian Behlendorf
parent 5536c0dee2
commit b38fccc646

View File

@ -51,13 +51,23 @@ log_onexit cleanup_user_prop $TESTPOOL
typeset -a names=() typeset -a names=()
typeset -a values=() typeset -a values=()
# Too long property name (256 bytes, which is the 256-byte limit minus 1 byte # A property name that is too long consists of 256 or more bytes (which is (1)
# for the null byte plus 1 byte to reach back over the limit) # the 256-byte limit (2) minus 1 byte for the null byte (3) plus 1 byte to
names+=("$(awk 'BEGIN { printf "x:"; while (c++ < (256 - 2 - 1 + 1)) printf "a" }')") # reach back over the limit).
names+=("$(awk '
BEGIN {
# Print a 2-byte prefix of the name.
printf "x:";
# Print the remaining 254 bytes.
while (c++ < (256 - 2 - 1 + 1))
printf "a"
}'
)")
values+=("too-long-property-name") values+=("too-long-property-name")
# Too long property value (the limits are 1024 on FreeBSD and 4096 on Linux, so # A property value that is too long consists of at least 1024 bytes on FreeBSD
# pick the right one; the too long value is, e.g., the limit minus 1 bytes for the # and 4096 bytes on Linux.
# null byte plus 1 byte to reach back over the limit) # The smallest too-long value is (1) the limit (2) minus 1 byte for the null
# byte (2) plus 1 byte to reach back over the limit).
if is_linux; then if is_linux; then
typeset ZFS_MAXPROPLEN=4096 typeset ZFS_MAXPROPLEN=4096
else else