diff options
author | Brian Behlendorf <[email protected]> | 2019-12-03 09:58:03 -0800 |
---|---|---|
committer | GitHub <[email protected]> | 2019-12-03 09:58:03 -0800 |
commit | 624222ae31bc8ce0009c7da9b0877a3c93aa56fb (patch) | |
tree | 6296c1fbf8d4140b278f451a81ca6c23922b20b9 /lib/libzfs | |
parent | b3673342c79b65c441c98a8161ffbf136d497c2f (diff) |
Increase allowed 'special_small_blocks' maximum value
There may be circumstances where it's desirable that all blocks
in a specified dataset be stored on the special device. Relax
the artificial 128K limit and allow the special_small_blocks
property to be set up to 1M. When blocks >1MB have been enabled
via the zfs_max_recordsize module option, this limit is increased
accordingly.
Reviewed-by: Don Brady <[email protected]>
Reviewed-by: Kjeld Schouten <[email protected]>
Signed-off-by: Brian Behlendorf <[email protected]>
Closes #9131
Closes #9355
Diffstat (limited to 'lib/libzfs')
-rw-r--r-- | lib/libzfs/libzfs_dataset.c | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/lib/libzfs/libzfs_dataset.c b/lib/libzfs/libzfs_dataset.c index acc9daec7..b5600ca62 100644 --- a/lib/libzfs/libzfs_dataset.c +++ b/lib/libzfs/libzfs_dataset.c @@ -1229,12 +1229,19 @@ zfs_valid_proplist(libzfs_handle_t *hdl, zfs_type_t type, nvlist_t *nvl, } case ZFS_PROP_SPECIAL_SMALL_BLOCKS: + { + int maxbs = SPA_OLD_MAXBLOCKSIZE; + char buf[64]; + if (zpool_hdl != NULL) { char state[64] = ""; + maxbs = zpool_get_prop_int(zpool_hdl, + ZPOOL_PROP_MAXBLOCKSIZE, NULL); + /* * Issue a warning but do not fail so that - * tests for setable properties succeed. + * tests for settable properties succeed. */ if (zpool_prop_get_feature(zpool_hdl, "feature@allocation_classes", state, @@ -1247,15 +1254,17 @@ zfs_valid_proplist(libzfs_handle_t *hdl, zfs_type_t type, nvlist_t *nvl, } if (intval != 0 && (intval < SPA_MINBLOCKSIZE || - intval > SPA_OLD_MAXBLOCKSIZE || !ISP2(intval))) { + intval > maxbs || !ISP2(intval))) { + zfs_nicebytes(maxbs, buf, sizeof (buf)); zfs_error_aux(hdl, dgettext(TEXT_DOMAIN, "invalid '%s=%d' property: must be zero or " - "a power of 2 from 512B to 128K"), propname, - intval); + "a power of 2 from 512B to %s"), propname, + intval, buf); (void) zfs_error(hdl, EZFS_BADPROP, errbuf); goto error; } break; + } case ZFS_PROP_MLSLABEL: { |