linux-unionfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Amir Goldstein <amir73il@gmail.com>
To: Vivek Goyal <vgoyal@redhat.com>
Cc: Sargun Dhillon <sargun@sargun.me>,
	overlayfs <linux-unionfs@vger.kernel.org>,
	Miklos Szeredi <miklos@szeredi.hu>,
	Alexander Viro <viro@zeniv.linux.org.uk>,
	Giuseppe Scrivano <gscrivan@redhat.com>,
	Daniel J Walsh <dwalsh@redhat.com>,
	linux-fsdevel <linux-fsdevel@vger.kernel.org>,
	David Howells <dhowells@redhat.com>,
	Chengguang Xu <cgxu519@mykernel.net>,
	Christoph Hellwig <hch@lst.de>, NeilBrown <neilb@suse.com>,
	Jan Kara <jack@suse.cz>, Jeff Layton <jlayton@redhat.com>,
	Matthew Wilcox <willy@infradead.org>
Subject: Re: [PATCH v3] overlay: Implement volatile-specific fsync error behaviour
Date: Thu, 7 Jan 2021 16:44:19 +0200	[thread overview]
Message-ID: <CAOQ4uxjdPkO1OEOFBdgS1ps0GzBrN1jCF5zFkAoLeCJEtkALwg@mail.gmail.com> (raw)
In-Reply-To: <20210107134456.GA3439@redhat.com>

On Thu, Jan 7, 2021 at 3:45 PM Vivek Goyal <vgoyal@redhat.com> wrote:
>
> On Thu, Jan 07, 2021 at 09:02:00AM +0200, Amir Goldstein wrote:
> > On Wed, Jan 6, 2021 at 9:47 PM Vivek Goyal <vgoyal@redhat.com> wrote:
> > >
> > > On Wed, Jan 06, 2021 at 12:35:46AM -0800, Sargun Dhillon wrote:
> > > > Overlayfs's volatile option allows the user to bypass all forced sync calls
> > > > to the upperdir filesystem. This comes at the cost of safety. We can never
> > > > ensure that the user's data is intact, but we can make a best effort to
> > > > expose whether or not the data is likely to be in a bad state.
> > > >
> > > > The best way to handle this in the time being is that if an overlayfs's
> > > > upperdir experiences an error after a volatile mount occurs, that error
> > > > will be returned on fsync, fdatasync, sync, and syncfs. This is
> > > > contradictory to the traditional behaviour of VFS which fails the call
> > > > once, and only raises an error if a subsequent fsync error has occurred,
> > > > and been raised by the filesystem.
> > > >
> > > > One awkward aspect of the patch is that we have to manually set the
> > > > superblock's errseq_t after the sync_fs callback as opposed to just
> > > > returning an error from syncfs. This is because the call chain looks
> > > > something like this:
> > > >
> > > > sys_syncfs ->
> > > >       sync_filesystem ->
> > > >               __sync_filesystem ->
> > > >                       /* The return value is ignored here
> > > >                       sb->s_op->sync_fs(sb)
> > > >                       _sync_blockdev
> > > >               /* Where the VFS fetches the error to raise to userspace */
> > > >               errseq_check_and_advance
> > > >
> > > > Because of this we call errseq_set every time the sync_fs callback occurs.
> > >
> > > Why not start capturing return code of ->sync_fs and then return error
> > > from ovl->sync_fs. And then you don't have to do errseq_set(ovl_sb).
> > >
> > > I already posted a patch to capture retrun code from ->sync_fs.
> > >
> > > https://lore.kernel.org/linux-fsdevel/20201221195055.35295-2-vgoyal@redhat.com/
> > >
> > >
> >
> > Vivek,
> >
> > IMO the more important question is "Why not?".
> >
> > Your patches will undoubtedly get to mainline in the near future and they do
> > make the errseq_set(ovl_sb) in this patch a bit redundant,
>
> I thought my patch of capturing ->sync_fs is really simple (just few
> lines), so backportability should not be an issue. That's why I
> asked for it.
>

Apologies. I thought you meant your entire patch set.
I do agree to that. In fact, I think I suggested it myself at one
point or another.

> > but I really see no
> > harm in it. It is very simple for you to remove this line in your patch.
> > I do see the big benefit of an independent patch that is easy to apply to fix
> > a fresh v5.10 feature.
> >
> > I think it is easy for people to dismiss the importance of "syncfs on volatile"
> > which sounds like a contradiction, but it is not.
> > The fact that the current behavior is documented doesn't make it right either.
> > It just makes our review wrong.
> > The durability guarantee (that volatile does not provide) is very different
> > from the "reliability" guarantee that it CAN provide.
> > We do not want to have to explain to people that "volatile" provided different
> > guarantees depending on the kernel they are running.
> > Fixing syncfs/fsync of volatile is much more important IMO than erroring
> > on other fs ops post writeback error, because other fs ops are equally
> > unreliable on any filesystem in case application did not do fsync.
> >
> > Ignoring the factor of "backporting cost" when there is no engineering
> > justification to do so is just ignoring the pain of others.
> > Do you have an engineering argument for objecting this patch is
> > applied before your fixes to syncfs vfs API?
>
> Carrying ->sync_fs return code patch is definitely not a blocker. It
> is just nice to have. Anyway, I you don't want to carry that ->sync_fs
> return patch in stable, I am fine with this patch. I will follow up
> on that fix separately.
>

Please collaborate with Sargun.
I think it is best if one of you will post those two patches in the same
series. I think you had a few minor comments to address, so many
send the final patch version to Sargun to he can test the two patches
together and post them?

Sorry for the confusion.
Too many "the syncfs patch" to juggle.

Thanks,
Amir.

  reply	other threads:[~2021-01-07 14:45 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-06  8:35 [PATCH v3] overlay: Implement volatile-specific fsync error behaviour Sargun Dhillon
2021-01-06  9:34 ` Amir Goldstein
2021-01-06 19:46 ` Vivek Goyal
2021-01-07  3:51   ` Sargun Dhillon
2021-01-07  7:02   ` Amir Goldstein
2021-01-07  8:02     ` Sargun Dhillon
2021-01-07 13:44     ` Vivek Goyal
2021-01-07 14:44       ` Amir Goldstein [this message]
2021-01-07 14:57         ` Vivek Goyal

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=CAOQ4uxjdPkO1OEOFBdgS1ps0GzBrN1jCF5zFkAoLeCJEtkALwg@mail.gmail.com \
    --to=amir73il@gmail.com \
    --cc=cgxu519@mykernel.net \
    --cc=dhowells@redhat.com \
    --cc=dwalsh@redhat.com \
    --cc=gscrivan@redhat.com \
    --cc=hch@lst.de \
    --cc=jack@suse.cz \
    --cc=jlayton@redhat.com \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-unionfs@vger.kernel.org \
    --cc=miklos@szeredi.hu \
    --cc=neilb@suse.com \
    --cc=sargun@sargun.me \
    --cc=vgoyal@redhat.com \
    --cc=viro@zeniv.linux.org.uk \
    --cc=willy@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;
as well as URLs for NNTP newsgroup(s).