bdev/zone_block: check for unmap support in zone reset
Sending the unmap in zone reset is optional (it's only a hint), so if the base bdev doesn't support it, the reset is completed immediately. Fixes #2064. Signed-off-by: Konrad Sztyber <konrad.sztyber@intel.com> Change-Id: If2c57eadc20d352a71853d7023599503330e1252 Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9154 Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com> Community-CI: Mellanox Build Bot Tested-by: SPDK CI Jenkins <sys_sgci@intel.com> Reviewed-by: Jim Harris <james.r.harris@intel.com> Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
This commit is contained in:
parent
7abf75c2b5
commit
aa51757648
@ -292,6 +292,14 @@ zone_block_reset_zone(struct bdev_zone_block *bdev_node, struct zone_block_io_ch
|
||||
zone->zone_info.state = SPDK_BDEV_ZONE_STATE_EMPTY;
|
||||
zone->zone_info.write_pointer = zone->zone_info.zone_id;
|
||||
pthread_spin_unlock(&zone->lock);
|
||||
|
||||
/* The unmap isn't necessary, so if the base bdev doesn't support it, we're done */
|
||||
if (!spdk_bdev_io_type_supported(spdk_bdev_desc_get_bdev(bdev_node->base_desc),
|
||||
SPDK_BDEV_IO_TYPE_UNMAP)) {
|
||||
spdk_bdev_io_complete(bdev_io, SPDK_BDEV_IO_STATUS_SUCCESS);
|
||||
return 0;
|
||||
}
|
||||
|
||||
return spdk_bdev_unmap_blocks(bdev_node->base_desc, ch->base_ch,
|
||||
zone->zone_info.zone_id, zone->zone_info.capacity,
|
||||
_zone_block_complete_unmap, bdev_io);
|
||||
|
Loading…
Reference in New Issue
Block a user