svn commit: r293612 - head/sys/boot/i386/loader

Allan Jude allanjude at FreeBSD.org
Sat Jan 9 19:13:27 UTC 2016


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,


More information about the svn-src-head mailing list