aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorAmeer Hamza <[email protected]>2024-08-16 00:39:44 +0500
committerGitHub <[email protected]>2024-08-15 12:39:44 -0700
commit963e6c9f3ffc0bc767ca8b89549be595f29f9470 (patch)
tree1ee642831f4c22746c67f71635022e724ef240a4 /lib
parent83f359245adc9c03ee0ededa2ff00b7dd9f82d2a (diff)
Fix incorrect error report on vdev attach/replace
Report the correct error message in libzfs when attaching/replacing a vdev with a higher ashift. Reviewed-by: Brian Behlendorf <[email protected]> Reviewed-by: Alexander Motin <[email protected]> Signed-off-by: Ameer Hamza <[email protected]> Closes #16449
Diffstat (limited to 'lib')
-rw-r--r--lib/libzfs/libzfs_pool.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/libzfs/libzfs_pool.c b/lib/libzfs/libzfs_pool.c
index 8a043aa0f..e493e8562 100644
--- a/lib/libzfs/libzfs_pool.c
+++ b/lib/libzfs/libzfs_pool.c
@@ -3733,6 +3733,13 @@ zpool_vdev_attach(zpool_handle_t *zhp, const char *old_disk,
(void) zpool_standard_error(hdl, errno, errbuf);
}
break;
+
+ case ZFS_ERR_ASHIFT_MISMATCH:
+ zfs_error_aux(hdl, dgettext(TEXT_DOMAIN,
+ "The new device cannot have a higher alignment requirement "
+ "than the top-level vdev."));
+ (void) zfs_error(hdl, EZFS_BADTARGET, errbuf);
+ break;
default:
(void) zpool_standard_error(hdl, errno, errbuf);
}