Re: [PATCH] 2.5.67-ac2 direct-IO for IDE taskfile ioctl (1/4)

Bartlomiej Zolnierkiewicz (B.Zolnierkiewicz@elka.pw.edu.pl)
Thu, 24 Apr 2003 16:46:40 +0200 (MET DST)


On Thu, 24 Apr 2003, Jens Axboe wrote:

> On Wed, Apr 23 2003, Bartlomiej Zolnierkiewicz wrote:
> > bio = bio_map_user(bdev, uaddr, hdr.dxfer_len, reading);
> > - if (bio) {
> > - if (writing)
> > - bio->bi_rw |= (1 << BIO_RW);
> > -
> > - nr_sectors = (bio->bi_size + 511) >> 9;
> > -
> > - if (bio->bi_size < hdr.dxfer_len) {
> > - bio_endio(bio, bio->bi_size, 0);
> > - bio_unmap_user(bio, 0);
> > - bio = NULL;
> > - }
> > - }
> > + if (bio && writing)
> > + bio->bi_rw |= (1 << BIO_RW);
>
> I think it's cleaner to have bio_map_user() set the direction bit,
> instead of having every user do it. It also uncovered an old bug where

You are right.

> blk_queue_bounce() is called without the direction bit set in the bio,
> uh oh...

Yep.

> Here's my preferred version. You also had the incremental bio processing
> as a prereq for this bio addition, I removed that for now as well.

Patch is okay.

> # The following is the BitKeeper ChangeSet Log
> # --------------------------------------------
> # 03/04/24 axboe@smithers.home.kernel.dk 1.1217
> # - Abstract out bio request preparation
> # - Have bio_map_user() set data direction (fixes bug where blk_queue_bounce()
> # is called without it set)
> # - Split bio_map_user() in two
> # --------------------------------------------

Very minor issue, last comment is a bit misleading...

--
Bartlomiej Zolnierkiewicz

- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/