]> www.infradead.org Git - users/hch/misc.git/commit
block: only update request sector if needed
authorJohannes Thumshirn <johannes.thumshirn@wdc.com>
Tue, 6 May 2025 11:27:30 +0000 (13:27 +0200)
committerJens Axboe <axboe@kernel.dk>
Tue, 6 May 2025 13:45:31 +0000 (07:45 -0600)
commit3bb6e35632fed829a36c68385811217a9e8072a8
tree6dfaa192ce241c4992833e5dfb926118aff5cabf
parent78c271344b6f64ce24c845e54903e09928cf2061
block: only update request sector if needed

In case of a ZONE APPEND write, regardless of native ZONE APPEND or the
emulation layer in the zone write plugging code, the sector the data got
written to by the device needs to be updated in the bio.

At the moment, this is done for every native ZONE APPEND write and every
request that is flagged with 'BIO_ZONE_WRITE_PLUGGING'. But thus
superfluously updates the sector for regular writes to a zoned block
device.

Check if a bio is a native ZONE APPEND write or if the bio is flagged as
'BIO_EMULATES_ZONE_APPEND', meaning the block layer's zone write plugging
code handles the ZONE APPEND and translates it into a regular write and
back. Only if one of these two criterion is met, update the sector in the
bio upon completion.

Signed-off-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Link: https://lore.kernel.org/r/dea089581cb6b777c1cd1500b38ac0b61df4b2d1.1746530748.git.jth@kernel.org
Signed-off-by: Jens Axboe <axboe@kernel.dk>
block/blk.h