Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 9 Jan 2016 19:13:26 +0000 (UTC)
From:      Allan Jude <allanjude@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r293612 - head/sys/boot/i386/loader
Message-ID:  <201601091913.u09JDQsJ093289@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: allanjude
Date: Sat Jan  9 19:13:25 2016
New Revision: 293612
URL: https://svnweb.freebsd.org/changeset/base/293612

Log:
  Return call to init_zfs_bootenv to its previous location
  
  When called to early, new_currdev->d_type was not yet set
  zfs_fmtdev() would then return null
  
  While here, guard call to init_zfs_bootenv with if d_type == DEVT_ZFS
  
  Reported by:	tsoome at me.com
  MFC after:	3 days
  Sponsored by:	ScaleEngine Inc.

Modified:
  head/sys/boot/i386/loader/main.c

Modified: head/sys/boot/i386/loader/main.c
==============================================================================
--- head/sys/boot/i386/loader/main.c	Sat Jan  9 18:42:12 2016	(r293611)
+++ head/sys/boot/i386/loader/main.c	Sat Jan  9 19:13:25 2016	(r293612)
@@ -262,7 +262,6 @@ extract_currdev(void)
 	    new_currdev.d_kind.zfs.root_guid = 0;
 	}
 	new_currdev.d_dev = &zfs_dev;
-	init_zfs_bootenv(zfs_fmtdev(&new_currdev));
 #endif
     } else if ((initial_bootdev & B_MAGICMASK) != B_DEVMAGIC) {
 	/* The passed-in boot device is bad */
@@ -296,6 +295,11 @@ extract_currdev(void)
 	new_currdev.d_unit = 0;
     }
 
+#ifdef LOADER_ZFS_SUPPORT
+    if (new_currdev.d_type == DEVT_ZFS)
+	init_zfs_bootenv(zfs_fmtdev(&new_currdev));
+#endif
+
     env_setenv("currdev", EV_VOLATILE, i386_fmtdev(&new_currdev),
 	       i386_setcurrdev, env_nounset);
     env_setenv("loaddev", EV_VOLATILE, i386_fmtdev(&new_currdev), env_noset,



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