summaryrefslogtreecommitdiffstats
path: root/sys/boot
diff options
context:
space:
mode:
Diffstat (limited to 'sys/boot')
-rw-r--r--sys/boot/zfs/zfs.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/sys/boot/zfs/zfs.c b/sys/boot/zfs/zfs.c
index 6c964b0..eb8833f 100644
--- a/sys/boot/zfs/zfs.c
+++ b/sys/boot/zfs/zfs.c
@@ -513,7 +513,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);
@@ -627,7 +630,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);
OpenPOWER on IntegriCloud