]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
block: take chunk_sectors into account in bio_split_write_zeroes
authorChristoph Hellwig <hch@lst.de>
Mon, 4 Nov 2024 06:26:29 +0000 (07:26 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 5 Dec 2024 12:52:47 +0000 (13:52 +0100)
commitbd88dfd6a0d64574770d1f50a0b7c1d375adde47
tree2c4344a2fa694a46a0333f71109f4ba2c6e17a1d
parentbf937fce96a353c68887adce75963233718fffa9
block: take chunk_sectors into account in bio_split_write_zeroes

[ Upstream commit 60dc5ea6bcfd078b71419640d49afa649acf9450 ]

For zoned devices, write zeroes must be split at the zone boundary
which is represented as chunk_sectors.  For other uses like the
internally RAIDed NVMe devices it is probably at least useful.

Enhance get_max_io_size to know about write zeroes and use it in
bio_split_write_zeroes.  Also add a comment about the seemingly
nonsensical zero max_write_zeroes limit.

Fixes: 885fa13f6559 ("block: implement splitting of REQ_OP_WRITE_ZEROES bios")
Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Damien Le Moal <dlemoal@kernel.org>
Link: https://lore.kernel.org/r/20241104062647.91160-2-hch@lst.de
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Sasha Levin <sashal@kernel.org>
block/blk-merge.c