aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorнаб <[email protected]>2022-09-16 22:59:25 +0200
committerGitHub <[email protected]>2022-09-16 13:59:25 -0700
commit6c8e9f09c22446cb8a1415ed1db05231cd659f69 (patch)
tree50e68d40f2ec456e7a924cda5875d420ef58ad81
parent577d41d3b2e4b37f51270c399c85b2708e21238a (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
-rw-r--r--include/libzfs.h1
-rw-r--r--lib/libzfs/libzfs_util.c6
2 files changed, 7 insertions, 0 deletions
diff --git a/include/libzfs.h b/include/libzfs.h
index 92c7bf6d1..4fc776122 100644
--- a/include/libzfs.h
+++ b/include/libzfs.h
@@ -151,6 +151,7 @@ typedef enum zfs_error {
EZFS_REBUILDING, /* resilvering (sequential reconstrution) */
EZFS_VDEV_NOTSUP, /* ops not supported for this type of vdev */
EZFS_NOT_USER_NAMESPACE, /* a file is not a user namespace */
+ EZFS_CKSUM, /* insufficient replicas */
EZFS_UNKNOWN
} zfs_error_t;
diff --git a/lib/libzfs/libzfs_util.c b/lib/libzfs/libzfs_util.c
index cca86d2d7..3067e8d46 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"));
@@ -396,6 +398,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);