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_maintai...@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.
_______________________________________________
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

Reply via email to