All of lore.kernel.org
 help / color / mirror / Atom feed
From: Hou Tao <houtao1@huawei.com>
To: fstests@vger.kernel.org
Cc: guaneryu@gmail.com, linux-xfs@vger.kernel.org,
	darrick.wong@oracle.com, cmaiolino@redhat.com
Subject: [PATCH v4 1/4] dmflakey: support multiple dm targets for a dm-flakey device
Date: Thu, 11 Jan 2018 14:49:30 +0800	[thread overview]
Message-ID: <20180111064933.12088-2-houtao1@huawei.com> (raw)
In-Reply-To: <20180111064933.12088-1-houtao1@huawei.com>

dm-flakey can be used to emulate IO write error, however, when
we also need to prevent the IO error for a specific range of the
block device (eg., the log region of a XFS), we need to specify
multiple dm targets for the dm device.

Option --table can not accommodate the multiple dm targets case,
so let dmsetup get the possible-multiple-targets table from
standard input.

Signed-off-by: Hou Tao <houtao1@huawei.com>
---
v4: add comments for reading dm target table from standard input
---
 common/dmflakey | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/common/dmflakey b/common/dmflakey
index 4434307..e34fce8 100644
--- a/common/dmflakey
+++ b/common/dmflakey
@@ -77,11 +77,14 @@ _load_flakey_table()
 	$DMSETUP_PROG suspend $suspend_opt flakey-test
 	[ $? -ne 0 ] && _fatal "failed to suspend flakey-test"
 
-	$DMSETUP_PROG load flakey-test --table "$table"
+	# There may be multiple dm targets in the table, and these dm targets
+	# will be joined by the newline ("\n"). Option --table can not cope with
+	# the multiple-targets case, so get them by reading from standard input.
+	echo -e "$table" | $DMSETUP_PROG load flakey-test
 	[ $? -ne 0 ] && _fatal "failed to load table into flakey-test"
 
 	$DMSETUP_PROG resume flakey-test
-	[ $? -ne 0 ] && _fatal  "failed to resumeflakey-test"
+	[ $? -ne 0 ] && _fatal  "failed to resume flakey-test"
 }
 
 # Silently drop all writes and unmount/remount to simulate a crash/power
-- 
2.9.5


  reply	other threads:[~2018-01-11  6:42 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-01-11  6:49 [PATCH v4 0/4] test for XFS umount hang caused by the pending dquota log item in AIL Hou Tao
2018-01-11  6:49 ` Hou Tao [this message]
2018-01-11  6:49 ` [PATCH v4 2/4] dmflakey: support error_writes feature for dm-flakey Hou Tao
2018-01-11  6:49 ` [PATCH v4 3/4] xfs: test for umount hang caused by the pending dquota log item in AIL Hou Tao
2018-01-11  6:49 ` [PATCH v4 4/4] common/rc: factor out _scratch_xfs_[get|set]_sb_field Hou Tao
2018-01-11  8:02 ` [PATCH v4 0/4] test for XFS umount hang caused by the pending dquota log item in AIL Eryu Guan
2018-01-11  9:23   ` Hou Tao

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=20180111064933.12088-2-houtao1@huawei.com \
    --to=houtao1@huawei.com \
    --cc=cmaiolino@redhat.com \
    --cc=darrick.wong@oracle.com \
    --cc=fstests@vger.kernel.org \
    --cc=guaneryu@gmail.com \
    --cc=linux-xfs@vger.kernel.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.