All of lore.kernel.org
 help / color / mirror / Atom feed
From: Murphy Zhou <jencce.kernel@gmail.com>
To: "Darrick J. Wong" <darrick.wong@oracle.com>
Cc: Murphy Zhou <jencce.kernel@gmail.com>, fstests@vger.kernel.org
Subject: Re: [PATCH] generic/175, generic/176: cleanup testdir before exit
Date: Thu, 16 Jan 2020 15:45:09 +0800	[thread overview]
Message-ID: <20200116074509.gnfkvvpy2jhahv3n@xzhoux.usersys.redhat.com> (raw)
In-Reply-To: <20200115171923.GG8257@magnolia>

On Wed, Jan 15, 2020 at 09:19:23AM -0800, Darrick J. Wong wrote:
> On Wed, Jan 15, 2020 at 12:21:32PM +0800, Murphy Zhou wrote:
> > On Mon, Jan 13, 2020 at 02:42:03PM -0800, Darrick J. Wong wrote:
> > > On Mon, Jan 13, 2020 at 11:24:09AM +0800, Murphy Zhou wrote:
> > > > Usually the _mkfs helper will cleanup these directories at the
> > > > beginning of testcase. However, when testing on NFS, the cleanup
> > > > could be very slow and it is confusing that: We have already
> > > > started to run generic/176 but we get stuck in _mkfs, cleaning
> > > > up files left by the previous testcase generic/175.
> > > 
> > > Isn't this a general problem with the way nfs handles "mkfs" on scratch
> > > devices?  So you'd want to fix this once by doing the cleanup between
> > > tests instead of playing whackamole with whatever crazy file tests we
> > > think of next?
> > 
> > Hmm, it's hard to tell. Deleting these files at anywhere makes sense.
> > This patch is hardly a "fix", just trying to make it more clear.
> > 
> > > 
> > > > To be clear, cleanup testdir before exit.
> > > > 
> > > > Signed-off-by: Murphy Zhou <jencce.kernel@gmail.com>
> > > > ---
> > > >  tests/generic/175 | 1 +
> > > >  tests/generic/176 | 1 +
> > > >  2 files changed, 2 insertions(+)
> > > > 
> > > > diff --git a/tests/generic/175 b/tests/generic/175
> > > > index 79e5b3d6..bd966a28 100755
> > > > --- a/tests/generic/175
> > > > +++ b/tests/generic/175
> > > > @@ -61,6 +61,7 @@ bytes=$((blks * blksz))
> > > >  echo "reflinking $blks blocks, $bytes bytes" >> "$seqres.full"
> > > >  _reflink_range "$testdir/file1" 0 "$testdir/file2" 0 $bytes >> "$seqres.full"
> > > >  
> > > > +rm -rf $testdir
> > > 
> > > Or put another way, this probably ought to be in _try_wipe_scratch_devs()
> > 
> > That's for devices I believe..
> 
> It exists to zap the scratch devices into enough of a clean state that
> whatever contents a test wrote to the scratch devices cannot easily
> (e.g. mount) leak into the next test.  IOWs, exactly where you'd want
> FSTYP=NFS to delete whatever junk is in the scratch mount.
> 
> Plus then you get a clean nfs scratch mount at the start of each test
> without needing to whackamole each test.
> 
> > Thanks,
> > Murphy
> > 
> > > 
> > > --D
> > > 
> > > >  # success, all done
> > > >  status=0
> > > >  exit
> > > > diff --git a/tests/generic/176 b/tests/generic/176
> > > > index a084578a..bc83762e 100755
> > > > --- a/tests/generic/176
> > > > +++ b/tests/generic/176
> > > > @@ -73,6 +73,7 @@ bytes=$((blocks_needed * blksz))
> > > >  echo "reflinking $((blocks_needed / 2)) blocks, $((bytes / 2)) bytes" >> "$seqres.full"
> > > >  _reflink_range "$testdir/file1" 0 "$testdir/file2" 0 $bytes >> "$seqres.full"
> > > >  
> > > > +rm -rf $testdir
> 
> Also this will massively slow down generic/17[56] on btrfs/XFS
> considering that we don't care about deleting the massively reflinked
> file we created.

Deleting them would be a good testcase to me. After all the tests,
deleting them should not cause any problem, or spending to much
time. Leaving them behind and letting them get formatted by mkfs,
definitely will be faster, but may make potential problems not
discovered.


If you think the deleting will be extremely slow, maybe it's time
to optimize how xfs deleting reflinked files.

Thanks,
Murphy

> 
> --D
> 
> > > >  # success, all done
> > > >  status=0
> > > >  exit
> > > > -- 
> > > > 2.20.1
> > > > 

  reply	other threads:[~2020-01-16  7:45 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-01-13  3:24 [PATCH] generic/175, generic/176: cleanup testdir before exit Murphy Zhou
2020-01-13 22:42 ` Darrick J. Wong
2020-01-15  4:21   ` Murphy Zhou
2020-01-15 17:19     ` Darrick J. Wong
2020-01-16  7:45       ` Murphy Zhou [this message]
2020-01-16 15:52         ` Darrick J. Wong
2020-01-17 10:04           ` Murphy Zhou
2020-07-17  4:40 Murphy Zhou
2020-07-17  5:58 ` Zorro Lang
2020-07-22  3:11   ` Murphy Zhou
2020-07-22  5:16     ` Zorro Lang

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=20200116074509.gnfkvvpy2jhahv3n@xzhoux.usersys.redhat.com \
    --to=jencce.kernel@gmail.com \
    --cc=darrick.wong@oracle.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.