diff options
author | smh <smh@FreeBSD.org> | 2015-01-24 00:40:42 +0000 |
---|---|---|
committer | smh <smh@FreeBSD.org> | 2015-01-24 00:40:42 +0000 |
commit | e2d4209626034c4fa23ab8facaea8f0b7c2ed6fc (patch) | |
tree | 31e976554844bfbf0f90ef2bb4f70995c7d64372 /cddl/contrib/opensolaris | |
parent | f72184af7f1b19f99893f951a64a22f22ec344ba (diff) | |
download | FreeBSD-src-e2d4209626034c4fa23ab8facaea8f0b7c2ed6fc.zip FreeBSD-src-e2d4209626034c4fa23ab8facaea8f0b7c2ed6fc.tar.gz |
MFC r276194:
Prevent zpool upgrade failing due to unavailable pools
Sponsored by: Multiplay
Diffstat (limited to 'cddl/contrib/opensolaris')
-rw-r--r-- | cddl/contrib/opensolaris/cmd/zpool/zpool_main.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c b/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c index 31340b0..8251989 100644 --- a/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c +++ b/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c @@ -4629,6 +4629,13 @@ upgrade_cb(zpool_handle_t *zhp, void *arg) boolean_t printnl = B_FALSE; int ret; + if (zpool_get_state(zhp) == POOL_STATE_UNAVAIL) { + (void) fprintf(stderr, gettext("cannot upgrade '%s': pool is " + "currently unavailable\n\n"), zpool_get_name(zhp)); + /* Allow iteration to continue. */ + return (0); + } + config = zpool_get_config(zhp, NULL); verify(nvlist_lookup_uint64(config, ZPOOL_CONFIG_VERSION, &version) == 0); @@ -4729,6 +4736,14 @@ upgrade_list_disabled_cb(zpool_handle_t *zhp, void *arg) nvlist_t *config; uint64_t version; + if (zpool_get_state(zhp) == POOL_STATE_UNAVAIL) { + (void) fprintf(stderr, gettext("cannot check supported " + "features on '%s': pool is currently unavailable\n\n"), + zpool_get_name(zhp)); + /* Allow iteration to continue. */ + return (0); + } + config = zpool_get_config(zhp, NULL); verify(nvlist_lookup_uint64(config, ZPOOL_CONFIG_VERSION, &version) == 0); |