summaryrefslogtreecommitdiffstats
path: root/include/libzfs.h
diff options
context:
space:
mode:
authorColm <[email protected]>2021-04-12 17:08:56 +0100
committerBrian Behlendorf <[email protected]>2021-04-14 13:23:08 -0700
commit1f3de97374b63ad513176fa9b37b393a02e6ca8c (patch)
treee00ca8f2b75018f181d9f3ecbf2709a510ceda9d /include/libzfs.h
parent7de1797cee8b887871f3dede83c76edbe3e961f4 (diff)
Improvements to the 'compatibility' property
Several improvements to the operation of the 'compatibility' property: 1) Improved handling of unrecognized features: Change the way unrecognized features in compatibility files are handled. * invalid features in files under /usr/share/zfs/compatibility.d only get a warning (as these may refer to future features not yet in the library), * invalid features in files under /etc/zfs/compatibility.d get an error (as these are presumed to refer to the current system). 2) Improved error reporting from zpool_load_compat. Note: slight ABI change to zpool_load_compat for better error reporting. 3) compatibility=legacy inhibits all 'zpool upgrade' operations. 4) Detect when features are enabled outside current compatibility set * zpool set compatibility=foo <-- print a warning * zpool set feature@xxx=enabled <-- error * zpool status <-- indicate this state Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Colm Buckley <[email protected]> Closes #11861
Diffstat (limited to 'include/libzfs.h')
-rw-r--r--include/libzfs.h7
1 files changed, 4 insertions, 3 deletions
diff --git a/include/libzfs.h b/include/libzfs.h
index e8e771382..eeb4daae7 100644
--- a/include/libzfs.h
+++ b/include/libzfs.h
@@ -393,6 +393,7 @@ typedef enum {
ZPOOL_STATUS_REBUILD_SCRUB, /* recommend scrubbing the pool */
ZPOOL_STATUS_NON_NATIVE_ASHIFT, /* (e.g. 512e dev with ashift of 9) */
ZPOOL_STATUS_COMPATIBILITY_ERR, /* bad 'compatibility' property */
+ ZPOOL_STATUS_INCOMPATIBLE_FEAT, /* feature set outside compatibility */
/*
* Finally, the following indicates a healthy pool.
@@ -922,14 +923,14 @@ extern int zpool_disable_datasets(zpool_handle_t *, boolean_t);
*/
typedef enum {
ZPOOL_COMPATIBILITY_OK,
- ZPOOL_COMPATIBILITY_READERR,
+ ZPOOL_COMPATIBILITY_WARNTOKEN,
+ ZPOOL_COMPATIBILITY_BADTOKEN,
ZPOOL_COMPATIBILITY_BADFILE,
- ZPOOL_COMPATIBILITY_BADWORD,
ZPOOL_COMPATIBILITY_NOFILES
} zpool_compat_status_t;
extern zpool_compat_status_t zpool_load_compat(const char *,
- boolean_t *, char *, char *);
+ boolean_t *, char *, size_t);
#ifdef __FreeBSD__