diff options
| author | Shin'ichiro Kawasaki <shinichiro.kawasaki@wdc.com> | 2026-09-16 15:56:57 +0900 |
|---|---|---|
| committer | Jens Axboe <axboe@kernel.dk> | 2026-10-05 06:53:12 -0600 |
| commit | 58304e139cb3fa640da74bc02101f0926d0607e2 (patch) | |
| tree | 3506e116016ff0b819dbeaa01dae36ff99ccd1b3 /tools/perf/scripts/python | |
| parent | 684b413b5483f57c890c171b9400076a0143b918 (diff) | |
| download | linux-next-58304e139cb3fa640da74bc02101f0926d0607e2.tar.gz linux-next-58304e139cb3fa640da74bc02101f0926d0607e2.zip | |
zloop: zero out only the unread tail of short reads
zloop_complete_rq() handles a short read from a zone's backing file by
zero-filling every bio in the request. This is correct when the entire
request is beyond the written part of the zone. When a read request
straddles the boundary between written and unwritten data, read_iter()
returns a partial byte count and zloop then zeroes the whole request
even for the partially read area with valid data.
Such an unexpected zero data read was observed with fio test script
t/zbd/test-zbd-support and its test case 69, failing with "bad magic
header 0".
Avoid the unexpected zero data read by zeroing out only the unread tail
part. When read data size cmd->ret is smaller than the request size,
call the new helper function zloop_fill_zero_rq() that walks through
each bio_vec and fills zeros from the specified start offset.
Fixes: eb0570c7df23 ("block: new zoned loop block device driver")
Reviewed-by: Damien Le Moal <dlemoal@kernel.org>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Shin'ichiro Kawasaki <shinichiro.kawasaki@wdc.com>
Link: https://patch.msgid.link/20260916065657.62724-1-shinichiro.kawasaki@opensource.wdc.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'tools/perf/scripts/python')
0 files changed, 0 insertions, 0 deletions
