public inbox for fstests@vger.kernel.org
 help / color / mirror / Atom feed
From: "Darrick J. Wong" <darrick.wong@oracle.com>
To: Eryu Guan <guaneryu@gmail.com>
Cc: Christoph Hellwig <hch@infradead.org>, fstests <fstests@vger.kernel.org>
Subject: Re: [PATCH v2] generic: check reflink multiple mmap write
Date: Sun, 13 Oct 2019 09:23:45 -0700	[thread overview]
Message-ID: <20191013162345.GJ13097@magnolia> (raw)
In-Reply-To: <20191013121134.GG2622@desktop>

On Sun, Oct 13, 2019 at 08:11:37PM +0800, Eryu Guan wrote:
> On Fri, Oct 11, 2019 at 02:41:20PM -0700, Darrick J. Wong wrote:
> > From: Darrick J. Wong <darrick.wong@oracle.com>
> > 
> > Add a test to make sure that we can handle multiple memory mappings to a
> > physical storage extent shared by multiple files, and that we can handle
> > the copy on write operation without error.  Make sure we can also handle
> > mappings at different offsets in the page cache.
> > 
> > Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
> > ---
> > v2: test at different offsets
> > ---
> >  src/Makefile                |    2 -
> >  src/mmap-write-concurrent.c |  155 +++++++++++++++++++++++++++++++++++++++++++
> 
> I added an entry in .gitignore file.

Thanks!

<snip>
> > +
> > +# real QA test starts here
> > +_supported_os Linux
> > +_supported_fs generic
> > +_require_command "$FILEFRAG_PROG" filefrag
> 
> Also added
> 
> _require_test_program "mmap-write-concurrent"
> 

> > +echo "mwrite all copies" | tee -a $seqres.full
> > +off=$(( (filesz / 2) - 168 ))
> > +len=337
> > +./src/mmap-write-concurrent $len \
> 
> And used "$here/src/mmap-write-concurrent .." here.

Old habits die hard, I guess. :(  Thanks for fixing those up on
commit...

--D

> Thanks,
> Eryu
> 
> > +		$off $testdir/file1 \
> > +		$off $testdir/file2 \
> > +		$off $testdir/file3 \
> > +		$off $testdir/file4 \
> > +		$((off + blksz)) $testdir/file5 \
> > +		$((off + (blksz * 2))) $testdir/file6 \
> > +		$((off + (blksz * 3))) $testdir/file7 \
> > +		$((off + (blksz * 4))) $testdir/file8 \
> > +		168 $testdir/file1 \
> > +		$((blksz - 168)) $testdir/file2 \
> > +		$((filesz - 777)) $testdir/file3 \
> > +		$(((blksz * 3) - 168)) $testdir/file4 \
> > +
> > +
> > +echo "Compare files before remount" | tee -a $seqres.full
> > +compare
> > +_test_cycle_mount
> > +
> > +echo "Compare files after remount" | tee -a $seqres.full
> > +compare
> > +
> > +echo "Check for non-shared extents" | tee -a $seqres.full
> > +$FILEFRAG_PROG -v $testdir/file1 $testdir/file2 $testdir/file3 $testdir/file4 \
> > +		  $testdir/file5 $testdir/file6 $testdir/file7 $testdir/file8 \
> > +		  | grep '^[[:space:]]*[0-9]*:' > $testdir/fiemap
> > +cat $testdir/fiemap >> $seqres.full
> > +grep -q 'shared' $testdir/fiemap || \
> > +		echo "Expected to find shared extents"
> > +
> > +grep -q -v 'shared' $testdir/fiemap || \
> > +		echo "Expected to find non-shared extents"
> > +
> > +# success, all done
> > +status=0
> > +exit
> > diff --git a/tests/generic/945.out b/tests/generic/945.out
> > new file mode 100644
> > index 00000000..ad1e21ff
> > --- /dev/null
> > +++ b/tests/generic/945.out
> > @@ -0,0 +1,31 @@
> > +QA output created by 945
> > +Create the original files
> > +Compare files before cow
> > +c946b71bb69c07daf25470742c967e7c  TEST_DIR/test-945/file1
> > +c946b71bb69c07daf25470742c967e7c  TEST_DIR/test-945/file2
> > +c946b71bb69c07daf25470742c967e7c  TEST_DIR/test-945/file3
> > +c946b71bb69c07daf25470742c967e7c  TEST_DIR/test-945/file4
> > +74e6b9b1a03fdf09293c089b002800f8  TEST_DIR/test-945/file5
> > +c14f20b97155e3fc11a17532d02ad9df  TEST_DIR/test-945/file6
> > +22eb46e0f4a3742c8d86346845b7bc80  TEST_DIR/test-945/file7
> > +4d292f06cec9d3f1bece4822cd5ef532  TEST_DIR/test-945/file8
> > +mwrite all copies
> > +Compare files before remount
> > +c1b46135a2620ae6da21bbfd4cbb3cba  TEST_DIR/test-945/file1
> > +16f0bc0f97c42d2ad903c519095b8126  TEST_DIR/test-945/file2
> > +eb71e3135ca2abf33bb9081e2b49a876  TEST_DIR/test-945/file3
> > +2678dfcb77bed4dc29e19836bef82e5b  TEST_DIR/test-945/file4
> > +2802d75dbee4f29d62124aa7b473edca  TEST_DIR/test-945/file5
> > +acd58cf3d33ef905e26800a0e049223c  TEST_DIR/test-945/file6
> > +1b68d203e5a1c1b45a9510bedcd1e126  TEST_DIR/test-945/file7
> > +9479709b697ced2e3a57c17bc1b97373  TEST_DIR/test-945/file8
> > +Compare files after remount
> > +c1b46135a2620ae6da21bbfd4cbb3cba  TEST_DIR/test-945/file1
> > +16f0bc0f97c42d2ad903c519095b8126  TEST_DIR/test-945/file2
> > +eb71e3135ca2abf33bb9081e2b49a876  TEST_DIR/test-945/file3
> > +2678dfcb77bed4dc29e19836bef82e5b  TEST_DIR/test-945/file4
> > +2802d75dbee4f29d62124aa7b473edca  TEST_DIR/test-945/file5
> > +acd58cf3d33ef905e26800a0e049223c  TEST_DIR/test-945/file6
> > +1b68d203e5a1c1b45a9510bedcd1e126  TEST_DIR/test-945/file7
> > +9479709b697ced2e3a57c17bc1b97373  TEST_DIR/test-945/file8
> > +Check for non-shared extents
> > diff --git a/tests/generic/group b/tests/generic/group
> > index 4584667f..f77c5b21 100644
> > --- a/tests/generic/group
> > +++ b/tests/generic/group
> > @@ -576,3 +576,4 @@
> >  715 dangerous_norepair
> >  716 dangerous_norepair
> >  720 dangerous_norepair
> > +945 auto quick rw clone

      reply	other threads:[~2019-10-13 16:24 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-10  4:14 [PATCH] generic: check reflink multiple mmap write Darrick J. Wong
2019-10-10  6:49 ` Christoph Hellwig
2019-10-11 21:41 ` [PATCH v2] " Darrick J. Wong
2019-10-13 12:11   ` Eryu Guan
2019-10-13 16:23     ` Darrick J. Wong [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=20191013162345.GJ13097@magnolia \
    --to=darrick.wong@oracle.com \
    --cc=fstests@vger.kernel.org \
    --cc=guaneryu@gmail.com \
    --cc=hch@infradead.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox