| 3451cf34 | 06-Nov-2025 |
Keith Busch <kbusch@kernel.org> |
null_blk: allow byte aligned memory offsets
Allowing byte aligned memory provides a nice testing ground for direct-io.
Signed-off-by: Keith Busch <kbusch@kernel.org> Reviewed-by: Christoph Hellwig
null_blk: allow byte aligned memory offsets
Allowing byte aligned memory provides a nice testing ground for direct-io.
Signed-off-by: Keith Busch <kbusch@kernel.org> Reviewed-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com> Reviewed-by: Damien Le Moal <dlemoal@kernel.org> Reviewed-by: Chaitanya Kulkarni <kch@nvidia.com> Tested-by: Hans Holmberg <hans.holmberg@wdc.com> Signed-off-by: Jens Axboe <axboe@kernel.dk>
show more ...
|
| 262a3dd0 | 06-Nov-2025 |
Keith Busch <kbusch@kernel.org> |
null_blk: single kmap per bio segment
Rather than kmap the the request bio segment for each sector, do the mapping just once.
Signed-off-by: Keith Busch <kbusch@kernel.org> Reviewed-by: Christoph H
null_blk: single kmap per bio segment
Rather than kmap the the request bio segment for each sector, do the mapping just once.
Signed-off-by: Keith Busch <kbusch@kernel.org> Reviewed-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com> Reviewed-by: Damien Le Moal <dlemoal@kernel.org> Reviewed-by: Chaitanya Kulkarni <kch@nvidia.com> Tested-by: Hans Holmberg <hans.holmberg@wdc.com> Signed-off-by: Jens Axboe <axboe@kernel.dk>
show more ...
|
| 84592838 | 06-Nov-2025 |
Keith Busch <kbusch@kernel.org> |
null_blk: consistently use blk_status_t
No need to mix errno and blk_status_t error types. Just use the standard block layer type.
Signed-off-by: Keith Busch <kbusch@kernel.org> Reviewed-by: Christ
null_blk: consistently use blk_status_t
No need to mix errno and blk_status_t error types. Just use the standard block layer type.
Signed-off-by: Keith Busch <kbusch@kernel.org> Reviewed-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com> Reviewed-by: Damien Le Moal <dlemoal@kernel.org> Reviewed-by: Chaitanya Kulkarni <kch@nvidia.com> Tested-by: Hans Holmberg <hans.holmberg@wdc.com> Signed-off-by: Jens Axboe <axboe@kernel.dk>
show more ...
|
| 1165d20f | 06-Nov-2025 |
Keith Busch <kbusch@kernel.org> |
null_blk: simplify copy_from_nullb
It always returns success, so the code that saves the errors status, but proceeds without checking it looks a bit odd. Clean this up.
Signed-off-by: Keith Busch <
null_blk: simplify copy_from_nullb
It always returns success, so the code that saves the errors status, but proceeds without checking it looks a bit odd. Clean this up.
Signed-off-by: Keith Busch <kbusch@kernel.org> Reviewed-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com> Reviewed-by: Damien Le Moal <dlemoal@kernel.org> Reviewed-by: Chaitanya Kulkarni <kch@nvidia.com> Tested-by: Hans Holmberg <hans.holmberg@wdc.com> Signed-off-by: Jens Axboe <axboe@kernel.dk>
show more ...
|
| d301f164 | 27-Feb-2025 |
Zheng Qixing <zhengqixing@huawei.com> |
badblocks: use sector_t instead of int to avoid truncation of badblocks length
There is a truncation of badblocks length issue when set badblocks as follow:
echo "2055 4294967299" > bad_blocks cat
badblocks: use sector_t instead of int to avoid truncation of badblocks length
There is a truncation of badblocks length issue when set badblocks as follow:
echo "2055 4294967299" > bad_blocks cat bad_blocks 2055 3
Change 'sectors' argument type from 'int' to 'sector_t'.
This change avoids truncation of badblocks length for large sectors by replacing 'int' with 'sector_t' (u64), enabling proper handling of larger disk sizes and ensuring compatibility with 64-bit sector addressing.
Fixes: 9e0e252a048b ("badblocks: Add core badblock management code") Signed-off-by: Zheng Qixing <zhengqixing@huawei.com> Reviewed-by: Yu Kuai <yukuai3@huawei.com> Acked-by: Coly Li <colyli@kernel.org> Link: https://lore.kernel.org/r/20250227075507.151331-13-zhengqixing@huaweicloud.com Signed-off-by: Jens Axboe <axboe@kernel.dk>
show more ...
|
| 567abc98 | 26-Feb-2025 |
Shin'ichiro Kawasaki <shinichiro.kawasaki@wdc.com> |
null_blk: do partial IO for bad blocks
The current null_blk implementation checks if any bad blocks exist in the target blocks of each IO. If so, the IO fails and data is not transferred for all of
null_blk: do partial IO for bad blocks
The current null_blk implementation checks if any bad blocks exist in the target blocks of each IO. If so, the IO fails and data is not transferred for all of the IO target blocks. However, when real storage devices have bad blocks, the devices may transfer data partially up to the first bad blocks (e.g., SAS drives). Especially, when the IO is a write operation, such partial IO leaves partially written data on the device.
To simulate such partial IO using null_blk, introduce the new parameter 'badblocks_partial_io'. When this parameter is set, null_handle_badblocks() returns the number of the sectors for the partial IO as its third pointer argument. Pass the returned number of sectors to the following calls to null_handle_memory_backend() in null_process_cmd() and null_zone_write().
Reviewed-by: Damien Le Moal <dlemoal@kernel.org> Reviewed-by: Chaitanya Kulkarni <kch@nvidia.com> Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com> Signed-off-by: Shin'ichiro Kawasaki <shinichiro.kawasaki@wdc.com> Link: https://lore.kernel.org/r/20250226100613.1622564-6-shinichiro.kawasaki@wdc.com Signed-off-by: Jens Axboe <axboe@kernel.dk>
show more ...
|
| ed0c31ae | 26-Feb-2025 |
Shin'ichiro Kawasaki <shinichiro.kawasaki@wdc.com> |
null_blk: pass transfer size to null_handle_rq()
As preparation to support partial data transfer, add a new argument to null_handle_rq() to pass the number of sectors to transfer. While at it, renam
null_blk: pass transfer size to null_handle_rq()
As preparation to support partial data transfer, add a new argument to null_handle_rq() to pass the number of sectors to transfer. While at it, rename the function from null_handle_rq to null_handle_data_transfer. This commit does not change the behavior.
Reviewed-by: Damien Le Moal <dlemoal@kernel.org> Reviewed-by: Chaitanya Kulkarni <kch@nvidia.com> Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com> Signed-off-by: Shin'ichiro Kawasaki <shinichiro.kawasaki@wdc.com> Link: https://lore.kernel.org/r/20250226100613.1622564-5-shinichiro.kawasaki@wdc.com Signed-off-by: Jens Axboe <axboe@kernel.dk>
show more ...
|
| 4f235000 | 26-Feb-2025 |
Shin'ichiro Kawasaki <shinichiro.kawasaki@wdc.com> |
null_blk: replace null_process_cmd() call in null_zone_write()
As a preparation to support partial data transfer due to badblocks, replace the null_process_cmd() call in null_zone_write() with equiv
null_blk: replace null_process_cmd() call in null_zone_write()
As a preparation to support partial data transfer due to badblocks, replace the null_process_cmd() call in null_zone_write() with equivalent calls to null_handle_badblocks() and null_handle_memory_backed(). This commit does not change behavior. It will enable null_handle_badblocks() to return the size of partial data transfer in the following commit, allowing null_zone_write() to move write pointers appropriately.
Reviewed-by: Damien Le Moal <dlemoal@kernel.org> Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com> Signed-off-by: Shin'ichiro Kawasaki <shinichiro.kawasaki@wdc.com> Link: https://lore.kernel.org/r/20250226100613.1622564-4-shinichiro.kawasaki@wdc.com Signed-off-by: Jens Axboe <axboe@kernel.dk>
show more ...
|
| 800c2439 | 26-Feb-2025 |
Shin'ichiro Kawasaki <shinichiro.kawasaki@wdc.com> |
null_blk: introduce badblocks_once parameter
When IO errors happen on real storage devices, the IOs repeated to the same target range can success by virtue of recovery features by devices, such as r
null_blk: introduce badblocks_once parameter
When IO errors happen on real storage devices, the IOs repeated to the same target range can success by virtue of recovery features by devices, such as reserved block assignment. To simulate such IO errors and recoveries, introduce the new parameter badblocks_once parameter. When this parameter is set to 1, the specified badblocks are cleared after the first IO error, so that the next IO to the blocks succeed.
Reviewed-by: Damien Le Moal <dlemoal@kernel.org> Reviewed-by: Chaitanya Kulkarni <kch@nvidia.com> Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com> Signed-off-by: Shin'ichiro Kawasaki <shinichiro.kawasaki@wdc.com> Link: https://lore.kernel.org/r/20250226100613.1622564-3-shinichiro.kawasaki@wdc.com Signed-off-by: Jens Axboe <axboe@kernel.dk>
show more ...
|