fstests.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Darrick J. Wong" <darrick.wong@oracle.com>
To: Yang Xu <xuyang2018.jy@cn.fujitsu.com>
Cc: fstests@vger.kernel.org
Subject: Re: [PATCH] generic/520: use fsync instead of sync during clean_dir
Date: Tue, 17 Dec 2019 14:36:19 -0800	[thread overview]
Message-ID: <20191217223619.GI12766@magnolia> (raw)
In-Reply-To: <8899c91c-1f92-4f49-c994-f04c9a6eb5fd@cn.fujitsu.com>

On Mon, Dec 16, 2019 at 02:24:56PM +0800, Yang Xu wrote:
> 
> 
> on 2019/12/14 4:42, Darrick J. Wong wrote:
> > On Fri, Dec 13, 2019 at 01:45:41PM +0800, Yang Xu wrote:
> > > When I test this case on xfs, it may fail as below:
> > > --------------------------------------------
> > >   === link SCRATCH_MNT/A/foo SCRATCH_MNT/bar  with fsync SCRATCH_MNT/A ===
> > > +umount: /mnt/xfstests/scratch: target is busy.
> > > +        (In some cases useful info about processes that use
> > > +         the device is found by lsof(8) or fuser(1))
> > > ---------------------------------------------
> > > 
> > > I think we don't need to sync all fs and fsync SCRATCH_MNT is enough.
> > > 
> > > Signed-off-by: Yang Xu <xuyang2018.jy@cn.fujitsu.com>
> > > ---
> > >   tests/generic/520 | 2 +-
> > >   1 file changed, 1 insertion(+), 1 deletion(-)
> > > 
> > > diff --git a/tests/generic/520 b/tests/generic/520
> > > index 167d7077..a16467ca 100755
> > > --- a/tests/generic/520
> > > +++ b/tests/generic/520
> > > @@ -58,7 +58,7 @@ clean_dir()
> > >   {
> > >   	_mount_flakey
> > >   	rm -rf $(find $SCRATCH_MNT/* | grep -v "lost+found")
> > > -	sync
> > > +	$XFS_IO_PROG -c "fsync" $SCRATCH_MNT
> > 
> > But that only has to force the scratch mount directory to disk.
> > 
> > Assuming the test authors really meant "write all of the scratch fs'
> > dirty data/metadata to disk", I think you want:
> > 
> >   $XFS_IO_PROG -c syncfs $SCRATCH_MNT
> > 
> > here?
> My xfsprogs version doesn't support syncfs command. Or, we can use fsync to
> make four files(foo bar A/foo A/bar) write to disk?

Hmm, 'sync -f $SCRATCH_MNT' then?

> > Also, why did umount spit out 'target is busy' here?  clean_dir() erases
> > the scratch fs between tests, there shouldn't be anything flakey about
> > that.
> I try to find the cause of this but fail. I debug it but no useful
> output(using  _unmount_flakey  || fuser -uvm $SCRATCH_MNT ), failed as
> below:
> umount: /mnt/xfstests/scratch: target is busy.
>         (In some cases useful info about processes that use
>          the device is found by lsof(8) or fuser(1))
>                      USER        PID ACCESS COMMAND
> /mnt/xfstests/scratch:
>                      root     kernel mount (root)/mnt/xfstests/scratch
> 
> ps: My test machine only excutes this cases and doesn't do other  things.

Does a second umount attempt succeed after the fuser fails to find
anything sitting on the mount?

--D

> > 
> > --D
> > 
> > >   	_unmount_flakey
> > >   }
> > > -- 
> > > 2.18.0
> > > 
> > > 
> > > 
> > 
> > 
> 
> 

  reply	other threads:[~2019-12-17 22:36 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-12-13  5:45 [PATCH] generic/520: use fsync instead of sync during clean_dir Yang Xu
2019-12-13 20:42 ` Darrick J. Wong
2019-12-16  6:24   ` Yang Xu
2019-12-17 22:36     ` Darrick J. Wong [this message]
2019-12-18  2:37       ` Yang Xu
2019-12-19 17:08         ` Darrick J. Wong
2019-12-20  2:48           ` Yang Xu
2019-12-20 12:32 ` Filipe Manana
2019-12-23  5:01   ` Yang Xu

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=20191217223619.GI12766@magnolia \
    --to=darrick.wong@oracle.com \
    --cc=fstests@vger.kernel.org \
    --cc=xuyang2018.jy@cn.fujitsu.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;
as well as URLs for NNTP newsgroup(s).