Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 26 Oct 2012 14:50:17 +0000 (UTC)
From:      Andriy Gapon <avg@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r242135 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs
Message-ID:  <201210261450.q9QEoHWB021612@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: avg
Date: Fri Oct 26 14:50:16 2012
New Revision: 242135
URL: http://svn.freebsd.org/changeset/base/242135

Log:
  zfs: fix label validation code in vdev_geom_read_config
  
  POOL_STATE_SPARE and POOL_STATE_L2CACHE were not handled correctly
  and thus the cache and spare disks would not be correctly probed.
  
  Reported by:	Michael Schmiedgen <schmiedgen@gmx.net>,
  		Matthew D. Fuller <fullermd@over-yonder.net>
  Tested by:	Michael Schmiedgen <schmiedgen@gmx.net>,
  		flo
  MFC after:	5 days

Modified:
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c

Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c
==============================================================================
--- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c	Fri Oct 26 14:36:02 2012	(r242134)
+++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c	Fri Oct 26 14:50:16 2012	(r242135)
@@ -270,14 +270,16 @@ vdev_geom_read_config(struct g_consumer 
 			continue;
 
 		if (nvlist_lookup_uint64(*config, ZPOOL_CONFIG_POOL_STATE,
-		    &state) != 0 || state >= POOL_STATE_DESTROYED) {
+		    &state) != 0 || state == POOL_STATE_DESTROYED ||
+		    state > POOL_STATE_L2CACHE) {
 			nvlist_free(*config);
 			*config = NULL;
 			continue;
 		}
 
-		if (nvlist_lookup_uint64(*config, ZPOOL_CONFIG_POOL_TXG,
-		    &txg) != 0 || txg == 0) {
+		if (state != POOL_STATE_SPARE && state != POOL_STATE_L2CACHE &&
+		    (nvlist_lookup_uint64(*config, ZPOOL_CONFIG_POOL_TXG,
+		    &txg) != 0 || txg == 0)) {
 			nvlist_free(*config);
 			*config = NULL;
 			continue;



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