All of lore.kernel.org
 help / color / mirror / Atom feed
From: Vivek Goyal <vgoyal@redhat.com>
To: Amir Goldstein <amir73il@gmail.com>
Cc: Miklos Szeredi <miklos@szeredi.hu>,
	overlayfs <linux-unionfs@vger.kernel.org>
Subject: Re: [PATCH] ovl: fix missing upper fs freeze protection on copy up for ioctl
Date: Tue, 22 Jan 2019 13:47:05 -0500	[thread overview]
Message-ID: <20190122184705.GA4759@redhat.com> (raw)
In-Reply-To: <CAOQ4uxjgRfy8QoS61q-HTkFCNnsikgPFLY0CakLXhN3g9HKB-w@mail.gmail.com>

On Tue, Jan 22, 2019 at 07:49:42PM +0200, Amir Goldstein wrote:
> On Tue, Jan 22, 2019 at 6:28 PM Vivek Goyal <vgoyal@redhat.com> wrote:
> >
> > On Tue, Jan 22, 2019 at 07:01:39AM +0200, Amir Goldstein wrote:
> > > Generalize the helper ovl_open_maybe_copy_up() and use it to copy up
> > > file with data before FS_IOC_SETFLAGS ioctl.
> > >
> > > Fixes: dab5ca8fd9dd ("ovl: add lsattr/chattr support")
> > > Cc: <stable@vger.kernel.org> # v4.19
> > > Signed-off-by: Amir Goldstein <amir73il@gmail.com>
> >
> > What upper fs freeze protection you are referring to. I am unable to
> > see it in this new path.
> >
> 
> Changed from calling ovl_copy_up_with_data() to calling
> ovl_maybe_copy_up().
> The former doesn't have ovl_want_write()/ovl_drop_write().
> 
> The FS_IOC_SETFLAGS ioctl is a bit of an odd ball in vfs,
> which probably caused the confusion.
> File may be open O_RDONLY, but ioctl modifies the file.
> VFS does not call mnt_want_write_file() nor lock inode mutex,
> but fs-specific code for  FS_IOC_SETFLAGS does.
> So ovl_ioctl() calls mnt_want_write_file() for the overlay file,
> and fs-specific code calls mnt_want_write_file() for upper fs
> file, but there was no call for ovl_want_write() for copy up
> duration which prevents overlayfs from copying up on a
> frozen upper fs.

Ok, thanks for the explanaiton. I understand it better now.

Acked-by: Vivek Goyal <vgoyal@redhat.com>


Vivek

  reply	other threads:[~2019-01-22 18:47 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-01-22  5:01 [PATCH] ovl: fix missing upper fs freeze protection on copy up for ioctl Amir Goldstein
2019-01-22 16:28 ` Vivek Goyal
2019-01-22 17:49   ` Amir Goldstein
2019-01-22 18:47     ` Vivek Goyal [this message]
2019-03-01  9:29 ` Amir Goldstein
2019-03-27  6:37   ` Amir Goldstein
2019-05-06 11:56     ` Miklos Szeredi

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=20190122184705.GA4759@redhat.com \
    --to=vgoyal@redhat.com \
    --cc=amir73il@gmail.com \
    --cc=linux-unionfs@vger.kernel.org \
    --cc=miklos@szeredi.hu \
    /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.