Skip to content

Commit bca150f

Browse files
damien-lemoalaxboe
authored andcommitted
block: Do not check zone type in blk_check_zone_append()
Zone append operations are only allowed to target sequential write required zones. blk_check_zone_append() uses bio_zone_is_seq() to check this. However, this check is not necessary because: 1) For NVMe ZNS namespace devices, only sequential write required zones exist, making the zone type check useless. 2) For null_blk, the driver will fail the request anyway, thus notifying the user that a conventional zone was targeted. 3) For all other zoned devices, zone append is now emulated using zone write plugging, which checks that a zone append operation does not target a conventional zone. In preparation for the removal of zone write locking and its conventional zone bitmap (used by bio_zone_is_seq()), remove the bio_zone_is_seq() call from blk_check_zone_append(). Signed-off-by: Damien Le Moal <dlemoal@kernel.org> Reviewed-by: Hannes Reinecke <hare@suse.de> Reviewed-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Bart Van Assche <bvanassche@acm.org> Tested-by: Hans Holmberg <hans.holmberg@wdc.com> Tested-by: Dennis Maisenbacher <dennis.maisenbacher@wdc.com> Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com> Link: https://lore.kernel.org/r/20240408014128.205141-24-dlemoal@kernel.org Signed-off-by: Jens Axboe <axboe@kernel.dk>
1 parent e4eb37c commit bca150f

1 file changed

Lines changed: 1 addition & 2 deletions

File tree

block/blk-core.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -589,8 +589,7 @@ static inline blk_status_t blk_check_zone_append(struct request_queue *q,
589589
return BLK_STS_NOTSUPP;
590590

591591
/* The bio sector must point to the start of a sequential zone */
592-
if (!bdev_is_zone_start(bio->bi_bdev, bio->bi_iter.bi_sector) ||
593-
!bio_zone_is_seq(bio))
592+
if (!bdev_is_zone_start(bio->bi_bdev, bio->bi_iter.bi_sector))
594593
return BLK_STS_IOERR;
595594

596595
/*

0 commit comments

Comments
 (0)