Handle ECKSUM as new EZFS_CKSUM ‒ "insufficient replicas"
Add a meaningful error message for ECKSUM to common error messages. Reviewed-by: Richard Yao <richard.yao@alumni.stonybrook.edu> Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz> Closes #6805 Closes #13808 Closes #13898
This commit is contained in:
parent
1d5e569a69
commit
39a39b8ab9
|
@ -150,6 +150,7 @@ typedef enum zfs_error {
|
||||||
EZFS_NO_RESILVER_DEFER, /* pool doesn't support resilver_defer */
|
EZFS_NO_RESILVER_DEFER, /* pool doesn't support resilver_defer */
|
||||||
EZFS_EXPORT_IN_PROGRESS, /* currently exporting the pool */
|
EZFS_EXPORT_IN_PROGRESS, /* currently exporting the pool */
|
||||||
EZFS_REBUILDING, /* resilvering (sequential reconstrution) */
|
EZFS_REBUILDING, /* resilvering (sequential reconstrution) */
|
||||||
|
EZFS_CKSUM, /* insufficient replicas */
|
||||||
EZFS_UNKNOWN
|
EZFS_UNKNOWN
|
||||||
} zfs_error_t;
|
} zfs_error_t;
|
||||||
|
|
||||||
|
|
|
@ -170,6 +170,8 @@ libzfs_error_description(libzfs_handle_t *hdl)
|
||||||
return (dgettext(TEXT_DOMAIN, "I/O error"));
|
return (dgettext(TEXT_DOMAIN, "I/O error"));
|
||||||
case EZFS_INTR:
|
case EZFS_INTR:
|
||||||
return (dgettext(TEXT_DOMAIN, "signal received"));
|
return (dgettext(TEXT_DOMAIN, "signal received"));
|
||||||
|
case EZFS_CKSUM:
|
||||||
|
return (dgettext(TEXT_DOMAIN, "insufficient replicas"));
|
||||||
case EZFS_ISSPARE:
|
case EZFS_ISSPARE:
|
||||||
return (dgettext(TEXT_DOMAIN, "device is reserved as a hot "
|
return (dgettext(TEXT_DOMAIN, "device is reserved as a hot "
|
||||||
"spare"));
|
"spare"));
|
||||||
|
@ -392,6 +394,10 @@ zfs_common_error(libzfs_handle_t *hdl, int error, const char *fmt,
|
||||||
case EINTR:
|
case EINTR:
|
||||||
zfs_verror(hdl, EZFS_INTR, fmt, ap);
|
zfs_verror(hdl, EZFS_INTR, fmt, ap);
|
||||||
return (-1);
|
return (-1);
|
||||||
|
|
||||||
|
case ECKSUM:
|
||||||
|
zfs_verror(hdl, EZFS_CKSUM, fmt, ap);
|
||||||
|
return (-1);
|
||||||
}
|
}
|
||||||
|
|
||||||
return (0);
|
return (0);
|
||||||
|
|
Loading…
Reference in New Issue