]> git.baikalelectronics.ru Git - kernel.git/commit
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)
committerNeilBrown <neilb@suse.de>
Tue, 3 Jul 2012 02:09:57 +0000 (12:09 +1000)
commit81c0411d6e9e89d1912692c04cf4c867d60dec60
treef77e75815a54c6af1068dceb6ada1eb51d8501ce
parent28c1d6caeb485f447c2bed99170814078959ec3c
md/raid5: Do not add data_offset before call to is_badblock

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 d8a5769d7179c5ee4e4ad
     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).

Cc: stable@vger.kernel.org
Signed-off-by: majianpeng <majianpeng@gmail.com>
Signed-off-by: NeilBrown <neilb@suse.de>
drivers/md/raid5.c