linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Quentin Casasnovas <quentin.casasnovas@oracle.com>
To: Miklos Szeredi <miklos@szeredi.hu>
Cc: Quentin Casasnovas <quentin.casasnovas@oracle.com>,
	linux-kernel@vger.kernel.org, linux-unionfs@vger.kernel.org,
	Al Viro <viro@zeniv.linux.org.uk>
Subject: Re: [PATCH] ovl: tentative fix for broken vfs_open() on stacked overlayfs.
Date: Mon, 28 Nov 2016 12:06:09 +0100	[thread overview]
Message-ID: <20161128110609.GB27319@chrystal.oracle.com> (raw)
In-Reply-To: <20161128094518.GC2622@veci.piliscsaba.szeredi.hu>

[-- Attachment #1: Type: text/plain, Size: 1401 bytes --]

On Mon, Nov 28, 2016 at 10:45:18AM +0100, Miklos Szeredi wrote:
> On Fri, Nov 25, 2016 at 08:28:47PM +0100, Quentin Casasnovas wrote:
> > On Fri, Nov 25, 2016 at 06:09:23PM +0100, Quentin Casasnovas wrote:
> > > If two overlayfs filesystems are stacked on top of each other, then we need
> > > to recurse when opening a file.  This used to work and was first broken by:
> > > 
> > >   4bacc9c9234c ("overlayfs: Make f_path always point to the overlay...")
> > > 
> > > and fixed by:
> > > 
> > >   1c8a47df36d7 ("ovl: fix open in stacked overlay")
> > > 
> > > But it looks like it was re-introduced in:
> > > 
> > >   2d902671ce1c ("vfs: merge .d_select_inode() into .d_real()")
> 
> 
> Following patch should fix it (it's there in your patch, so you weren't too far
> off).  It needs more testing and review, but I think it fixes the basic problem.
> 
> diff --git a/fs/overlayfs/super.c b/fs/overlayfs/super.c
> index edd46a0e951d..f4d2f63fa53a 100644
> --- a/fs/overlayfs/super.c
> +++ b/fs/overlayfs/super.c
> @@ -328,7 +328,7 @@ static struct dentry *ovl_d_real(struct dentry *dentry,
>  	if (!real)
>  		goto bug;
>  
> -	if (!inode || inode == d_inode(real))
> +	if (inode && inode == d_inode(real))
>  		return real;
>  
>  	/* Handle recursion */

The above patch works for me, thanks!

Tested-by: Quentin Casasnovas <quentin.casasnovas@oracle.com>

Q

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 801 bytes --]

  reply	other threads:[~2016-11-28 11:01 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-11-25 14:56 opening a file on a stacked overlayfs is broken Quentin Casasnovas
2016-11-25 17:09 ` [PATCH] ovl: tentative fix for broken vfs_open() on stacked overlayfs Quentin Casasnovas
2016-11-25 19:28   ` Quentin Casasnovas
2016-11-28  9:45     ` Miklos Szeredi
2016-11-28 11:06       ` Quentin Casasnovas [this message]
2016-11-29  9:32 Miklos Szeredi
2016-11-29 10:03 ` Amir Goldstein
2016-12-01 16:20 ` Quentin Casasnovas

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=20161128110609.GB27319@chrystal.oracle.com \
    --to=quentin.casasnovas@oracle.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-unionfs@vger.kernel.org \
    --cc=miklos@szeredi.hu \
    --cc=viro@zeniv.linux.org.uk \
    /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).