Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 25 Jul 2017 13:17:06 +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: r321471 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs
Message-ID:  <201707251317.v6PDH63E092908@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: avg
Date: Tue Jul 25 13:17:06 2017
New Revision: 321471
URL: https://svnweb.freebsd.org/changeset/base/321471

Log:
  spa_import_rootpool should be able to handle an imported root pool
  
  That is required to support reboot -r with a new root filesystem being
  on an already imported pool.
  
  PR:		210721
  Reported by:	Jan Bramkamp <crest_maintainer@rlwinm.de>
  MFC after:	2 weeks

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

Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c
==============================================================================
--- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c	Tue Jul 25 13:14:02 2017	(r321470)
+++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c	Tue Jul 25 13:17:06 2017	(r321471)
@@ -4270,6 +4270,16 @@ spa_import_rootpool(const char *name)
 
 		if ((spa = spa_lookup(pname)) != NULL) {
 			/*
+			 * The pool could already be imported,
+			 * e.g., after reboot -r.
+			 */
+			if (spa->spa_state == POOL_STATE_ACTIVE) {
+				mutex_exit(&spa_namespace_lock);
+				nvlist_free(config);
+				return (0);
+			}
+
+			/*
 			 * Remove the existing root pool from the namespace so
 			 * that we can replace it with the correct config
 			 * we just read in.



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