summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNeil Brown <neilb@cse.unsw.edu.au>2003-08-30 22:43:49 -0700
committerLinus Torvalds <torvalds@home.osdl.org>2003-08-30 22:43:49 -0700
commitcff9b7ddae05e2c281944f980ef56a75c98531ca (patch)
treead71d2c40b4dcf4b01834b33189f8634a3b16c0b
parent340df0b5d1e3082dcc8123ac57eb2db7b979734a (diff)
[PATCH] Honour the read-ahead for for reads in raid5.
If we get a failure trying to allocate a stripe_head for a read-ahead request (the only time we can get a failure), we skip the rest of the request and fail the whole bio.
-rw-r--r--drivers/md/raid5.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/drivers/md/raid5.c b/drivers/md/raid5.c
index 5995ee02775e..67ec3d3c32b6 100644
--- a/drivers/md/raid5.c
+++ b/drivers/md/raid5.c
@@ -1326,7 +1326,7 @@ static int make_request (request_queue_t *q, struct bio * bi)
(unsigned long long)new_sector,
(unsigned long long)logical_sector);
- sh = get_active_stripe(conf, new_sector, pd_idx, 0/*(bi->bi_rw&RWA_MASK)*/);
+ sh = get_active_stripe(conf, new_sector, pd_idx, (bi->bi_rw&RWA_MASK));
if (sh) {
add_stripe_bio(sh, bi, dd_idx, (bi->bi_rw&RW_MASK));
@@ -1334,7 +1334,12 @@ static int make_request (request_queue_t *q, struct bio * bi)
raid5_plug_device(conf);
handle_stripe(sh);
release_stripe(sh);
+ } else {
+ /* cannot get stripe for read-ahead, just give-up */
+ clear_bit(BIO_UPTODATE, &bi->bi_flags);
+ break;
}
+
}
spin_lock_irq(&conf->device_lock);
if (--bi->bi_phys_segments == 0) {