mirror of
https://github.com/FEX-Emu/linux.git
synced 2025-02-06 11:19:56 +00:00
md: raid5 crash during degradation
NULL pointer access causes crash in raid5 module. Signed-off-by: Adam Kwolek <adam.kwolek@intel.com> Signed-off-by: NeilBrown <neilb@suse.de>
This commit is contained in:
parent
9283d8c5af
commit
5d8c71f9e5
@ -3070,7 +3070,7 @@ static void analyse_stripe(struct stripe_head *sh, struct stripe_head_state *s)
|
|||||||
if (sh->sector + STRIPE_SECTORS <= rdev->recovery_offset)
|
if (sh->sector + STRIPE_SECTORS <= rdev->recovery_offset)
|
||||||
set_bit(R5_Insync, &dev->flags);
|
set_bit(R5_Insync, &dev->flags);
|
||||||
}
|
}
|
||||||
if (test_bit(R5_WriteError, &dev->flags)) {
|
if (rdev && test_bit(R5_WriteError, &dev->flags)) {
|
||||||
clear_bit(R5_Insync, &dev->flags);
|
clear_bit(R5_Insync, &dev->flags);
|
||||||
if (!test_bit(Faulty, &rdev->flags)) {
|
if (!test_bit(Faulty, &rdev->flags)) {
|
||||||
s->handle_bad_blocks = 1;
|
s->handle_bad_blocks = 1;
|
||||||
@ -3078,7 +3078,7 @@ static void analyse_stripe(struct stripe_head *sh, struct stripe_head_state *s)
|
|||||||
} else
|
} else
|
||||||
clear_bit(R5_WriteError, &dev->flags);
|
clear_bit(R5_WriteError, &dev->flags);
|
||||||
}
|
}
|
||||||
if (test_bit(R5_MadeGood, &dev->flags)) {
|
if (rdev && test_bit(R5_MadeGood, &dev->flags)) {
|
||||||
if (!test_bit(Faulty, &rdev->flags)) {
|
if (!test_bit(Faulty, &rdev->flags)) {
|
||||||
s->handle_bad_blocks = 1;
|
s->handle_bad_blocks = 1;
|
||||||
atomic_inc(&rdev->nr_pending);
|
atomic_inc(&rdev->nr_pending);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user