mbox series

[for-next,0/3] null_blk: improve write failure simulation

Message ID 20241218074914.814913-1-shinichiro.kawasaki@wdc.com (mailing list archive)
Headers show
Series null_blk: improve write failure simulation | expand

Message

Shinichiro Kawasaki Dec. 18, 2024, 7:49 a.m. UTC
Currently, null_blk has 'badblocks' attribute to simulate IO failures
for broken blocks. This helps checking if userland tools can handle IO
failures. However, this badblocks feature has two differences from the
IO failures on real storage devices. Firstly, when write operations fail
for the badblocks, null_blk does not write any data, while real storage
devices sometimes do partial data write. Secondly, null_blk always make
write operations fail for the specified badblocks, while real storage
devices can recover the bad blocks so that next write operations can
succeed after failure. Hence, real storage devices are required to check
if userland tools support such partial writes or bad blocks recovery.

This series improves write failure simulation by null_blk to allow
checking userland tools without real storage devices. The first and the
second patches add partial IO support. The last patch introduces
'badblocks_once' attribute to simulate bad blocks recovery.

Shin'ichiro Kawasaki (3):
  null_blk: do partial IO for bad blocks
  null_blk: move write pointers for partial writes
  null_blk: introduce badblocks_once parameter

 drivers/block/null_blk/main.c     | 68 +++++++++++++++++++++++++------
 drivers/block/null_blk/null_blk.h |  7 ++++
 drivers/block/null_blk/zoned.c    | 10 +++++
 3 files changed, 73 insertions(+), 12 deletions(-)