mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2026-05-22 10:37:35 +03:00
libzfs: handle EDOM error in zpool_create
When creating a pool with devices that have incompatible block sizes, the kernel returns EDOM. However, zpool_create() did not handle this errno, falling through to zpool_standard_error() which produced a confusing message about invalid property values. Add a case EDOM handler in zpool_create() to return EZFS_BADDEV with a descriptive auxiliary message, consistent with the existing EDOM handler in zpool_vdev_add(). Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Signed-off-by: Christos Longros <chris.longros@gmail.com> Closes #18268
This commit is contained in:
@@ -1696,6 +1696,11 @@ zpool_create(libzfs_handle_t *hdl, const char *pool, nvlist_t *nvroot,
|
||||
"one or more devices could not be opened"));
|
||||
return (zfs_error(hdl, EZFS_BADDEV, errbuf));
|
||||
|
||||
case EDOM:
|
||||
zfs_error_aux(hdl, dgettext(TEXT_DOMAIN,
|
||||
"block size out of range or does not match"));
|
||||
return (zfs_error(hdl, EZFS_BADDEV, errbuf));
|
||||
|
||||
default:
|
||||
return (zpool_standard_error(hdl, errno, errbuf));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user