svn commit: r277628 - stable/10/cddl/contrib/opensolaris/cmd/zpool
Steven Hartland
smh at FreeBSD.org
Sat Jan 24 00:40:43 UTC 2015
Author: smh
Date: Sat Jan 24 00:40:42 2015
New Revision: 277628
URL: https://svnweb.freebsd.org/changeset/base/277628
Log:
MFC r276194:
Prevent zpool upgrade failing due to unavailable pools
Sponsored by: Multiplay
Modified:
stable/10/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c
Directory Properties:
stable/10/ (props changed)
Modified: stable/10/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c
==============================================================================
--- stable/10/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c Sat Jan 24 00:37:41 2015 (r277627)
+++ stable/10/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c Sat Jan 24 00:40:42 2015 (r277628)
@@ -4629,6 +4629,13 @@ upgrade_cb(zpool_handle_t *zhp, void *ar
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
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);
More information about the svn-src-stable
mailing list