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

Christoph Hellwig hch at lst.de
Wed Jun 3 07:39:56 UTC 2015


On Mon, Jun 01, 2015 at 01:19:13AM +0000, Junichi Nomura wrote:
> 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.

It will be returned to the upper layer after the first completion
as mentioned in my previous mail.  Same for the other test.

Think of partial completion as a way for SCSI targets to chunk
transfers, higher layers will only see full success/failure cases.

For that reason we also removed the bytes completed argument to
->bi_end_io because the callers should not care about these details.




More information about the dm-devel mailing list