mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-04 10:12:16 +09:00
md/raid5: Fix possible confusion when multiple write errors occur.
commit1cc03eb932upstream. commit5d8c71f9e5md: raid5 crash during degradation Fixed a crash in an overly simplistic way which could leave R5_WriteError or R5_MadeGood set in the stripe cache for devices for which it is no longer relevant. When those devices are removed and spares added the flags are still set and can cause incorrect behaviour. commit14a75d3e07md/raid5: preferentially read from replacement device if possible. Fixed the same bug if a more effective way, so we can now revert the original commit. Reported-and-tested-by: Alexander Lyakas <alex.bolshoy@gmail.com> Fixes:5d8c71f9e5Signed-off-by: NeilBrown <neilb@suse.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
ddd618aa9e
commit
c44bc4496d
@@ -3391,7 +3391,7 @@ static void analyse_stripe(struct stripe_head *sh, struct stripe_head_state *s)
|
||||
*/
|
||||
set_bit(R5_Insync, &dev->flags);
|
||||
|
||||
if (rdev && test_bit(R5_WriteError, &dev->flags)) {
|
||||
if (test_bit(R5_WriteError, &dev->flags)) {
|
||||
/* This flag does not apply to '.replacement'
|
||||
* only to .rdev, so make sure to check that*/
|
||||
struct md_rdev *rdev2 = rcu_dereference(
|
||||
@@ -3404,7 +3404,7 @@ static void analyse_stripe(struct stripe_head *sh, struct stripe_head_state *s)
|
||||
} else
|
||||
clear_bit(R5_WriteError, &dev->flags);
|
||||
}
|
||||
if (rdev && test_bit(R5_MadeGood, &dev->flags)) {
|
||||
if (test_bit(R5_MadeGood, &dev->flags)) {
|
||||
/* This flag does not apply to '.replacement'
|
||||
* only to .rdev, so make sure to check that*/
|
||||
struct md_rdev *rdev2 = rcu_dereference(
|
||||
|
||||
Reference in New Issue
Block a user