summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorнаб <[email protected]>2022-09-16 22:59:25 +0200
committerTony Hutter <[email protected]>2022-12-01 12:39:40 -0800
commit39a39b8ab9f3653b000294c3f2e357db68de3de2 (patch)
tree51ae08635487d6331e7595e0569f3a5fcf726e68 /lib
parent1d5e569a69e3887e07560d9e6fc6e26446ccc6ca (diff)
Handle ECKSUM as new EZFS_CKSUM ‒ "insufficient replicas"
Add a meaningful error message for ECKSUM to common error messages. Reviewed-by: Richard Yao <[email protected]> Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Ahelenia Ziemiańska <[email protected]> Closes #6805 Closes #13808 Closes #13898
Diffstat (limited to 'lib')
-rw-r--r--lib/libzfs/libzfs_util.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/libzfs/libzfs_util.c b/lib/libzfs/libzfs_util.c
index 7dd38bb3d..728b9ab92 100644
--- a/lib/libzfs/libzfs_util.c
+++ b/lib/libzfs/libzfs_util.c
@@ -170,6 +170,8 @@ libzfs_error_description(libzfs_handle_t *hdl)
return (dgettext(TEXT_DOMAIN, "I/O error"));
case EZFS_INTR:
return (dgettext(TEXT_DOMAIN, "signal received"));
+ case EZFS_CKSUM:
+ return (dgettext(TEXT_DOMAIN, "insufficient replicas"));
case EZFS_ISSPARE:
return (dgettext(TEXT_DOMAIN, "device is reserved as a hot "
"spare"));
@@ -392,6 +394,10 @@ zfs_common_error(libzfs_handle_t *hdl, int error, const char *fmt,
case EINTR:
zfs_verror(hdl, EZFS_INTR, fmt, ap);
return (-1);
+
+ case ECKSUM:
+ zfs_verror(hdl, EZFS_CKSUM, fmt, ap);
+ return (-1);
}
return (0);