Skip to contentSkip to conversation

Add RAID 1 chunksize test

PATCH In review Mateusz Kusiak 4 participants 4 messages Apr 4, 2022 – Apr 7, 2022 MD RAID

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Add RAID 1 chunksize test

Specifying chunksize for raid 1 is forbidden. Add test for blocking raid 1 creation with chunksize.

---
 tests/01r1create-chunk | 15 +++++++++++++++
 1 file changed, 15 insertions(+)
 create mode 100644 tests/01r1create-chunk
tests/01r1create-chunk new file +15 -0
new file mode 100644
index 00000000..717a5e5a
@@ -0,0 +1,15 @@
+# RAID 1 volume, 2 disks, chunk 64
+# NEGATIVE test - creating raid 1 with chunksize specified is forbidden
+
+num_disks=2
+level=1
+device_list="$dev0 $dev1"
+chunk=64
+
+# Create raid 1 with chunk 64k and fail
+if ! mdadm --create --run $md0 --auto=md --level=$level --chunk=$chunk --raid-disks=$num_disks $device_list
+then
+	exit 0
+fi
+
+exit 1
Signature · 1 line
2.26.2
#1 lore raw
Quoted 27 lines · Mateusz Kusiak

Specifying chunksize for raid 1 is forbidden. Add test for blocking raid 1 creation with chunksize.

---
 tests/01r1create-chunk | 15 +++++++++++++++

 1 file changed, 15 insertions(+)

 create mode 100644 tests/01r1create-chunk

tests/01r1create-chunk new file +2 -0
new file mode 100644
index 00000000..717a5e5a
@@ -0,0 +1,15 @@
+# RAID 1 volume, 2 disks, chunk 64
+# NEGATIVE test - creating raid 1 with chunksize specified is

forbidden

tests/01r1create-chunk new file +8 -0
+
+num_disks=2
+level=1
+device_list="$dev0 $dev1"
+chunk=64
+
+# Create raid 1 with chunk 64k and fail
+if ! mdadm --create --run $md0 --auto=md --level=$level --

chunk=$chunk --raid-disks=$num_disks $device_list

tests/01r1create-chunk line 15

Quoted 5 lines
tests/01r1create-chunk new file +5 -0
+then
+       exit 0
+fi
+
+exit 1

This is a case of overkill IMO. Chunk size with raid1 isn't really a problem and shouldn't result in mdadm refusing to work. Chunk size with raid1 simply has no effect and should just be ignored with at most a warning by mdadm.

Signature · 3 lines
Doug Ledford <[email protected]>
    GPG KeyID: B826A3330E572FDD
    Fingerprint = AE6B 1BDA 122B 23B4 265B  1274 B826 A333 0E57 2FDD
#2 lore raw
Quoted 30 lines · Doug Ledford
Quoted 29 lines · Mateusz Kusiak

Specifying chunksize for raid 1 is forbidden. Add test for blocking raid 1 creation with chunksize.

---
 tests/01r1create-chunk | 15 +++++++++++++++

 1 file changed, 15 insertions(+)

 create mode 100644 tests/01r1create-chunk

tests/01r1create-chunk new file +2 -0
new file mode 100644
index 00000000..717a5e5a
@@ -0,0 +1,15 @@
+# RAID 1 volume, 2 disks, chunk 64
+# NEGATIVE test - creating raid 1 with chunksize specified is

forbidden

tests/01r1create-chunk new file +8 -0
+
+num_disks=2
+level=1
+device_list="$dev0 $dev1"
+chunk=64
+
+# Create raid 1 with chunk 64k and fail
+if ! mdadm --create --run $md0 --auto=md --level=$level --

chunk=$chunk --raid-disks=$num_disks $device_list
+then
+       exit 0

Quoted 8 lines

tests/01r1create-chunk line 15

Quoted 3 lines
tests/01r1create-chunk new file +3 -0
+fi
+
+exit 1

This is a case of overkill IMO. Chunk size with raid1 isn't really a problem and shouldn't result in mdadm refusing to work. Chunk size with raid1 simply has no effect and should just be ignored with at most a warning by mdadm.

I agree with Doug here. I think a warning from mdadm that chunksize makes no sense for raid1 would be good, but having a failed test over it makes little sense. If anything the test should detect the warning is happening.

Thanks,
Jes

#3 lore raw
Quoted 40 lines · On Wed, 6 Apr 2022 12:46:03 -0400 Jes Sorensen <[email protected]> wrote:
Quoted 30 lines · Doug Ledford
Quoted 29 lines · Mateusz Kusiak

Specifying chunksize for raid 1 is forbidden. Add test for blocking raid 1 creation with chunksize.

---
 tests/01r1create-chunk | 15 +++++++++++++++

 1 file changed, 15 insertions(+)

 create mode 100644 tests/01r1create-chunk

tests/01r1create-chunk new file +2 -0
new file mode 100644
index 00000000..717a5e5a
@@ -0,0 +1,15 @@
+# RAID 1 volume, 2 disks, chunk 64
+# NEGATIVE test - creating raid 1 with chunksize specified is

forbidden

tests/01r1create-chunk new file +8 -0
+
+num_disks=2
+level=1
+device_list="$dev0 $dev1"
+chunk=64
+
+# Create raid 1 with chunk 64k and fail
+if ! mdadm --create --run $md0 --auto=md --level=$level --

chunk=$chunk --raid-disks=$num_disks $device_list
+then
+       exit 0

Quoted 8 lines

tests/01r1create-chunk line 15

Quoted 3 lines
tests/01r1create-chunk new file +3 -0
+fi
+
+exit 1  

This is a case of overkill IMO. Chunk size with raid1 isn't really a problem and shouldn't result in mdadm refusing to work. Chunk size with raid1 simply has no effect and should just be ignored with at most a warning by mdadm.

Quoted 5 lines

I agree with Doug here. I think a warning from mdadm that chunksize makes no sense for raid1 would be good, but having a failed test over it makes little sense. If anything the test should detect the warning is happening.

Ideally, chunk parameter for RAID1 should not be recognized, because it is not an option. For that reason I'm closer to say that we shouldn't continue if chunk is passed. It helps to limit abuses from less experienced users.

Jes, you asked for this test:
https://lore.kernel.org/linux-raid/[email protected]/

Thanks,
Mariusz