aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/md
diff options
context:
space:
mode:
authorNeilBrown <neilb@suse.de>2006-12-10 05:20:51 -0500
committerLinus Torvalds <torvalds@woody.osdl.org>2006-12-10 12:57:21 -0500
commitc2b00852fbae4f8c45c2651530ded3bd01bde814 (patch)
tree697a2087ffb1e5d3d81af628e818f9d943c4267f /drivers/md
parentb8c6b645563d641df91fdcfd84a9c73c91d75b61 (diff)
[PATCH] md: return a non-zero error to bi_end_io as appropriate in raid5
Currently raid5 depends on clearing the BIO_UPTODATE flag to signal an error to higher levels. While this should be sufficient, it is safer to explicitly set the error code as well - less room for confusion. Signed-off-by: Neil Brown <neilb@suse.de> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'drivers/md')
-rw-r--r--drivers/md/raid5.c16
1 files changed, 12 insertions, 4 deletions
diff --git a/drivers/md/raid5.c b/drivers/md/raid5.c
index 347caab99ca0..377f8bc9b78b 100644
--- a/drivers/md/raid5.c
+++ b/drivers/md/raid5.c
@@ -1818,7 +1818,9 @@ static void handle_stripe5(struct stripe_head *sh)
1818 return_bi = bi->bi_next; 1818 return_bi = bi->bi_next;
1819 bi->bi_next = NULL; 1819 bi->bi_next = NULL;
1820 bi->bi_size = 0; 1820 bi->bi_size = 0;
1821 bi->bi_end_io(bi, bytes, 0); 1821 bi->bi_end_io(bi, bytes,
1822 test_bit(BIO_UPTODATE, &bi->bi_flags)
1823 ? 0 : -EIO);
1822 } 1824 }
1823 for (i=disks; i-- ;) { 1825 for (i=disks; i-- ;) {
1824 int rw; 1826 int rw;
@@ -2359,7 +2361,9 @@ static void handle_stripe6(struct stripe_head *sh, struct page *tmp_page)
2359 return_bi = bi->bi_next; 2361 return_bi = bi->bi_next;
2360 bi->bi_next = NULL; 2362 bi->bi_next = NULL;
2361 bi->bi_size = 0; 2363 bi->bi_size = 0;
2362 bi->bi_end_io(bi, bytes, 0); 2364 bi->bi_end_io(bi, bytes,
2365 test_bit(BIO_UPTODATE, &bi->bi_flags)
2366 ? 0 : -EIO);
2363 } 2367 }
2364 for (i=disks; i-- ;) { 2368 for (i=disks; i-- ;) {
2365 int rw; 2369 int rw;
@@ -2859,7 +2863,9 @@ static int make_request(request_queue_t *q, struct bio * bi)
2859 if ( rw == WRITE ) 2863 if ( rw == WRITE )
2860 md_write_end(mddev); 2864 md_write_end(mddev);
2861 bi->bi_size = 0; 2865 bi->bi_size = 0;
2862 bi->bi_end_io(bi, bytes, 0); 2866 bi->bi_end_io(bi, bytes,
2867 test_bit(BIO_UPTODATE, &bi->bi_flags)
2868 ? 0 : -EIO);
2863 } 2869 }
2864 return 0; 2870 return 0;
2865} 2871}
@@ -3127,7 +3133,9 @@ static int retry_aligned_read(raid5_conf_t *conf, struct bio *raid_bio)
3127 int bytes = raid_bio->bi_size; 3133 int bytes = raid_bio->bi_size;
3128 3134
3129 raid_bio->bi_size = 0; 3135 raid_bio->bi_size = 0;
3130 raid_bio->bi_end_io(raid_bio, bytes, 0); 3136 raid_bio->bi_end_io(raid_bio, bytes,
3137 test_bit(BIO_UPTODATE, &raid_bio->bi_flags)
3138 ? 0 : -EIO);
3131 } 3139 }
3132 if (atomic_dec_and_test(&conf->active_aligned_reads)) 3140 if (atomic_dec_and_test(&conf->active_aligned_reads))
3133 wake_up(&conf->wait_for_stripe); 3141 wake_up(&conf->wait_for_stripe);