lkml.org 
[lkml]   [2016]   [Nov]   [28]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] ovl: tentative fix for broken vfs_open() on stacked overlayfs.
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
[unhandled content-type:application/pgp-signature]
\
 
 \ /
  Last update: 2016-11-28 12:02    [W:0.132 / U:0.000 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site