-
由 BingJing Chang 提交于
During assemble, the spare marked for replacement is not checked. conf->fullsync cannot be updated to be 1. As a result, recovery will treat it as a clean array. All recovering sectors are skipped. Original device is replaced with the not-recovered spare. mdadm -C /dev/md0 -l10 -n4 -pn2 /dev/loop[0123] mdadm /dev/md0 -a /dev/loop4 mdadm /dev/md0 --replace /dev/loop0 mdadm -S /dev/md0 # stop array during recovery mdadm -A /dev/md0 /dev/loop[01234] After reassemble, you can see recovery go on, but it completes immediately. In fact, recovery is not actually processed. To solve this problem, we just add the missing logics for replacment spares. (In raid1.c or raid5.c, they have already been checked.) Reported-by: NAlex Chen <alexchen@synology.com> Reviewed-by: NAlex Wu <alexwu@synology.com> Reviewed-by: NChung-Chiang Cheng <cccheng@synology.com> Signed-off-by: NBingJing Chang <bingjingc@synology.com> Signed-off-by: NShaohua Li <shli@fb.com>
bda31539