svn commit: r323747 - stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs

Andriy Gapon avg at FreeBSD.org
Tue Sep 19 08:43:47 UTC 2017


Author: avg
Date: Tue Sep 19 08:43:45 2017
New Revision: 323747
URL: https://svnweb.freebsd.org/changeset/base/323747

Log:
  MFC r321471: 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

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

Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c
==============================================================================
--- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c	Tue Sep 19 08:43:16 2017	(r323746)
+++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c	Tue Sep 19 08:43:45 2017	(r323747)
@@ -4179,6 +4179,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-all mailing list