mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Miklos Szeredi <miklos@szeredi.hu>
To: Alban Crequy <alban.crequy@gmail.com>
Cc: "David Howells" <dhowells@redhat.com>,
	sds@tycho.nsa.gov, "Alexander Viro" <viro@zeniv.linux.org.uk>,
	linux-fsdevel@vger.kernel.org,
	LSM <linux-security-module@vger.kernel.org>,
	linux-unionfs@vger.kernel.org,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"Iago López Galeiras" <iaguis@gmail.com>
Subject: Re: overlayfs: regression bug from 4bacc9c9 (Make f_path always point to the overlay and f_inode to the underlay)
Date: Mon, 12 Oct 2015 15:50:05 +0200	[thread overview]
Message-ID: <20151012135005.GA10697@tucsk> (raw)
In-Reply-To: <CAMXgnP7G-6bOu==DC_q2iQkfQ5p3YjSM8j1t=d-RbHBh-V9rOA@mail.gmail.com>

On Wed, Oct 07, 2015 at 02:23:23PM +0200, Alban Crequy wrote:
> Hi,
> 
> I'm reporting an issue in overlay fs that was introduced in v4.2 (it
> worked on v4.1): when overlay fs is mounted inside a overlay fs, I get
> a "no such device or address" error (ENXIO) during open(). After
> adding some debug printks, I found that the ENXIO comes from
> fs/inode.c:no_open().
> 
> The bug was initially reported on:
> https://github.com/coreos/rkt/issues/1537
> 
> The following commands can reproduce the issue:

Thanks for the excellent report.

See below for a fix.  Please let me know if you see any issues.

Thanks,
Miklos
---

Subject: ovl: fix open in stacked overlay
From: Miklos Szeredi <mszeredi@suse.cz>

If two overlayfs filesystems are stacked on top of each other, then we need
recursion in ovl_d_select_inode().

I guess d_backing_inode() is supposed to do that.  But currently it doesn't
and that functionality is open coded in vfs_open().  This is now copied
into ovl_d_select_inode() to fix this regression.

Reported-by: Alban Crequy <alban.crequy@gmail.com>
Signed-off-by: Miklos Szeredi <mszeredi@suse.cz>
Fixes: 4bacc9c9234c ("overlayfs: Make f_path always point to the overlay...")
Cc: David Howells <dhowells@redhat.com>
Cc: <stable@vger.kernel.org> # v4.2+
---
 fs/overlayfs/inode.c |    3 +++
 1 file changed, 3 insertions(+)

--- a/fs/overlayfs/inode.c
+++ b/fs/overlayfs/inode.c
@@ -363,6 +363,9 @@ struct inode *ovl_d_select_inode(struct
 		ovl_path_upper(dentry, &realpath);
 	}
 
+	if (realpath.dentry->d_flags & DCACHE_OP_SELECT_INODE)
+		return realpath.dentry->d_op->d_select_inode(realpath.dentry, file_flags);
+
 	return d_backing_inode(realpath.dentry);
 }
 

  reply	other threads:[~2015-10-12 13:48 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-10-07 12:23 Alban Crequy
2015-10-12 13:50 ` Miklos Szeredi [this message]
2015-10-14 14:47   ` Alban Crequy

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=20151012135005.GA10697@tucsk \
    --to=miklos@szeredi.hu \
    --cc=alban.crequy@gmail.com \
    --cc=dhowells@redhat.com \
    --cc=iaguis@gmail.com \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-security-module@vger.kernel.org \
    --cc=linux-unionfs@vger.kernel.org \
    --cc=sds@tycho.nsa.gov \
    --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

all inboxes | Powered by JetHome®