svn commit: r241532 - stable/9/sys/boot/zfs
Andriy Gapon
avg at FreeBSD.org
Sun Oct 14 07:52:26 UTC 2012
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);
More information about the svn-src-stable-9
mailing list