diff options
Diffstat (limited to 'recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.23/0015-md-raid5-Do-not-add-data_offset-before-call-to-is_ba.patch')
-rw-r--r-- | recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.23/0015-md-raid5-Do-not-add-data_offset-before-call-to-is_ba.patch | 54 |
1 files changed, 54 insertions, 0 deletions
diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.23/0015-md-raid5-Do-not-add-data_offset-before-call-to-is_ba.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.23/0015-md-raid5-Do-not-add-data_offset-before-call-to-is_ba.patch new file mode 100644 index 00000000..953b3b65 --- /dev/null +++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.23/0015-md-raid5-Do-not-add-data_offset-before-call-to-is_ba.patch | |||
@@ -0,0 +1,54 @@ | |||
1 | From 2afec61845b4c0bed64c257a0acc2612e1862885 Mon Sep 17 00:00:00 2001 | ||
2 | From: majianpeng <majianpeng@gmail.com> | ||
3 | Date: Tue, 12 Jun 2012 08:31:10 +0800 | ||
4 | Subject: [PATCH 15/49] md/raid5: Do not add data_offset before call to | ||
5 | is_badblock | ||
6 | |||
7 | commit 6c0544e255dd6582a9899572e120fb55d9f672a4 upstream. | ||
8 | |||
9 | In chunk_aligned_read() we are adding data_offset before calling | ||
10 | is_badblock. But is_badblock also adds data_offset, so that is bad. | ||
11 | |||
12 | So move the addition of data_offset to after the call to | ||
13 | is_badblock. | ||
14 | |||
15 | This bug was introduced by commit 31c176ecdf3563140e639 | ||
16 | md/raid5: avoid reading from known bad blocks. | ||
17 | which first appeared in 3.0. So that patch is suitable for any | ||
18 | -stable kernel from 3.0.y onwards. However it will need minor | ||
19 | revision for most of those (as the comment didn't appear until | ||
20 | recently). | ||
21 | |||
22 | Signed-off-by: majianpeng <majianpeng@gmail.com> | ||
23 | Signed-off-by: NeilBrown <neilb@suse.de> | ||
24 | [bwh: Backported to 3.2: ignored missing comment] | ||
25 | Signed-off-by: Ben Hutchings <ben@decadent.org.uk> | ||
26 | --- | ||
27 | drivers/md/raid5.c | 4 +++- | ||
28 | 1 file changed, 3 insertions(+), 1 deletion(-) | ||
29 | |||
30 | diff --git a/drivers/md/raid5.c b/drivers/md/raid5.c | ||
31 | index 858fdbb..d423c7e 100644 | ||
32 | --- a/drivers/md/raid5.c | ||
33 | +++ b/drivers/md/raid5.c | ||
34 | @@ -3621,7 +3621,6 @@ static int chunk_aligned_read(struct mddev *mddev, struct bio * raid_bio) | ||
35 | raid_bio->bi_next = (void*)rdev; | ||
36 | align_bi->bi_bdev = rdev->bdev; | ||
37 | align_bi->bi_flags &= ~(1 << BIO_SEG_VALID); | ||
38 | - align_bi->bi_sector += rdev->data_offset; | ||
39 | |||
40 | if (!bio_fits_rdev(align_bi) || | ||
41 | is_badblock(rdev, align_bi->bi_sector, align_bi->bi_size>>9, | ||
42 | @@ -3632,6 +3631,9 @@ static int chunk_aligned_read(struct mddev *mddev, struct bio * raid_bio) | ||
43 | return 0; | ||
44 | } | ||
45 | |||
46 | + /* No reshape active, so we can trust rdev->data_offset */ | ||
47 | + align_bi->bi_sector += rdev->data_offset; | ||
48 | + | ||
49 | spin_lock_irq(&conf->device_lock); | ||
50 | wait_event_lock_irq(conf->wait_for_stripe, | ||
51 | conf->quiesce == 0, | ||
52 | -- | ||
53 | 1.7.10 | ||
54 | |||