diff --git a/lib/ftl/ftl_band.c b/lib/ftl/ftl_band.c index 74a98d3b6..20c8e5b56 100644 --- a/lib/ftl/ftl_band.c +++ b/lib/ftl/ftl_band.c @@ -224,7 +224,6 @@ static void _ftl_band_set_closed(struct ftl_band *band) { struct spdk_ftl_dev *dev = band->dev; - struct ftl_zone *zone; /* Set the state as free_md() checks for that */ band->state = FTL_BAND_STATE_CLOSED; @@ -234,9 +233,6 @@ _ftl_band_set_closed(struct ftl_band *band) if (spdk_likely(band->num_zones)) { LIST_INSERT_HEAD(&dev->shut_bands, band, list_entry); - CIRCLEQ_FOREACH(zone, &band->zones, circleq) { - zone->info.state = SPDK_BDEV_ZONE_STATE_FULL; - } } else { LIST_REMOVE(band, list_entry); } diff --git a/lib/ftl/ftl_core.c b/lib/ftl/ftl_core.c index 59ce113c4..a00d20171 100644 --- a/lib/ftl/ftl_core.c +++ b/lib/ftl/ftl_core.c @@ -1562,6 +1562,10 @@ ftl_io_child_write_cb(struct ftl_io *io, void *ctx, int status) zone->busy = false; zone->info.write_pointer += io->num_blocks; + if (zone->info.write_pointer == zone->info.capacity) { + zone->info.state = SPDK_BDEV_ZONE_STATE_FULL; + } + /* If some other write on the same band failed the write pointer would already be freed */ if (spdk_likely(wptr)) { wptr->num_outstanding--;