Skip to content

Commit 5d8c71f

Browse files
akwolekneilbrown
authored andcommitted
md: raid5 crash during degradation
NULL pointer access causes crash in raid5 module. Signed-off-by: Adam Kwolek <[email protected]> Signed-off-by: NeilBrown <[email protected]>
1 parent 9283d8c commit 5d8c71f

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/md/raid5.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3070,15 +3070,15 @@ static void analyse_stripe(struct stripe_head *sh, struct stripe_head_state *s)
30703070
if (sh->sector + STRIPE_SECTORS <= rdev->recovery_offset)
30713071
set_bit(R5_Insync, &dev->flags);
30723072
}
3073-
if (test_bit(R5_WriteError, &dev->flags)) {
3073+
if (rdev && test_bit(R5_WriteError, &dev->flags)) {
30743074
clear_bit(R5_Insync, &dev->flags);
30753075
if (!test_bit(Faulty, &rdev->flags)) {
30763076
s->handle_bad_blocks = 1;
30773077
atomic_inc(&rdev->nr_pending);
30783078
} else
30793079
clear_bit(R5_WriteError, &dev->flags);
30803080
}
3081-
if (test_bit(R5_MadeGood, &dev->flags)) {
3081+
if (rdev && test_bit(R5_MadeGood, &dev->flags)) {
30823082
if (!test_bit(Faulty, &rdev->flags)) {
30833083
s->handle_bad_blocks = 1;
30843084
atomic_inc(&rdev->nr_pending);

0 commit comments

Comments
 (0)