summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorYu Kuai <yukuai3@huawei.com>2024-12-02 02:59:11 +0100
committerMariusz Tkaczyk <mariusz.tkaczyk@linux.intel.com>2024-12-03 15:55:15 +0100
commite2549acaef6ee461e4eb8ba63723841023ae3fad (patch)
tree48d99989cd5983060339a7fdd04c979aab8638b1 /tests
parenttests/05r1-re-add-nosuper: remove bitmap file test (diff)
downloadmdadm-e2549acaef6ee461e4eb8ba63723841023ae3fad.tar.xz
mdadm-e2549acaef6ee461e4eb8ba63723841023ae3fad.zip
Manage: forbid re-add to the array without metadata
For the build mode or external metadata, re-add is not supported, because it will not trigger full disk recovery, user should add a new disk to the array instead. Also update test/05r1-re-add-nosuper to reflect this. Signed-off-by: Yu Kuai <yukuai3@huawei.com> Signed-off-by: Mariusz Tkaczyk <mariusz.tkaczyk@linux.intel.com>
Diffstat (limited to 'tests')
-rw-r--r--tests/05r1-re-add-nosuper27
1 files changed, 5 insertions, 22 deletions
diff --git a/tests/05r1-re-add-nosuper b/tests/05r1-re-add-nosuper
index a3fa9503..750d7c14 100644
--- a/tests/05r1-re-add-nosuper
+++ b/tests/05r1-re-add-nosuper
@@ -1,7 +1,6 @@
#
-# create a raid1, remove a drive, and readd it.
-# resync should be instant.
-# Then do some IO first. Resync should still be very fast
+# create a raid1 without superblock, remove a drive, and readd it.
+# readd should fail.
#
mdadm -B $md0 -l1 -n2 -d1 $dev1 $dev2
check resync
@@ -12,24 +11,8 @@ sleep 4
mdadm $md0 -f $dev2
sleep 1
mdadm $md0 -r $dev2
-mdadm $md0 --re-add $dev2
-check nosync
+if mdadm $md0 --re-add $dev2; then
+ err "re-add should fail"
+fi
-mdadm $md0 -f $dev2
-sleep 1
-mdadm $md0 -r $dev2
-testdev $md0 1 $size 1
-mdadm $md0 --re-add $dev2
-check wait
-cmp --bytes=$[$mdsize0*1024] $dev1 $dev2
-
-mdadm $md0 -f $dev2; sleep 1
-mdadm $md0 -r $dev2
-if dd if=/dev/zero of=$md0 ; then : ; fi
-blockdev --flushbufs $md0 # make sure writes have been sent
-mdadm $md0 --re-add $dev2
-check recovery
-check wait
-# should BLKFLSBUF and then read $dev1/$dev2...
-cmp --bytes=$[$mdsize0*1024] $file1 $file2
mdadm -S $md0