Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 14 Sep 2013 08:37:49 +0000 (UTC)
From:      Alexander Motin <mav@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org
Subject:   svn commit: r255540 - stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs
Message-ID:  <201309140837.r8E8bnaj075310@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: mav
Date: Sat Sep 14 08:37:49 2013
New Revision: 255540
URL: http://svnweb.freebsd.org/changeset/base/255540

Log:
  MFC r253993:
  Block reporting of ZFS features for suspended pools.
  
  Before executing any subcommand, zpool tool fetches pools configuration from
  the kernel.  Before features support was added, kernel was regenerating that
  configuration based on data always present in memory.  Unfortunately, pool
  features list and activity counters are not such. They are stored in ZAP,
  that normally resides in ARC, but under heavy memory pressure may be swapped
  out.  If pool is suspended at this point, there is no way to recover it back
  since any zpool command will stuck.
  
  This change has one predictable flaw: `zpool upgrade` always wish to upgrade
  suspended pools, but fortunately it can't do it due to the suspension.

Modified:
  stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c
Directory Properties:
  stable/9/sys/   (props changed)
  stable/9/sys/cddl/contrib/opensolaris/   (props changed)

Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c
==============================================================================
--- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c	Sat Sep 14 08:35:20 2013	(r255539)
+++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c	Sat Sep 14 08:37:49 2013	(r255540)
@@ -3060,6 +3060,10 @@ spa_add_feature_stats(spa_t *spa, nvlist
 	ASSERT(spa_config_held(spa, SCL_CONFIG, RW_READER));
 	VERIFY(nvlist_alloc(&features, NV_UNIQUE_NAME, KM_SLEEP) == 0);
 
+	/* We may be unable to read features if pool is suspended. */
+	if (spa_suspended(spa))
+		goto out;
+
 	if (spa->spa_feat_for_read_obj != 0) {
 		for (zap_cursor_init(&zc, spa->spa_meta_objset,
 		    spa->spa_feat_for_read_obj);
@@ -3086,6 +3090,7 @@ spa_add_feature_stats(spa_t *spa, nvlist
 		zap_cursor_fini(&zc);
 	}
 
+out:
 	VERIFY(nvlist_add_nvlist(config, ZPOOL_CONFIG_FEATURE_STATS,
 	    features) == 0);
 	nvlist_free(features);



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201309140837.r8E8bnaj075310>