diff --git a/cmd/ztest/ztest.c b/cmd/ztest/ztest.c index fe8d2f6668..53198d0b10 100644 --- a/cmd/ztest/ztest.c +++ b/cmd/ztest/ztest.c @@ -1218,6 +1218,8 @@ online_vdev(vdev_t *vd, void *arg) vdev_t * vdev_walk_tree(vdev_t *vd, vdev_t *(*func)(vdev_t *, void *), void *arg) { + uint_t c; + if (vd->vdev_ops->vdev_op_leaf) { if (func == NULL) return (vd); @@ -1225,7 +1227,7 @@ vdev_walk_tree(vdev_t *vd, vdev_t *(*func)(vdev_t *, void *), void *arg) return (func(vd, arg)); } - for (uint_t c = 0; c < vd->vdev_children; c++) { + for (c = 0; c < vd->vdev_children; c++) { vdev_t *cvd = vd->vdev_child[c]; if ((cvd = vdev_walk_tree(cvd, func, arg)) != NULL) return (cvd); diff --git a/module/zfs/vdev_label.c b/module/zfs/vdev_label.c index fea44226ee..e33d2660e0 100644 --- a/module/zfs/vdev_label.c +++ b/module/zfs/vdev_label.c @@ -510,6 +510,7 @@ vdev_label_init(vdev_t *vd, uint64_t crtxg, vdev_labeltype_t reason) uint64_t spare_guid = 0, l2cache_guid; int flags = ZIO_FLAG_CONFIG_WRITER | ZIO_FLAG_CANFAIL; int c, l, n; + vdev_t *pvd; ASSERT(spa_config_held(spa, SCL_ALL, RW_WRITER) == SCL_ALL);