summaryrefslogtreecommitdiffstats
path: root/tests/func.sh
diff options
context:
space:
mode:
authorBingJing Chang <bingjingc@synology.com>2018-02-22 08:00:28 +0100
committerJes Sorensen <jsorensen@fb.com>2018-02-23 17:05:00 +0100
commit62f1aee7ada5e752bda0448b2003a64b31cad5af (patch)
tree1bee9348f52d7e5e8c143765bee8d90670607e64 /tests/func.sh
parentimsm: update product name in error message (diff)
downloadmdadm-62f1aee7ada5e752bda0448b2003a64b31cad5af.tar.xz
mdadm-62f1aee7ada5e752bda0448b2003a64b31cad5af.zip
mdadm: prevent out-of-date reshaping devices from force assemble
With "--force", we can assemble the array even if some superblocks appear out-of-date. But their data layout is regarded to make sense. In reshape cases, if two devices claims different reshape progresses, we cannot forcely assemble them back to array. Kernel will treat only one of them as reshape progress. However, their data is still laid on different layouts. It may lead to disaster if reshape goes on. Reproducible Steps: mdadm -C /dev/md0 --assume-clean -l5 -n3 /dev/loop[012] mdadm -a /dev/md0 /dev/loop3 mdadm -G /dev/md0 -n4 mdadm -f /dev/md0 /dev/loop0 # after a period mdadm -S /dev/md0 # after another period mdadm -E /dev/loop[01] # make sure that they claims different ones mdadm -Af -R /dev/md0 /dev/loop[023] # give no enough devices for force_array() to pick non-fresh devices cat /sys/block/md0/md/reshape_position # You can see that Kernel resume reshape the from any progress of them. Note: The unit of mdadm -E is KB, but reshape_position's is sector. In order to prevent disaster, we add logics to prevent devices with different reshape progress from being added into the array. Reported-by: Allen Peng <allenpeng@synology.com> Reviewed-by: Alex Wu <alexwu@synology.com> Signed-off-by: BingJing Chang <bingjingc@synology.com> Signed-off-by: Jes Sorensen <jsorensen@fb.com>
Diffstat (limited to 'tests/func.sh')
0 files changed, 0 insertions, 0 deletions