zfs_create_008_neg and zpool_create_023_neg need to be updated for large block support
The two aforementioned tests have a list of invalid argument combinations to zfs create and zpool create, respectively. One of these used to be "-o recordsize=256K" (twice the maximum allowed block size). However, we now support blocks up and including 1024K.
Unfortunately, even after updating to "-o recordsize=2048K" (and "-o recordsize=2M"), the test suite failed because ioctl calls raised unhandled errors (specifically ERANGE).
Upon further investigation, zfs_create didn't pass a zfs handle to zfs_valid_proplist, which prevented the latter from validating the provided blocksize more strictly than SPA_MINBLOCKSIZE<=specified blocksize<=SPA_MAXBLOCKSIZE (using zpool_get_prop_int). Since various other parts of the function depend on the absence or presence of said zfs handle, the signature of zfs_valid_proplist was modified to accept a zpool handle separately from the zfs handle.
Furthermore, zpool_create can't use zpool_get_prop_int to validate the blocksize param, because the zpool is not created yet, so it has no properties, e.g. max blocksize, to use for validation. The best way to detect if an invalid blocksize was specified is, for better or for worse, to handle an ERANGE error from the ioctl call which creates the pool (ZFS_IOC_POOL_CREATE).
Updated by Electric Monk over 4 years ago
- % Done changed from 0 to 100
- Status changed from New to Closed
commit e9316f7696401f3e5e263a5939031cb8d5641a88 Author: Joe Stein <email@example.com> Date: 2015-10-13T04:44:25.000Z 6298 zfs_create_008_neg and zpool_create_023_neg need to be updated for large block support Reviewed by: Matthew Ahrens <firstname.lastname@example.org> Reviewed by: John Kennedy <email@example.com> Approved by: Robert Mustacchi <firstname.lastname@example.org>