linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Dave Chinner <david@fromorbit.com>
To: Vijay Chidambaram <vijay@cs.utexas.edu>
Cc: Jayashree Mohan <jayashree2912@gmail.com>,
	Amir Goldstein <amir73il@gmail.com>,
	Filipe Manana <fdmanana@kernel.org>,
	fstests <fstests@vger.kernel.org>,
	Linux Btrfs <linux-btrfs@vger.kernel.org>,
	Filipe Manana <fdmanana@suse.com>
Subject: Re: [PATCH] generic: add test for fsync after shrinking truncate and rename
Date: Tue, 19 Mar 2019 12:13:21 +1100	[thread overview]
Message-ID: <20190319011321.GV26298@dastard> (raw)
In-Reply-To: <CAHWVdUWuTXw5=RuJ9eLXZnNGDq_YX0En5EHY1z=-Y6n0MxFFbA@mail.gmail.com>

(Sorry, missed this email and only just noticed it...)

On Fri, Mar 08, 2019 at 09:11:19AM -0600, Vijay Chidambaram wrote:
> On Thu, Mar 7, 2019 at 10:35 PM Dave Chinner <david@fromorbit.com> wrote:
> >
> > On Thu, Mar 07, 2019 at 05:19:51PM -0600, Jayashree Mohan wrote:
> > > Hi Amir,
> > >
> > > > I went back to look at similar fsync tests by Filipe:
> > > > generic/{106,107,335,336,341,342,343,348,498,501,502,509,510,512}
> > > >
> > > > I found some alleged subtle mistakes about SOMC assumptions.
> > > >
> > > > generic/336 does:
> > > > touch $SCRATCH_MNT/a/foo
> > > > ln $SCRATCH_MNT/a/foo $SCRATCH_MNT/b/foo_link
> > > > touch $SCRATCH_MNT/b/bar
> > > > sync
> > > > unlink $SCRATCH_MNT/b/foo_link
> > > > mv $SCRATCH_MNT/b/bar $SCRATCH_MNT/c/
> > > > $XFS_IO_PROG -c "fsync" $SCRATCH_MNT/a/foo
> > >
> > > This is probably what's happening in this particular test :
> > >
> > > SOMC requires:
> > >           fsync(a/foo) must ensure unlink(b/foo_link)  (because they
> > > were linked at some point)
> > >
> > > But what happens is:
> > >            fsync(a/foo)          -->  unlink(b/foo_link)
> > >            unlink(b/foo_link)  -->  fsync(b)
> > >            fsync(b)                 -->  rename goes through
> > >
> > > SOMC should only require that the unlink persists.
> >
> > That's a /fsync/ requirement, not SOMC.
> >
> > SOMC says:
> >
> > "If the rename after the fsync()d unlink is present after recovery,
> > then every metadata operation completed between the unlink and the
> > rename must also be present after recovery."
> 
> Isn't this a bit too broad? That sounds more like total ordering of
> metadata operations rather than SOMC. Shouldn't SOMC say "all
> operations dependent upon the rename should be present after recovery
> if rename is present?"

Yes. I was describing the explicit behaivour to expect in the
context of the given example, in which all the operations between
the unlink and rename were dependent operations. You've just
restated it as the general rule that I applied...

Cheers,

Dave.
-- 
Dave Chinner
david@fromorbit.com

  reply	other threads:[~2019-03-19  1:13 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-03-04 14:06 [PATCH] generic: add test for fsync after shrinking truncate and rename fdmanana
2019-03-04 15:04 ` Amir Goldstein
2019-03-04 15:23   ` Filipe Manana
2019-03-04 17:59     ` Amir Goldstein
2019-03-04 22:30       ` Filipe Manana
2019-03-05  5:59         ` Amir Goldstein
2019-03-05  9:26           ` Filipe Manana
2019-03-05 10:51             ` Amir Goldstein
2019-03-05  0:50   ` Dave Chinner
2019-03-05  1:00     ` Dave Chinner
2019-03-05  1:08       ` Vijay Chidambaram
2019-03-05  5:39     ` Amir Goldstein
2019-03-05 22:33       ` Dave Chinner
2019-03-06  7:51         ` Amir Goldstein
2019-03-06 21:48           ` Dave Chinner
2019-03-07  7:52             ` Amir Goldstein
2019-03-07 23:19               ` Jayashree Mohan
2019-03-08  4:35                 ` Dave Chinner
2019-03-08 15:11                   ` Vijay Chidambaram
2019-03-19  1:13                     ` Dave Chinner [this message]
2019-03-08  3:46               ` Dave Chinner
2019-03-05  9:26 ` [PATCH v2] " fdmanana

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=20190319011321.GV26298@dastard \
    --to=david@fromorbit.com \
    --cc=amir73il@gmail.com \
    --cc=fdmanana@kernel.org \
    --cc=fdmanana@suse.com \
    --cc=fstests@vger.kernel.org \
    --cc=jayashree2912@gmail.com \
    --cc=linux-btrfs@vger.kernel.org \
    --cc=vijay@cs.utexas.edu \
    /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).