diff options
| author | Xu Rao <raoxu@uniontech.com> | 2026-08-04 10:34:03 +0800 |
|---|---|---|
| committer | Jens Axboe <axboe@kernel.dk> | 2026-08-04 06:55:08 -0600 |
| commit | 72e67c118642634c25465db0c8bcfa54c4ce086c (patch) | |
| tree | 72771d33fd65e91fd0c3441d4ce8e44f0ae446a3 /tools/perf/scripts/python | |
| parent | d507d3cb19e71f10336e41deeac517cdc21c34ea (diff) | |
zloop: truncate finished zones to zone capacity
The size of a sequential zone backing file records the amount of data
written and is used to restore the zone state. A backing file whose size
is equal to the zone capacity is restored as a full zone, while a file
larger than the zone capacity is rejected as invalid.
However, zloop_finish_zone() currently truncates the backing file to the
zone size. For devices with a reduced zone capacity, finishing a zone
therefore creates a backing file larger than the zone capacity. After the
device is removed and later re-added, that zone file is rejected instead
of being restored as a full zone.
Truncate finished sequential zones to the zone capacity, matching the
persistent representation accepted by zloop_update_seq_zone() for a full
zone.
Suggested-by: Damien Le Moal <dlemoal@kernel.org>
Fixes: eb0570c7df23 ("block: new zoned loop block device driver")
Cc: stable@vger.kernel.org
Signed-off-by: Xu Rao <raoxu@uniontech.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Damien Le Moal <dlemoal@kernel.org>
Link: https://patch.msgid.link/B39E5FD81D1A07F4+20260804023403.939767-1-raoxu@uniontech.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'tools/perf/scripts/python')
0 files changed, 0 insertions, 0 deletions
