From: Dave Chinner <david@fromorbit.com>
To: Eryu Guan <eguan@redhat.com>
Cc: Brian Foster <bfoster@redhat.com>, fstests@vger.kernel.org
Subject: Re: [PATCH 1/2] xfstests: support dm-delay to introduce I/O delays
Date: Fri, 1 Jul 2016 11:31:52 +1000 [thread overview]
Message-ID: <20160701013152.GX27480@dastard> (raw)
In-Reply-To: <20160630131922.GC23649@eguan.usersys.redhat.com>
On Thu, Jun 30, 2016 at 09:19:22PM +0800, Eryu Guan wrote:
> On Thu, Jun 30, 2016 at 08:49:33AM -0400, Brian Foster wrote:
> > Add some infrastructure in common/dmdelay to support use of the dm-delay
> > device-mapper module within tests. This is effectively copied from the
> > existing infrastructure in common/dmflakey. This provides the ability to
> > delay I/O. It only supports delaying read I/O as that is all that is
> > required at this point in time.
> >
> > Signed-off-by: Brian Foster <bfoster@redhat.com>
> > ---
> > common/dmdelay | 89 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
> > 1 file changed, 89 insertions(+)
> > create mode 100644 common/dmdelay
> >
> > diff --git a/common/dmdelay b/common/dmdelay
> > new file mode 100644
> > index 0000000..c53e2dd
> > --- /dev/null
> > +++ b/common/dmdelay
> > @@ -0,0 +1,89 @@
> > +##/bin/bash
> > +#
> > +# Copyright (c) 2016 Red Hat, Inc. All Rights Reserved.
> > +#
> > +# This program is free software; you can redistribute it and/or
> > +# modify it under the terms of the GNU General Public License as
> > +# published by the Free Software Foundation.
> > +#
> > +# This program is distributed in the hope that it would be useful,
> > +# but WITHOUT ANY WARRANTY; without even the implied warranty of
> > +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
> > +# GNU General Public License for more details.
> > +#
> > +# You should have received a copy of the GNU General Public License
> > +# along with this program; if not, write the Free Software Foundation,
> > +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
> > +#
> > +#
> > +# common functions for setting up and tearing down a dmdelay device
> > +
> > +DELAY_NONE=0
> > +DELAY_READ=1
> > +
> > +echo $MOUNT_OPTIONS | grep -q dax
> > +if [ $? -eq 0 ]; then
> > + _notrun "Cannot run tests with DAX on dmdelay devices"
> > +fi
> > +
> > +_init_delay()
> > +{
> > + local BLK_DEV_SIZE=`blockdev --getsz $SCRATCH_DEV`
> > + DELAY_DEV=/dev/mapper/delay-test
> > + DELAY_TABLE="0 $BLK_DEV_SIZE delay $SCRATCH_DEV 0 0"
> > + DELAY_TABLE_RDELAY="0 $BLK_DEV_SIZE delay $SCRATCH_DEV 0 10000 $SCRATCH_DEV 0 0"
> > + $DMSETUP_PROG create delay-test --table "$DELAY_TABLE" || \
> > + _fatal "failed to create delay device"
> > + $DMSETUP_PROG mknodes > /dev/null 2>&1
> > +}
> > +
> > +_mount_delay()
> > +{
> > + _scratch_options mount
> > + mount -t $FSTYP $SCRATCH_OPTIONS $MOUNT_OPTIONS $DELAY_DEV $SCRATCH_MNT
>
> I replaced mount with $MOUNT_PROG :)
Shouldn't this also be using _common_dev_mount_options()?, as per
_scratch_mount_options?
Cheers,
Dave.
--
Dave Chinner
david@fromorbit.com
next prev parent reply other threads:[~2016-07-01 1:38 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-06-30 12:49 [PATCH 0/2] xfs: test for readahead use after free panic Brian Foster
2016-06-30 12:49 ` [PATCH 1/2] xfstests: support dm-delay to introduce I/O delays Brian Foster
2016-06-30 13:19 ` Eryu Guan
2016-06-30 13:44 ` Brian Foster
2016-06-30 13:47 ` Eryu Guan
2016-07-01 1:31 ` Dave Chinner [this message]
2016-06-30 12:49 ` [PATCH 2/2] tests/xfs: test for post umount readahead completion panic Brian Foster
2016-06-30 13:20 ` Eryu Guan
2016-07-01 1:40 ` Dave Chinner
2016-07-01 13:03 ` Brian Foster
2016-07-01 13:37 ` Eryu Guan
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=20160701013152.GX27480@dastard \
--to=david@fromorbit.com \
--cc=bfoster@redhat.com \
--cc=eguan@redhat.com \
--cc=fstests@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.