Skip to content

Commit

Permalink
tests: user_property: Clarify comments
Browse files Browse the repository at this point in the history
Reviewed-by: Tony Hutter <[email protected]>
Reviewed-by: Brian Behlendorf <[email protected]>
Reviewed-by: Alexander Motin <[email protected]>
Reviewed-by: Tino Reichardt <[email protected]>
Reviewed-by: Allan Jude <[email protected]>
Signed-off-by: Mateusz Piotrowski <[email protected]>
Sponsored-by: Klara, Inc.
Sponsored-by: Wasabi Technology, Inc.
Closes #16248
  • Loading branch information
0mp authored and behlendorf committed Aug 8, 2024
1 parent 5536c0d commit b38fccc
Showing 1 changed file with 16 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -51,13 +51,23 @@ log_onexit cleanup_user_prop $TESTPOOL
typeset -a names=()
typeset -a values=()

# Too long property name (256 bytes, which is the 256-byte limit minus 1 byte
# for the null byte plus 1 byte to reach back over the limit)
names+=("$(awk 'BEGIN { printf "x:"; while (c++ < (256 - 2 - 1 + 1)) printf "a" }')")
# A property name that is too long consists of 256 or more bytes (which is (1)
# the 256-byte limit (2) minus 1 byte for the null byte (3) plus 1 byte to
# 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")
# Too long property value (the limits are 1024 on FreeBSD and 4096 on Linux, so
# pick the right one; the too long value is, e.g., the limit minus 1 bytes for the
# null byte plus 1 byte to reach back over the limit)
# A property value that is too long consists of at least 1024 bytes on FreeBSD
# and 4096 bytes on Linux.
# 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
typeset ZFS_MAXPROPLEN=4096
else
Expand Down

0 comments on commit b38fccc

Please sign in to comment.