diff options
author | Miklos Szeredi <miklos@szeredi.hu> | 2015-10-12 15:56:20 +0200 |
---|---|---|
committer | Miklos Szeredi <miklos@szeredi.hu> | 2015-10-12 15:56:20 +0200 |
commit | 1c8a47df36d72ace8cf78eb6c228aa0f8027d3c2 (patch) | |
tree | f81ba92bcb7d112277c54c7cba46e82d24b95716 /fs | |
parent | ab79efab0a0ba01a74df782eb7fa44b044dae8b5 (diff) | |
download | blackbird-obmc-linux-1c8a47df36d72ace8cf78eb6c228aa0f8027d3c2.tar.gz blackbird-obmc-linux-1c8a47df36d72ace8cf78eb6c228aa0f8027d3c2.zip |
ovl: fix open in stacked overlay
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+
Diffstat (limited to 'fs')
-rw-r--r-- | fs/overlayfs/inode.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/fs/overlayfs/inode.c b/fs/overlayfs/inode.c index d9da5a4e9382..ec0c2a050043 100644 --- a/fs/overlayfs/inode.c +++ b/fs/overlayfs/inode.c @@ -363,6 +363,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); } |