linux-raid.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Yu Kuai <yukuai1@huaweicloud.com>
To: linux-raid@vger.kernel.org, mariusz.tkaczyk@linux.intel.com,
	jes@trained-monkey.org, pmenzel@molgen.mpg.de,
	logang@deltatee.com, song@kernel.org, guoqing.jiang@linux.dev
Cc: yukuai3@huawei.com, yangerkun@huawei.com, yi.zhang@huawei.com
Subject: [PATCH v2 7/8] tests: add a regression test that reshape can corrupt data
Date: Mon, 29 May 2023 21:28:25 +0800	[thread overview]
Message-ID: <20230529132826.2125392-8-yukuai1@huaweicloud.com> (raw)
In-Reply-To: <20230529132826.2125392-1-yukuai1@huaweicloud.com>

From: Yu Kuai <yukuai3@huawei.com>

This is a regression test for commit 1544e95c6dd8 ("md: fix data
corruption for raid456 when reshape restart while grow up").

Signed-off-by: Yu Kuai <yukuai3@huawei.com>
---
 tests/25raid456-reshape-corrupt-data | 35 ++++++++++++++++++++++++++++
 1 file changed, 35 insertions(+)
 create mode 100644 tests/25raid456-reshape-corrupt-data

diff --git a/tests/25raid456-reshape-corrupt-data b/tests/25raid456-reshape-corrupt-data
new file mode 100644
index 00000000..fdb875fb
--- /dev/null
+++ b/tests/25raid456-reshape-corrupt-data
@@ -0,0 +1,35 @@
+devs="$dev0 $dev1 $dev2"
+
+set_up_test()
+{
+	mdadm -Cv -R -n 3 -l5 $md0 $devs --size=50M || die "create array failed"
+	mdadm -a $md0 $dev3 || die "failed to bind new disk to array"
+	mkfs.xfs -f $md0 || die "mkfs failed"
+	xfs_ncheck $md0 || die "check fs failed"
+}
+
+clean_up_test()
+{
+	mdadm -S $md0
+}
+
+trap 'clean_up_test' EXIT
+
+set_up_test || die "set up test failed"
+
+# trigger reshape
+echo 1000 > /sys/block/md0/md/sync_speed_max
+mdadm --grow -l 6 $md0
+sleep 1
+
+# stop and start reshape
+echo frozen > /sys/block/md0/md/sync_action
+echo system > /sys/block/md0/md/sync_speed_max
+echo reshape > /sys/block/md0/md/sync_action
+
+mdadm -W $md0
+
+# check if data is corrupted
+xfs_ncheck $md0 || die "data is corrupted after reshape"
+
+exit 0
-- 
2.39.2


  parent reply	other threads:[~2023-05-29 13:32 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-05-29 13:28 [PATCH tests v2 0/8] tests: add some regression tests Yu Kuai
2023-05-29 13:28 ` [PATCH v2 1/8] tests: add a new test for rdev lifetime Yu Kuai
2023-05-29 13:28 ` [PATCH v2 2/8] tests: support to skip checking dmesg Yu Kuai
2023-05-29 13:28 ` [PATCH v2 3/8] tests: add a regression test for raid10 deadlock Yu Kuai
2023-05-29 13:28 ` [PATCH v2 4/8] tests: add a regression test for raid456 deadlock Yu Kuai
2023-05-29 13:28 ` [PATCH v2 5/8] tests: add a regression test that raid456 can't assemble Yu Kuai
2023-05-29 13:28 ` [PATCH v2 6/8] tests: add a regression test that raid456 can't assemble again Yu Kuai
2023-05-29 13:28 ` Yu Kuai [this message]
2023-05-29 13:28 ` [PATCH v2 8/8] tests: add a regression test for raid456 deadlock again Yu Kuai
2023-10-26 21:25 ` [PATCH tests v2 0/8] tests: add some regression tests Jes Sorensen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230529132826.2125392-8-yukuai1@huaweicloud.com \
    --to=yukuai1@huaweicloud.com \
    --cc=guoqing.jiang@linux.dev \
    --cc=jes@trained-monkey.org \
    --cc=linux-raid@vger.kernel.org \
    --cc=logang@deltatee.com \
    --cc=mariusz.tkaczyk@linux.intel.com \
    --cc=pmenzel@molgen.mpg.de \
    --cc=song@kernel.org \
    --cc=yangerkun@huawei.com \
    --cc=yi.zhang@huawei.com \
    --cc=yukuai3@huawei.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).