public inbox for fstests@vger.kernel.org
 help / color / mirror / Atom feed
From: Jan Kara <jack@suse.cz>
To: Eryu Guan <eguan@redhat.com>
Cc: Jan Kara <jack@suse.cz>,
	fstests@vger.kernel.org, Toshi Kani <toshi.kani@hpe.com>
Subject: Re: [PATCH] generic/338: Add mmap race test
Date: Thu, 24 Mar 2016 13:13:47 +0100	[thread overview]
Message-ID: <20160324121347.GD4025@quack.suse.cz> (raw)
In-Reply-To: <20160324114934.GU11419@eguan.usersys.redhat.com>

On Thu 24-03-16 19:49:34, Eryu Guan wrote:
> On Wed, Mar 23, 2016 at 02:42:35PM +0100, Jan Kara wrote:
> > Add test which spawns two threads racing to write to file via mmap and
> > checks the result. This is mainly interesting to uncover races in DAX
> > fault handling.
> > 
> > Signed-off-by: Jan Kara <jack@suse.cz>
> > ---
> >  src/Makefile          |   5 +-
> >  src/holetest.c        | 342 ++++++++++++++++++++++++++++++++++++++++++++++++++
> >  tests/generic/338     |  57 +++++++++
> >  tests/generic/338.out |  73 +++++++++++
> >  tests/generic/group   |   1 +
> >  5 files changed, 476 insertions(+), 2 deletions(-)
> >  create mode 100644 src/holetest.c
> >  create mode 100755 tests/generic/338
> >  create mode 100644 tests/generic/338.out
> 
> 338 is taken, 340 is free now :)

OK, will update.

> [snip]
> > +
> > +seq=`basename $0`
> > +seqres=$RESULT_DIR/$seq
> > +echo "QA output created by $seq"
> > +tmp=/tmp/$$
> > +status=1	# failure is the default!
> > +trap "_cleanup; exit \$status" 0 1 2 3 15
> > +
> > +_cleanup()
> > +{
> > +	cd /
> > +	rm -f $tmp.*
> > +}
> > +
> > +# get standard environment and checks
> > +. ./common/rc
> > +
> > +# real QA test starts here
> > +_supported_fs generic
> > +_supported_os Linux
> > +_require_scratch
> 
> Need to make sure "holetest" is built here, and there's a new helper to
> do it now
> 
> _require_test_program "holetest"

OK, thanks.

> And test fails when I tested on ext3/2/NFS/CIFS, because they have no
> fallocate support, so need to test for fallocate support as well
> 
> _require_xfs_io_command "falloc"

Actually, I have modified the test program not to use fallocate(2) but
instead just use posix_fallocate(3). That uses fallocate(2) when available
and falls back to write when not which is what we wanted and using both was
just duplicating effort needlessly. Thanks for review.

								Honza
-- 
Jan Kara <jack@suse.com>
SUSE Labs, CR

      reply	other threads:[~2016-03-24 12:13 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-03-23 13:42 [PATCH] generic/338: Add mmap race test Jan Kara
2016-03-23 21:33 ` Boylston, Brian
2016-03-24 10:48   ` Jan Kara
2016-03-24 11:49 ` Eryu Guan
2016-03-24 12:13   ` Jan Kara [this message]

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=20160324121347.GD4025@quack.suse.cz \
    --to=jack@suse.cz \
    --cc=eguan@redhat.com \
    --cc=fstests@vger.kernel.org \
    --cc=toshi.kani@hpe.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox