Re: [PATCH for-next v2 2/4] null_blk: do partial IO for bad blocks

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 12/25/24 7:09 PM, Shin'ichiro Kawasaki wrote:
> 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. 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, perform the data transfer
> from the IO start block to the block just before the first bad block.
> Introduce __null_handle_rq() to support partial data transfer. Modify
> null_handle_badblocks() to calculate the size of the partial data
> transfer and call __null_handle_rq().

We should have an option to control this behavior to be able to mimic actual
devices. E.g. SAS devices may do partial data transfers before hitting a bad
block, but ATA devices will not (it is always all or nothing with ATA). The
current default corresponds to an ATA drive behavior and this change allows
emulating a SAS drive behavior. So let's control this with an option.



-- 
Damien Le Moal
Western Digital Research




[Index of Archives]     [Linux RAID]     [Linux SCSI]     [Linux ATA RAID]     [IDE]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Device Mapper]

  Powered by Linux