md/raid5: Do not add data_offset before call to is_badblock
authormajianpeng <majianpeng@gmail.com>
Tue, 12 Jun 2012 00:31:10 +0000 (08:31 +0800)
committerBen Hutchings <ben@decadent.org.uk>
Thu, 12 Jul 2012 03:32:05 +0000 (04:32 +0100)
commitebfdf3076402b08d6fd97141ac40149ff13f70ea
treeecc5f5034bf1012e6cd9ada07b479a55d7ce871a
parent2e9e8f43671774f754629eda8489946bf09fe4fc
md/raid5: Do not add data_offset before call to is_badblock

commit 6c0544e255dd6582a9899572e120fb55d9f672a4 upstream.

In chunk_aligned_read() we are adding data_offset before calling
is_badblock.  But is_badblock also adds data_offset, so that is bad.

So move the addition of data_offset to after the call to
is_badblock.

This bug was introduced by commit 31c176ecdf3563140e639
     md/raid5: avoid reading from known bad blocks.
which first appeared in 3.0.  So that patch is suitable for any
-stable kernel from 3.0.y onwards.  However it will need minor
revision for most of those (as the comment didn't appear until
recently).

Signed-off-by: majianpeng <majianpeng@gmail.com>
Signed-off-by: NeilBrown <neilb@suse.de>
[bwh: Backported to 3.2: ignored missing comment]
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
drivers/md/raid5.c