# This is a BitKeeper generated patch for the following project: # Project Name: Linux kernel tree # This patch format is intended for GNU patch command version 2.5 or higher. # This patch includes the following deltas: # ChangeSet 1.637 -> 1.638 # drivers/ide24/ide-disk.c 1.1 -> 1.2 # # The following is the BitKeeper ChangeSet Log # -------------------------------------------- # 02/07/09 axboe@burns.home.kernel.dk 1.638 # fix bio multi-page pio multi write bug # -------------------------------------------- # diff -Nru a/drivers/ide24/ide-disk.c b/drivers/ide24/ide-disk.c --- a/drivers/ide24/ide-disk.c Tue Jul 9 16:17:46 2002 +++ b/drivers/ide24/ide-disk.c Tue Jul 9 16:17:46 2002 @@ -276,14 +276,23 @@ /* Do we move to the next bh after this? */ if (!rq->current_nr_sectors) { - struct bio *bio = rq->bio->bi_next; + struct bio *bio = rq->bio; + + /* + * only move to next bio, when we have processed + * all bvecs in this one. + */ + if (++bio->bi_idx >= bio->bi_vcnt) { + bio->bi_idx = 0; + bio = bio->bi_next; + } /* end early early we ran out of requests */ if (!bio) { mcount = 0; } else { rq->bio = bio; - rq->current_nr_sectors = bio_sectors(bio); + rq->current_nr_sectors = bio_iovec(bio)->bv_len >> 9; rq->hard_cur_sectors = rq->current_nr_sectors; } }