mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2026-03-11 04:46:18 +03:00
libzfs: improve error message for zpool create with ENXIO
When zpool create fails because a vdev cannot be opened (ENXIO), the error falls through to zpool_standard_error() which reports the generic 'one or more devices is currently unavailable'. This is misleading when the real cause is a block size mismatch or other device open failure. Add an explicit ENXIO case in zpool_create()'s error handling to provide a more descriptive message. Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Signed-off-by: Christos Longros <chris.longros@gmail.com> Closes #18184 Closes #11087
This commit is contained in:
parent
e601a1fb77
commit
040ba7a7ca
@ -1632,6 +1632,11 @@ zpool_create(libzfs_handle_t *hdl, const char *pool, nvlist_t *nvroot,
|
||||
errbuf));
|
||||
}
|
||||
|
||||
case ENXIO:
|
||||
zfs_error_aux(hdl, dgettext(TEXT_DOMAIN,
|
||||
"one or more devices could not be opened"));
|
||||
return (zfs_error(hdl, EZFS_BADDEV, errbuf));
|
||||
|
||||
default:
|
||||
return (zpool_standard_error(hdl, errno, errbuf));
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user