Skip to content
Commit aff69d89 authored by bingjingc's avatar bingjingc Committed by Shaohua Li
Browse files

md/raid5: correct degraded calculation in raid5_error



When disk failure occurs on new disks for reshape, mddev->degraded
is not calculated correctly. Faulty bit of the failure device is not
set before raid5_calc_degraded(conf).

mdadm --create /dev/md0 --level=5 --raid-devices=3 /dev/loop[012]
mdadm /dev/md0 -a /dev/loop3
mdadm /dev/md0 --grow -n4
mdadm /dev/md0 -f /dev/loop3 # simulating disk failure

cat /sys/block/md0/md/degraded # it outputs 0, but it should be 1.

However, mdadm -D /dev/md0 will show that it is degraded. It's a bug.
It can be fixed by moving the resources raid5_calc_degraded() depends
on before it.

Reported-by: default avatarRoy Chung <roychung@synology.com>
Reviewed-by: default avatarAlex Wu <alexwu@synology.com>
Signed-off-by: default avatarBingJing Chang <bingjingc@synology.com>
Signed-off-by: default avatarShaohua Li <shli@fb.com>
parent a0651c7f
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment