summaryrefslogtreecommitdiff
path: root/fs/overlayfs
diff options
context:
space:
mode:
authorMiklos Szeredi <miklos@szeredi.hu>2015-10-12 16:56:20 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2018-11-10 18:39:20 +0300
commitd255d18a34a8d53ccc4a019dc07e17b6e8cf6bd1 (patch)
tree36f755c722a10510c5d2c8855f45fa40e7481238 /fs/overlayfs
parent61fde28f92ab9a329ef06e0ab3f41269e3930213 (diff)
downloadlinux-d255d18a34a8d53ccc4a019dc07e17b6e8cf6bd1.tar.xz
ovl: fix open in stacked overlay
[ Upstream commit 1c8a47df36d72ace8cf78eb6c228aa0f8027d3c2 ] 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 <miklos@szeredi.hu> Fixes: 4bacc9c9234c ("overlayfs: Make f_path always point to the overlay...") Cc: David Howells <dhowells@redhat.com> Cc: <stable@vger.kernel.org> # v4.2+ Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'fs/overlayfs')
-rw-r--r--fs/overlayfs/inode.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/fs/overlayfs/inode.c b/fs/overlayfs/inode.c
index df5c2853c4e5..a01ec1836a72 100644
--- a/fs/overlayfs/inode.c
+++ b/fs/overlayfs/inode.c
@@ -377,6 +377,9 @@ struct inode *ovl_d_select_inode(struct dentry *dentry, unsigned file_flags)
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);
}