diff options
author | Toomas Soome <tsoome@me.com> | 2019-11-03 15:06:48 +0200 |
---|---|---|
committer | Toomas Soome <tsoome@me.com> | 2019-11-14 18:18:35 +0200 |
commit | 67806cd738bddbbd117d50180c8f96050a49a8cc (patch) | |
tree | 93c9fb1550b6717bc2b8b9ff3196e7c6f6e1aed3 /usr/src | |
parent | 4b6bffb4c4308c6219c095d4cf5bf96bb0970e04 (diff) | |
download | illumos-joyent-67806cd738bddbbd117d50180c8f96050a49a8cc.tar.gz |
11933 loader: we can not read log device but we need to know about
Reviewed by: Andy Fiddaman <omnios@citrus-it.co.uk>
Approved by: Dan McDonald <danmcd@joyent.com>
Diffstat (limited to 'usr/src')
-rw-r--r-- | usr/src/boot/lib/libstand/zfs/zfsimpl.c | 20 | ||||
-rw-r--r-- | usr/src/boot/sys/cddl/boot/zfs/zfsimpl.h | 2 |
2 files changed, 16 insertions, 6 deletions
diff --git a/usr/src/boot/lib/libstand/zfs/zfsimpl.c b/usr/src/boot/lib/libstand/zfs/zfsimpl.c index fba9f1fc59..7d0d79b922 100644 --- a/usr/src/boot/lib/libstand/zfs/zfsimpl.c +++ b/usr/src/boot/lib/libstand/zfs/zfsimpl.c @@ -1106,6 +1106,7 @@ vdev_init_from_nvlist(const unsigned char *nvlist, vdev_t *pvdev, const unsigned char *kids; int nkids, i, is_new; uint64_t is_offline, is_faulted, is_degraded, is_removed, isnt_present; + uint64_t is_log; if (nvlist_find(nvlist, ZPOOL_CONFIG_GUID, DATA_TYPE_UINT64, NULL, &guid) || @@ -1129,6 +1130,7 @@ vdev_init_from_nvlist(const unsigned char *nvlist, vdev_t *pvdev, } is_offline = is_removed = is_faulted = is_degraded = isnt_present = 0; + is_log = 0; nvlist_find(nvlist, ZPOOL_CONFIG_OFFLINE, DATA_TYPE_UINT64, NULL, &is_offline); @@ -1140,6 +1142,8 @@ vdev_init_from_nvlist(const unsigned char *nvlist, vdev_t *pvdev, &is_degraded); nvlist_find(nvlist, ZPOOL_CONFIG_NOT_PRESENT, DATA_TYPE_UINT64, NULL, &isnt_present); + nvlist_find(nvlist, ZPOOL_CONFIG_IS_LOG, DATA_TYPE_UINT64, NULL, + &is_log); vdev = vdev_find(guid); if (!vdev) { @@ -1226,6 +1230,7 @@ vdev_init_from_nvlist(const unsigned char *nvlist, vdev_t *pvdev, return (ENOMEM); vdev->v_name = name; } + vdev->v_islog = is_log == 1; } else { is_new = 0; } @@ -1429,6 +1434,12 @@ vdev_status(vdev_t *vdev, int indent) { vdev_t *kid; int ret; + + if (vdev->v_islog) { + (void)pager_output(" logs\n"); + indent++; + } + ret = print_state(indent, vdev->v_name, vdev->v_state); if (ret != 0) return (ret); @@ -1759,12 +1770,6 @@ vdev_probe(vdev_phys_read_t *phys_read, void *read_priv, spa_t **spap) return (EIO); } - if (nvlist_find(nvlist, ZPOOL_CONFIG_IS_LOG, DATA_TYPE_UINT64, - NULL, &val) == 0 && val != 0) { - free(nvlist); - return (EIO); - } - /* * Create the pool if this is the first time we've seen it. */ @@ -1839,6 +1844,9 @@ vdev_probe(vdev_phys_read_t *phys_read, void *read_priv, spa_t **spap) return (EIO); } + if (vdev->v_islog) + spa->spa_with_log = vdev->v_islog; + /* Record boot vdev for spa. */ if (is_newer == 1) spa->spa_boot_vdev = vdev; diff --git a/usr/src/boot/sys/cddl/boot/zfs/zfsimpl.h b/usr/src/boot/sys/cddl/boot/zfs/zfsimpl.h index 8f45983761..6b629f8fe5 100644 --- a/usr/src/boot/sys/cddl/boot/zfs/zfsimpl.h +++ b/usr/src/boot/sys/cddl/boot/zfs/zfsimpl.h @@ -1770,6 +1770,7 @@ typedef struct vdev { vdev_phys_read_t *v_phys_read; /* read from raw leaf vdev */ vdev_read_t *v_read; /* read from vdev */ void *v_read_priv; /* private data for read function */ + boolean_t v_islog; struct spa *spa; /* link to spa */ /* * Values stored in the config for an indirect or removing vdev. @@ -1795,6 +1796,7 @@ typedef struct spa { void *spa_cksum_tmpls[ZIO_CHECKSUM_FUNCTIONS]; int spa_inited; /* initialized */ vdev_t *spa_boot_vdev; /* boot device for kernel */ + boolean_t spa_with_log; /* this pool has log */ } spa_t; /* IO related arguments. */ |