Commit a9bc2790 authored by Stephen Lord's avatar Stephen Lord Committed by Linus Torvalds

[XFS] fix initialization of bio in end case where we are dealing with sub page

sized requests.

SGI Modid: 2.5.x-xfs:slinx:138201a
parent 168dba96
...@@ -1299,7 +1299,6 @@ pagebuf_iorequest( /* start real I/O */ ...@@ -1299,7 +1299,6 @@ pagebuf_iorequest( /* start real I/O */
int status = 0; int status = 0;
int i, map_i, total_nr_pages, nr_pages; int i, map_i, total_nr_pages, nr_pages;
struct bio *bio; struct bio *bio;
struct bio_vec *bvec;
int offset = pb->pb_offset; int offset = pb->pb_offset;
int size = pb->pb_count_desired; int size = pb->pb_count_desired;
sector_t sector = pb->pb_bn; sector_t sector = pb->pb_bn;
...@@ -1335,13 +1334,8 @@ pagebuf_iorequest( /* start real I/O */ ...@@ -1335,13 +1334,8 @@ pagebuf_iorequest( /* start real I/O */
bio->bi_sector = sector - (offset >> BBSHIFT); bio->bi_sector = sector - (offset >> BBSHIFT);
bio->bi_end_io = bio_end_io_pagebuf; bio->bi_end_io = bio_end_io_pagebuf;
bio->bi_private = pb; bio->bi_private = pb;
bio->bi_vcnt++;
bio->bi_size = PAGE_CACHE_SIZE;
bvec = bio->bi_io_vec; bio_add_page(bio, pb->pb_pages[0], PAGE_CACHE_SIZE, 0);
bvec->bv_page = pb->pb_pages[0];
bvec->bv_len = PAGE_CACHE_SIZE;
bvec->bv_offset = 0;
atomic_inc(&pb->pb_io_remaining); atomic_inc(&pb->pb_io_remaining);
submit_bio(READ, bio); submit_bio(READ, bio);
...@@ -1389,9 +1383,7 @@ pagebuf_iorequest( /* start real I/O */ ...@@ -1389,9 +1383,7 @@ pagebuf_iorequest( /* start real I/O */
bio->bi_end_io = bio_end_io_pagebuf; bio->bi_end_io = bio_end_io_pagebuf;
bio->bi_private = pb; bio->bi_private = pb;
bvec = bio->bi_io_vec; for (; size && nr_pages; nr_pages--, map_i++) {
for (; size && nr_pages; nr_pages--, bvec++, map_i++) {
int nbytes = PAGE_CACHE_SIZE - offset; int nbytes = PAGE_CACHE_SIZE - offset;
if (nbytes > size) if (nbytes > size)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment