svn commit: r321471 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs

Andriy Gapon avg at FreeBSD.org
Tue Jul 25 13:17:07 UTC 2017


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 at 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.


More information about the svn-src-head mailing list