linux/block
Damien Le Moal 29459c3eaa block: Fix zone write plugging handling of devices with a runt zone
A zoned device may have a last sequential write required zone that is
smaller than other zones. However, all tests to check if a zone write
plug write offset exceeds the zone capacity use the same capacity
value stored in the gendisk zone_capacity field. This is incorrect for a
zoned device with a last runt (smaller) zone.

Add the new field last_zone_capacity to struct gendisk to store the
capacity of the last zone of the device. blk_revalidate_seq_zone() and
blk_revalidate_conv_zone() are both modified to get this value when
disk_zone_is_last() returns true. Similarly to zone_capacity, the value
is first stored using the last_zone_capacity field of struct
blk_revalidate_zone_args. Once zone revalidation of all zones is done,
this is used to set the gendisk last_zone_capacity field.

The checks to determine if a zone is full or if a sector offset in a
zone exceeds the zone capacity in disk_should_remove_zone_wplug(),
disk_zone_wplug_abort_unaligned(), blk_zone_write_plug_init_request(),
and blk_zone_wplug_prepare_bio() are modified to use the new helper
functions disk_zone_is_full() and disk_zone_wplug_is_full().
disk_zone_is_full() uses the zone index to determine if the zone being
tested is the last one of the disk and uses the either the disk
zone_capacity or last_zone_capacity accordingly.

Fixes: dd291d77cc ("block: Introduce zone write plugging")
Signed-off-by: Damien Le Moal <dlemoal@kernel.org>
Reviewed-by: Bart Van Assche <bvanassche@acm.org>
Reviewed-by: Niklas Cassel <cassel@kernel.org>
Link: https://lore.kernel.org/r/20240530054035.491497-4-dlemoal@kernel.org
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2024-05-30 15:03:52 -06:00
..
partitions Compactifying bdev flags 2024-05-21 13:02:56 -07:00
badblocks.c
bdev.c Compactifying bdev flags 2024-05-21 13:02:56 -07:00
bfq-cgroup.c
bfq-iosched.c
bfq-iosched.h
bfq-wf2q.c
bio-integrity.c
bio.c for-6.10-tag 2024-05-14 17:25:36 -07:00
blk-cgroup-fc-appid.c
blk-cgroup-rwstat.c
blk-cgroup-rwstat.h
blk-cgroup.c blk-cgroup: Properly propagate the iostat update up the hierarchy 2024-05-15 20:15:54 -06:00
blk-cgroup.h
blk-core.c block-6.10-20240523 2024-05-23 13:44:47 -07:00
blk-crypto-fallback.c
blk-crypto-internal.h
blk-crypto-profile.c
blk-crypto-sysfs.c
blk-crypto.c
blk-flush.c
blk-ia-ranges.c
blk-integrity.c
blk-ioc.c
blk-iocost.c
blk-iolatency.c
blk-ioprio.c
blk-ioprio.h
blk-lib.c
blk-map.c
blk-merge.c
blk-mq-cpumap.c
blk-mq-debugfs.c
blk-mq-debugfs.h
blk-mq-pci.c
blk-mq-sched.c
blk-mq-sched.h
blk-mq-sysfs.c
blk-mq-tag.c
blk-mq-virtio.c
blk-mq.c block-6.10-20240523 2024-05-23 13:44:47 -07:00
blk-mq.h
blk-pm.c
blk-pm.h
blk-rq-qos.c
blk-rq-qos.h
blk-settings.c block: check for max_hw_sectors underflow 2024-05-28 06:55:23 -06:00
blk-stat.c
blk-stat.h block: delete redundant function declaration 2024-05-27 13:58:06 -06:00
blk-sysfs.c
blk-throttle.c blk-throttle: remove unused struct 'avg_latency_bucket' 2024-05-22 11:30:47 -06:00
blk-throttle.h
blk-timeout.c
blk-wbt.c
blk-wbt.h
blk-zoned.c block: Fix zone write plugging handling of devices with a runt zone 2024-05-30 15:03:52 -06:00
blk.h bd_inode series 2024-05-21 09:51:42 -07:00
bounce.c
bsg-lib.c
bsg.c
disk-events.c
early-lookup.c
elevator.c
elevator.h
fops.c bd_inode series 2024-05-21 09:51:42 -07:00
genhd.c Compactifying bdev flags 2024-05-21 13:02:56 -07:00
holder.c
ioctl.c Compactifying bdev flags 2024-05-21 13:02:56 -07:00
ioprio.c
Kconfig
Kconfig.iosched
kyber-iosched.c
Makefile
mq-deadline.c
opal_proto.h
sed-opal.c
t10-pi.c block: t10-pi: add MODULE_DESCRIPTION() 2024-05-20 08:07:44 -06:00