Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 14 Oct 2012 07:52:26 +0000 (UTC)
From:      Andriy Gapon <avg@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org
Subject:   svn commit: r241532 - stable/9/sys/boot/zfs
Message-ID:  <201210140752.q9E7qQfA017717@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: avg
Date: Sun Oct 14 07:52:25 2012
New Revision: 241532
URL: http://svn.freebsd.org/changeset/base/241532

Log:
  MFC r241282: zfs boot: chose a "first" pool if none is explicitly requested

Modified:
  stable/9/sys/boot/zfs/zfs.c
Directory Properties:
  stable/9/sys/   (props changed)
  stable/9/sys/boot/   (props changed)

Modified: stable/9/sys/boot/zfs/zfs.c
==============================================================================
--- stable/9/sys/boot/zfs/zfs.c	Sun Oct 14 07:45:46 2012	(r241531)
+++ stable/9/sys/boot/zfs/zfs.c	Sun Oct 14 07:52:25 2012	(r241532)
@@ -429,7 +429,10 @@ zfs_dev_open(struct open_file *f, ...)
 	dev = va_arg(args, struct zfs_devdesc *);
 	va_end(args);
 
-	spa = spa_find_by_guid(dev->pool_guid);
+	if (dev->pool_guid == 0)
+		spa = STAILQ_FIRST(&zfs_pools);
+	else
+		spa = spa_find_by_guid(dev->pool_guid);
 	if (!spa)
 		return (ENXIO);
 	rv = zfs_spa_init(spa);
@@ -543,7 +546,10 @@ zfs_fmtdev(void *vdev)
 	if (dev->d_type != DEVT_ZFS)
 		return (buf);
 
-	spa = spa_find_by_guid(dev->pool_guid);
+	if (dev->pool_guid == 0)
+		spa = STAILQ_FIRST(&zfs_pools);
+	else
+		spa = spa_find_by_guid(dev->pool_guid);
 	if (spa == NULL) {
 		printf("ZFS: can't find pool by guid\n");
 		return (buf);



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