diff options
author | Raz Ben-Jehuda(caro) <raziebe@gmail.com> | 2006-12-10 05:20:47 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.osdl.org> | 2006-12-10 12:57:20 -0500 |
commit | 46031f9a38a9773021f1872abc713d62467ac22e (patch) | |
tree | fe91f661fe0aad5f149447797c5d31544453ca38 /include/linux | |
parent | f679623f50545bc0577caf2d0f8675b61162f059 (diff) |
[PATCH] md: allow reads that have bypassed the cache to be retried on failure
If a bypass-the-cache read fails, we simply try again through the cache. If
it fails again it will trigger normal recovery precedures.
update 1:
From: NeilBrown <neilb@suse.de>
1/
chunk_aligned_read and retry_aligned_read assume that
data_disks == raid_disks - 1
which is not true for raid6.
So when an aligned read request bypasses the cache, we can get the wrong data.
2/ The cloned bio is being used-after-free in raid5_align_endio
(to test BIO_UPTODATE).
3/ We forgot to add rdev->data_offset when submitting
a bio for aligned-read
4/ clone_bio calls blk_recount_segments and then we change bi_bdev,
so we need to invalidate the segment counts.
5/ We don't de-reference the rdev when the read completes.
This means we need to record the rdev to so it is still
available in the end_io routine. Fortunately
bi_next in the original bio is unused at this point so
we can stuff it in there.
6/ We leak a cloned bio if the target rdev is not usable.
From: NeilBrown <neilb@suse.de>
update 2:
1/ When aligned requests fail (read error) they need to be retried
via the normal method (stripe cache). As we cannot be sure that
we can process a single read in one go (we may not be able to
allocate all the stripes needed) we store a bio-being-retried
and a list of bioes-that-still-need-to-be-retried.
When find a bio that needs to be retried, we should add it to
the list, not to single-bio...
2/ We were never incrementing 'scnt' when resubmitting failed
aligned requests.
[akpm@osdl.org: build fix]
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 'include/linux')
-rw-r--r-- | include/linux/raid/raid5.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/include/linux/raid/raid5.h b/include/linux/raid/raid5.h index 03636d7918fe..d8286db60b96 100644 --- a/include/linux/raid/raid5.h +++ b/include/linux/raid/raid5.h | |||
@@ -227,7 +227,10 @@ struct raid5_private_data { | |||
227 | struct list_head handle_list; /* stripes needing handling */ | 227 | struct list_head handle_list; /* stripes needing handling */ |
228 | struct list_head delayed_list; /* stripes that have plugged requests */ | 228 | struct list_head delayed_list; /* stripes that have plugged requests */ |
229 | struct list_head bitmap_list; /* stripes delaying awaiting bitmap update */ | 229 | struct list_head bitmap_list; /* stripes delaying awaiting bitmap update */ |
230 | struct bio *retry_read_aligned; /* currently retrying aligned bios */ | ||
231 | struct bio *retry_read_aligned_list; /* aligned bios retry list */ | ||
230 | atomic_t preread_active_stripes; /* stripes with scheduled io */ | 232 | atomic_t preread_active_stripes; /* stripes with scheduled io */ |
233 | atomic_t active_aligned_reads; | ||
231 | 234 | ||
232 | atomic_t reshape_stripes; /* stripes with pending writes for reshape */ | 235 | atomic_t reshape_stripes; /* stripes with pending writes for reshape */ |
233 | /* unfortunately we need two cache names as we temporarily have | 236 | /* unfortunately we need two cache names as we temporarily have |