All of lore.kernel.org
 help / color / mirror / Atom feed
From: Eryu Guan <eguan@redhat.com>
To: fstests@vger.kernel.org
Cc: linux-ext4@vger.kernel.org, Eryu Guan <eguan@redhat.com>
Subject: [PATCH 1/2] common: make _dmerror_init accept device and mount point as param
Date: Fri, 11 Mar 2016 23:40:21 +0800	[thread overview]
Message-ID: <1457710822-30532-1-git-send-email-eguan@redhat.com> (raw)

Currently dmerror code takes use of SCRATCH_DEV and SCRATCH_MNT as the
backend device and mount point, and there's no way to change them.

Now teach _dmerror_init to accept first argument as backend device and
second argument as the alternative mount point, this can be useful when
SCRATCH_DEV and/or SCRATCH_MNT is not suitable for the test.

Signed-off-by: Eryu Guan <eguan@redhat.com>
---
 common/dmerror | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/common/dmerror b/common/dmerror
index 004530d..b2f1e8f 100644
--- a/common/dmerror
+++ b/common/dmerror
@@ -20,7 +20,8 @@
 
 _dmerror_init()
 {
-	local dm_backing_dev=$SCRATCH_DEV
+	local dm_backing_dev=${1:-$SCRATCH_DEV}
+	DMERROR_MNT=${2:-$SCRATCH_MNT}
 
 	$DMSETUP_PROG remove error-test > /dev/null 2>&1
 
@@ -38,7 +39,7 @@ _dmerror_init()
 
 _dmerror_mount_options()
 {
-	echo `_common_dev_mount_options $*` $DMERROR_DEV $SCRATCH_MNT
+	echo `_common_dev_mount_options $*` $DMERROR_DEV $DMERROR_MNT
 }
 
 _dmerror_mount()
@@ -48,12 +49,12 @@ _dmerror_mount()
 
 _dmerror_unmount()
 {
-	umount $SCRATCH_MNT
+	umount $DMERROR_MNT
 }
 
 _dmerror_cleanup()
 {
-	$UMOUNT_PROG $SCRATCH_MNT > /dev/null 2>&1
+	$UMOUNT_PROG $DMERROR_MNT > /dev/null 2>&1
 	$DMSETUP_PROG remove error-test > /dev/null 2>&1
 }
 
-- 
2.5.0


             reply	other threads:[~2016-03-11 15:41 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-03-11 15:40 Eryu Guan [this message]
2016-03-11 15:40 ` [PATCH 2/2] generic: test I/O on dm error device Eryu Guan
2016-03-15  2:46   ` Dave Chinner
2016-03-15  8:02     ` Eryu Guan
2016-03-15  8:12   ` [PATCH v2] " Eryu Guan
2016-03-23  2:53     ` Dave Chinner
2016-03-23  3:25       ` Eryu Guan
2016-03-23  4:14         ` Eryu Guan
2016-03-23  4:18   ` [PATCH v3] " Eryu Guan
2016-03-23  6:01     ` Dave Chinner

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=1457710822-30532-1-git-send-email-eguan@redhat.com \
    --to=eguan@redhat.com \
    --cc=fstests@vger.kernel.org \
    --cc=linux-ext4@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.