[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20181108215106.712592404@linuxfoundation.org>
Date: Thu, 8 Nov 2018 13:51:31 -0800
From: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
To: linux-kernel@...r.kernel.org
Cc: Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
stable@...r.kernel.org, Alban Crequy <alban.crequy@...il.com>,
Miklos Szeredi <miklos@...redi.hu>,
David Howells <dhowells@...hat.com>,
Sasha Levin <sashal@...nel.org>
Subject: [PATCH 3.18 120/144] ovl: fix open in stacked overlay
3.18-stable review patch. If anyone has any objections, please let me know.
------------------
[ 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@...il.com>
Signed-off-by: Miklos Szeredi <miklos@...redi.hu>
Fixes: 4bacc9c9234c ("overlayfs: Make f_path always point to the overlay...")
Cc: David Howells <dhowells@...hat.com>
Cc: <stable@...r.kernel.org> # v4.2+
Signed-off-by: Sasha Levin <sashal@...nel.org>
---
fs/overlayfs/inode.c | 3 +++
1 file changed, 3 insertions(+)
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);
}
--
2.17.1
Powered by blists - more mailing lists