summaryrefslogtreecommitdiffstats
path: root/module/zfs/vdev_label.c
diff options
context:
space:
mode:
authorBrian Behlendorf <[email protected]>2009-01-15 13:59:39 -0800
committerBrian Behlendorf <[email protected]>2009-01-15 13:59:39 -0800
commitfb5f0bc83330c8a0236c4d34a23723ac1974971a (patch)
tree51880dcfa8ec9e8e80b8c44e9ffc55a4b7160216 /module/zfs/vdev_label.c
parent42bcb36c8987b0b11411ce6cf8339694b624a17c (diff)
Rebase master to b105
Diffstat (limited to 'module/zfs/vdev_label.c')
-rw-r--r--module/zfs/vdev_label.c15
1 files changed, 9 insertions, 6 deletions
diff --git a/module/zfs/vdev_label.c b/module/zfs/vdev_label.c
index bf930466f..f8f90196b 100644
--- a/module/zfs/vdev_label.c
+++ b/module/zfs/vdev_label.c
@@ -277,9 +277,9 @@ vdev_config_generate(spa_t *spa, vdev_t *vd, boolean_t getstats,
vd->vdev_islog) == 0);
}
- if (vd->vdev_dtl.smo_object != 0)
+ if (vd->vdev_dtl_smo.smo_object != 0)
VERIFY(nvlist_add_uint64(nv, ZPOOL_CONFIG_DTL,
- vd->vdev_dtl.smo_object) == 0);
+ vd->vdev_dtl_smo.smo_object) == 0);
if (getstats) {
vdev_stat_t vs;
@@ -520,9 +520,6 @@ vdev_label_init(vdev_t *vd, uint64_t crtxg, vdev_labeltype_t reason)
vdev_inuse(vd, crtxg, reason, &spare_guid, &l2cache_guid))
return (EBUSY);
- ASSERT(reason != VDEV_LABEL_REMOVE ||
- vdev_inuse(vd, crtxg, reason, NULL, NULL));
-
/*
* If this is a request to add or replace a spare or l2cache device
* that is in use elsewhere on the system, then we must update the
@@ -705,6 +702,11 @@ vdev_label_init(vdev_t *vd, uint64_t crtxg, vdev_labeltype_t reason)
*/
/*
+ * For use by zdb and debugging purposes only
+ */
+uint64_t ub_max_txg = UINT64_MAX;
+
+/*
* Consider the following situation: txg is safely synced to disk. We've
* written the first uberblock for txg + 1, and then we lose power. When we
* come back up, we fail to see the uberblock for txg + 1 because, say,
@@ -741,7 +743,8 @@ vdev_uberblock_load_done(zio_t *zio)
if (zio->io_error == 0 && uberblock_verify(ub) == 0) {
mutex_enter(&rio->io_lock);
- if (vdev_uberblock_compare(ub, ubbest) > 0)
+ if (ub->ub_txg <= ub_max_txg &&
+ vdev_uberblock_compare(ub, ubbest) > 0)
*ubbest = *ub;
mutex_exit(&rio->io_lock);
}