[dm-devel] [PATCH for-4.2 2/3] block, dm: don't copy bios for request clones

Junichi Nomura j-nomura at ce.jp.nec.com
Mon Jun 1 01:19:13 UTC 2015


On 05/30/15 01:55, Christoph Hellwig wrote:
> On Wed, May 27, 2015 at 09:50:18AM +0000, Junichi Nomura wrote:
>> Can you test this scenario with your patch?
>>   1. Set up a multipath device with fail-over mode
>>   2. Write something to the multipath device.
>>      After the clone request is sent to the primary path
>>      and before the data goes to the disk, 
>>      down the primary path
>>      (e.g. echo offline > /sys/block/sdXX/device/state)
>>   3. (dm-mpath will retry from the secondary path and
>>       the write will eventually succeed)
>>   4. Verify if the written data is really on the disk
> 
> Verified as not working correctly.  The patch below fixes it,
> but it needs more testing and some comments:

Thanks. But just skipping bio_advance() is not good.

For example, blk_update_request() does this:

>         while (req->bio) {
>                 struct bio *bio = req->bio;
>                 unsigned bio_bytes = min(bio->bi_iter.bi_size, nr_bytes);
> 
>                 if (bio_bytes == bio->bi_iter.bi_size)
>                         req->bio = bio->bi_next;

if bi_iter.bi_size is not correct, we possibly fail
to move the req->bio pointer.

So other test case could be:

1. Create a bio with 1MB size
2. Submit a request with the bio
3. From lower driver,
   firstly partial complete 512KB with error,
   secondly partial complete 512KB without error
4. The I/O should complete successfully.

And yet another test:

1. Create 4 READ bios with each 4KB
2. Submit a request with the 4 bios
3. From lower driver,
   partial complete 8KB without error,
   partial complete 4KB with error (emulate medium error),
   partial complete 4KB without error
4. Verify the read data.
   Only the 3rd 4KB should be failed.
   Others should have correct contents.

-- 
Jun'ichi Nomura, NEC Corporation




More information about the dm-devel mailing list