diff options
author | Jens Axboe <axboe@suse.de> | 2004-07-28 08:57:38 -0700 |
---|---|---|
committer | Linus Torvalds <torvalds@ppc970.osdl.org> | 2004-07-28 08:57:38 -0700 |
commit | dac25d20e595802bd1ad2dc95dba53cbf7ac38ed (patch) | |
tree | bc5b78fd94abfbeee61cf935fa6b567fa4c4d60a /mm | |
parent | 09e77fcaff727d2454d1350330920184e9c8e65b (diff) | |
download | history-dac25d20e595802bd1ad2dc95dba53cbf7ac38ed.tar.gz |
[PATCH] BIO page refcounting fix
Hopefully fixes the free-of-a-freed-page BUG caused during CDRW writing.
This also fixes a problem in the bouncing for io errors (it needs to free
the pages and clear the BIO_UPTODATE flag, not set it. it's already set.
passing -EIO to bio_endio() takes care of that).
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'mm')
-rw-r--r-- | mm/highmem.c | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/mm/highmem.c b/mm/highmem.c index 09eac06bb52efb..432da5b68baf5a 100644 --- a/mm/highmem.c +++ b/mm/highmem.c @@ -308,12 +308,10 @@ static void bounce_end_io(struct bio *bio, mempool_t *pool) { struct bio *bio_orig = bio->bi_private; struct bio_vec *bvec, *org_vec; - int i; + int i, err = 0; if (!test_bit(BIO_UPTODATE, &bio->bi_flags)) - goto out_eio; - - set_bit(BIO_UPTODATE, &bio_orig->bi_flags); + err = -EIO; /* * free up bounce indirect pages used @@ -326,8 +324,7 @@ static void bounce_end_io(struct bio *bio, mempool_t *pool) mempool_free(bvec->bv_page, pool); } -out_eio: - bio_endio(bio_orig, bio_orig->bi_size, 0); + bio_endio(bio_orig, bio_orig->bi_size, err); bio_put(bio); } |