Skip to content

Commit 0595f84

Browse files
committed
md/rc: use --run option instead of "echo y"
As explained in the commit 0e7aabe ("md/002: use --run option instead of "echo y""), "echo y" and pipe no longer work with the mdadm command since mdadm version 4.4. The commit fixed this problem. However, when the commit cefc428 ("md/rc: add _md_atomics_test") introduced the helper function _md_atomics_test to factor out the test content in md/002, the fix was not propagated. Then, md/002 and md/003 do not work with mdadm version 4.4 again. Fix it again by using --run option instead of "echo y". Fixes: cefc428 ("md/rc: add _md_atomics_test") Reviewed-by: John Garry <[email protected]> Signed-off-by: Shin'ichiro Kawasaki <[email protected]>
1 parent bf5d3fa commit 0595f84

1 file changed

Lines changed: 7 additions & 7 deletions

File tree

  • tests/md

tests/md/rc

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -201,10 +201,10 @@ _md_atomics_test() {
201201

202202
if [ "$personality" = raid0 ] || [ "$personality" = raid10 ]
203203
then
204-
echo y | mdadm --create /dev/md/blktests_md --level=$personality \
205-
--chunk="${md_chunk_size_kb}"K \
206-
--raid-devices=4 --force /dev/"${dev0}" /dev/"${dev1}" \
207-
/dev/"${dev2}" /dev/"${dev3}" 2> /dev/null 1>&2
204+
mdadm --create /dev/md/blktests_md --level=$personality \
205+
--run --chunk="${md_chunk_size_kb}"K \
206+
--raid-devices=4 --force /dev/"${dev0}" /dev/"${dev1}" \
207+
/dev/"${dev2}" /dev/"${dev3}" 2> /dev/null 1>&2
208208

209209
atomics_boundaries_unit_max=$(_md_atomics_boundaries_max "$raw_atomic_write_boundary" $md_chunk_size "1")
210210
atomics_boundaries_max=$(_md_atomics_boundaries_max "$raw_atomic_write_boundary" "$md_chunk_size" "0")
@@ -220,9 +220,9 @@ _md_atomics_test() {
220220

221221
if [ "$personality" = raid1 ]
222222
then
223-
echo y | mdadm --create /dev/md/blktests_md --level=$personality \
224-
--raid-devices=4 --force /dev/"${dev0}" /dev/"${dev1}" \
225-
/dev/"${dev2}" /dev/"${dev3}" 2> /dev/null 1>&2
223+
mdadm --create /dev/md/blktests_md --level=$personality \
224+
--run --raid-devices=4 --force /dev/"${dev0}" /dev/"${dev1}" \
225+
/dev/"${dev2}" /dev/"${dev3}" 2> /dev/null 1>&2
226226

227227
md_dev=$(readlink /dev/md/blktests_md | sed 's|\.\./||')
228228
fi

0 commit comments

Comments
 (0)