diff --git a/include/libzfs.h b/include/libzfs.h index d3663435c2..bf5579f38f 100644 --- a/include/libzfs.h +++ b/include/libzfs.h @@ -51,8 +51,8 @@ extern "C" { /* * Miscellaneous ZFS constants */ -#define ZFS_MAXPROPLEN MAXPATHLEN -#define ZPOOL_MAXPROPLEN MAXPATHLEN +#define ZFS_MAXPROPLEN ZAP_MAXVALUELEN +#define ZPOOL_MAXPROPLEN ZAP_MAXVALUELEN /* * libzfs errors diff --git a/tests/zfs-tests/tests/functional/cli_root/zfs_clone/zfs_clone_010_pos.ksh b/tests/zfs-tests/tests/functional/cli_root/zfs_clone/zfs_clone_010_pos.ksh index 643bf1cf28..226a665f66 100755 --- a/tests/zfs-tests/tests/functional/cli_root/zfs_clone/zfs_clone_010_pos.ksh +++ b/tests/zfs-tests/tests/functional/cli_root/zfs_clone/zfs_clone_010_pos.ksh @@ -210,19 +210,15 @@ log_must local_cleanup log_note "verify clone list truncated correctly" fs=$TESTPOOL/$TESTFS1 xs=""; for i in {1..200}; do xs+="x"; done -if is_linux; then - ZFS_MAXPROPLEN=4096 -else - ZFS_MAXPROPLEN=1024 -fi +maxproplen=8192 log_must zfs create $fs log_must zfs snapshot $fs@snap -for (( i = 1; i <= (ZFS_MAXPROPLEN / 200 + 1); i++ )); do +for (( i = 1; i <= (maxproplen / 200 + 1); i++ )); do log_must zfs clone ${fs}@snap ${fs}/${TESTCLONE}${xs}.${i} done clone_list=$(zfs list -o clones $fs@snap) char_count=$(echo "$clone_list" | tail -1 | wc -c) -[[ $char_count -eq $ZFS_MAXPROPLEN ]] || \ +[[ $char_count -eq $maxproplen ]] || \ log_fail "Clone list not truncated correctly. Unexpected character count" \ "$char_count" diff --git a/tests/zfs-tests/tests/functional/cli_root/zpool_set/user_property_001_pos.ksh b/tests/zfs-tests/tests/functional/cli_root/zpool_set/user_property_001_pos.ksh index ce8c78fa57..55518ae9de 100755 --- a/tests/zfs-tests/tests/functional/cli_root/zpool_set/user_property_001_pos.ksh +++ b/tests/zfs-tests/tests/functional/cli_root/zpool_set/user_property_001_pos.ksh @@ -56,16 +56,10 @@ typeset -a values=() # for the null byte) names+=("$(awk 'BEGIN { printf "x:"; while (c++ < (256 - 2 - 1)) printf "a" }')") values+=("long-property-name") -# Longest property value (the limits are 1024 on FreeBSD and 4096 on Linux, so -# pick the right one; the longest value can use limit minus 1 bytes for the -# null byte) -if is_linux; then - typeset ZFS_MAXPROPLEN=4096 -else - typeset ZFS_MAXPROPLEN=1024 -fi +# Longest property value (8191 bytes, which is the 8192-byte limit minus 1 byte +# for the null byte). names+=("long:property:value") -values+=("$(awk -v max="$ZFS_MAXPROPLEN" 'BEGIN { while (c++ < (max - 1)) printf "A" }')") +values+=("$(awk 'BEGIN { while (c++ < (8192 - 1)) printf "A" }')") # Valid property names for i in {1..10}; do typeset -i len diff --git a/tests/zfs-tests/tests/functional/cli_root/zpool_set/user_property_002_neg.ksh b/tests/zfs-tests/tests/functional/cli_root/zpool_set/user_property_002_neg.ksh index e9c7e01708..5783eb3a0d 100755 --- a/tests/zfs-tests/tests/functional/cli_root/zpool_set/user_property_002_neg.ksh +++ b/tests/zfs-tests/tests/functional/cli_root/zpool_set/user_property_002_neg.ksh @@ -64,17 +64,11 @@ names+=("$(awk ' }' )") values+=("too-long-property-name") -# A property value that is too long consists of at least 1024 bytes on FreeBSD -# and 4096 bytes on Linux. +# A property value that is too long consists of at least 8192 bytes. # 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 - typeset ZFS_MAXPROPLEN=1024 -fi names+=("too:long:property:value") -values+=("$(awk -v max="$ZFS_MAXPROPLEN" 'BEGIN { while (c++ < (max - 1 + 1)) printf "A" }')") +values+=("$(awk 'BEGIN { while (c++ < (8192 - 1 + 1)) printf "A" }')") # Invalid property names for i in {1..10}; do typeset -i len