Linux block layer
 help / color / mirror / Atom feed
From: John Garry <john.g.garry@oracle.com>
To: linux-block@vger.kernel.org, shinichiro.kawasaki@wdc.com
Cc: John Garry <john.g.garry@oracle.com>
Subject: [PATCH blktests 7/7] md/rc: test atomic writes for dm-mirror
Date: Fri, 12 Sep 2025 09:57:29 +0000	[thread overview]
Message-ID: <20250912095729.2281934-8-john.g.garry@oracle.com> (raw)
In-Reply-To: <20250912095729.2281934-1-john.g.garry@oracle.com>

Raise the required device size to 16MB, which would be enough to create a
2M mirror array.

Signed-off-by: John Garry <john.g.garry@oracle.com>
---
 tests/md/002     |  2 +-
 tests/md/002.out | 13 +++++++++++++
 tests/md/003     |  2 +-
 tests/md/rc      | 15 ++++++++++++---
 4 files changed, 27 insertions(+), 5 deletions(-)

diff --git a/tests/md/002 b/tests/md/002
index 0470a1b..de3d908 100755
--- a/tests/md/002
+++ b/tests/md/002
@@ -22,7 +22,7 @@ test() {
 		num_tgts=1
 		add_host=4
 		per_host_store=true
-		dev_size_mb=5
+		dev_size_mb=16
 	)
 
 	echo "Running md_atomics_test"
diff --git a/tests/md/002.out b/tests/md/002.out
index cce1b1c..c6628bf 100644
--- a/tests/md/002.out
+++ b/tests/md/002.out
@@ -181,4 +181,17 @@ TEST 9 dm-stripe step 4 - perform a pwritev2 with size of sysfs_atomic_unit_max_
 TEST 10 dm-stripe step 4 - perform a pwritev2 with size of sysfs_atomic_unit_min_bytes with RWF_ATOMIC flag - pwritev2 should fail - pass
 pwrite: Invalid argument
 TEST 11 dm-stripe step 4 - perform a pwritev2 with a size of sysfs_atomic_write_unit_max_bytes - LBS bytes with RWF_ATOMIC flag - pwritev2 should fail - pass
+TEST 1 dm-mirror step 1 - Verify md sysfs atomic attributes matches - pass
+TEST 2 dm-mirror step 1 - Verify sysfs atomic attributes - pass
+TEST 3 dm-mirror step 1 - Verify md sysfs_atomic_write_max is equal to expected_atomic_write_max - pass
+TEST 4 dm-mirror step 1 - Verify sysfs atomic_write_unit_max_bytes =  expected_atomic_write_unit_max - pass
+TEST 5 dm-mirror step 1 - Verify sysfs atomic_write_unit_boundary_bytes = expected atomic_write_unit_boundary_bytes - pass
+TEST 6 dm-mirror step 1 - Verify statx stx_atomic_write_unit_min - pass
+TEST 7 dm-mirror step 1 - Verify statx stx_atomic_write_unit_max - pass
+TEST 8 dm-mirror step 1 - perform a pwritev2 with size of sysfs_atomic_unit_max_bytes with RWF_ATOMIC flag - pwritev2 should fail - pass
+pwrite: Invalid argument
+TEST 9 dm-mirror step 1 - perform a pwritev2 with size of sysfs_atomic_unit_max_bytes + LBS bytes with RWF_ATOMIC flag - pwritev2 should not be succesful - pass
+TEST 10 dm-mirror step 1 - perform a pwritev2 with size of sysfs_atomic_unit_min_bytes with RWF_ATOMIC flag - pwritev2 should fail - pass
+pwrite: Invalid argument
+TEST 11 dm-mirror step 1 - perform a pwritev2 with a size of sysfs_atomic_write_unit_max_bytes - LBS bytes with RWF_ATOMIC flag - pwritev2 should fail - pass
 Test complete
diff --git a/tests/md/003 b/tests/md/003
index 3e97657..453669c 100755
--- a/tests/md/003
+++ b/tests/md/003
@@ -37,7 +37,7 @@ test() {
 		TEST_DEV_SYSFS="${NVME_TEST_DEVS_SYSFS[$i]}"
 		TEST_DEV="${NVME_TEST_DEVS[$i]}"
 		_require_device_support_atomic_writes
-		_require_test_dev_size 5m
+		_require_test_dev_size 16m
 	done
 
 	if [[ $testdev_count -lt 4 ]]; then
diff --git a/tests/md/rc b/tests/md/rc
index da04b4a..677efbf 100644
--- a/tests/md/rc
+++ b/tests/md/rc
@@ -152,7 +152,7 @@ _md_atomics_test() {
 		let raw_atomic_write_boundary=0;
 	fi
 
-	for personality in raid0 raid1 raid10 dm-linear dm-stripe; do
+	for personality in raid0 raid1 raid10 dm-linear dm-stripe dm-mirror; do
 		if [ "$personality" = raid0 ] || [ "$personality" = raid10 ] || \
 		    [ "$personality" = dm-stripe ]
 		then
@@ -218,7 +218,8 @@ _md_atomics_test() {
 				md_dev=$(readlink /dev/md/blktests_md | sed 's|\.\./||')
 			fi
 
-			if [ "$personality" = dm-linear ] || [ "$personality" = dm-stripe ]
+			if [ "$personality" = dm-linear ] || [ "$personality" = dm-stripe ] || \
+				[ "$personality" = dm-mirror ]
 			then
 				pvremove --force /dev/"${dev0}" 2> /dev/null 1>&2
 				pvremove --force /dev/"${dev1}" 2> /dev/null 1>&2
@@ -260,6 +261,13 @@ _md_atomics_test() {
 				md_dev=$(readlink /dev/mapper/blktests_vg00-blktests_lv | sed 's|\.\./||')
 			fi
 
+			if [ "$personality" = dm-mirror ]
+			then
+				echo y | lvm lvcreate --type mirror -m3  -L 2M -n blktests_lv blktests_vg00 2> /dev/null 1>&2
+
+				md_dev=$(readlink /dev/mapper/blktests_vg00-blktests_lv | sed 's|\.\./||')
+			fi
+
 			md_dev_sysfs="/sys/devices/virtual/block/${md_dev}"
 
 			sysfs_logical_block_size=$(< "${md_dev_sysfs}"/queue/logical_block_size)
@@ -431,7 +439,8 @@ _md_atomics_test() {
 				mdadm --zero-superblock /dev/"${dev3}" 2> /dev/null 1>&2
 			fi
 
-			if [ "$personality" = dm-linear ] || [ "$personality" = dm-stripe ]
+			if [ "$personality" = dm-linear ] || [ "$personality" = dm-stripe ] || \
+				[ "$personality" = dm-mirror ]
 			then
 				lvremove --force  /dev/mapper/blktests_vg00-blktests_lv  2> /dev/null 1>&2
 				vgremove --force blktests_vg00 2> /dev/null 1>&2
-- 
2.43.5


  parent reply	other threads:[~2025-09-12  9:58 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-09-12  9:57 [PATCH blktests 0/7] Further stacked device atomic writes testing John Garry
2025-09-12  9:57 ` [PATCH blktests 1/7] common/rc: add _min() John Garry
2025-09-18  4:08   ` Shinichiro Kawasaki
2025-09-18  7:33     ` John Garry
2025-09-12  9:57 ` [PATCH blktests 2/7] md/rc: add _md_atomics_test John Garry
2025-09-18  4:17   ` Shinichiro Kawasaki
2025-09-18  7:36     ` John Garry
2025-09-12  9:57 ` [PATCH blktests 3/7] md/002: convert to use _md_atomics_test John Garry
2025-09-12  9:57 ` [PATCH blktests 4/7] md/003: add NVMe atomic write tests for stacked devices John Garry
2025-09-18  4:27   ` Shinichiro Kawasaki
2025-09-18  7:44     ` John Garry
2025-09-12  9:57 ` [PATCH blktests 5/7] md/rc: test atomic writes for dm-linear John Garry
2025-09-12  9:57 ` [PATCH blktests 6/7] md/rc: test atomic writes for dm-stripe John Garry
2025-09-12  9:57 ` John Garry [this message]
2025-09-16  8:55 ` [PATCH blktests 0/7] Further stacked device atomic writes testing Shinichiro Kawasaki
2025-09-16 10:20   ` John Garry
2025-09-16 11:55     ` John Garry
2025-09-16 12:23       ` Shinichiro Kawasaki
2025-09-16 12:27         ` John Garry
2025-09-17 12:02           ` Shinichiro Kawasaki
2025-09-17 13:12             ` John Garry
2025-09-17 16:22               ` John Garry
2025-09-18  4:36                 ` Shinichiro Kawasaki
2025-09-18  7:48                   ` John Garry
2025-09-18 10:37                     ` Shinichiro Kawasaki

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=20250912095729.2281934-8-john.g.garry@oracle.com \
    --to=john.g.garry@oracle.com \
    --cc=linux-block@vger.kernel.org \
    --cc=shinichiro.kawasaki@wdc.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