summaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2015-07-12 10:39:45 -0400
committerAl Viro <viro@zeniv.linux.org.uk>2015-07-12 11:22:05 -0400
commit9391dd00d13c853ab4f2a85435288ae2202e0e43 (patch)
treec28ba3f1536611aa81b84997be432143e3ccfb35 /fs
parent0a73d0a204a4a04a1e110539c5a524ae51f91d6d (diff)
downloadlinux-stable-9391dd00d13c853ab4f2a85435288ae2202e0e43.tar.gz
linux-stable-9391dd00d13c853ab4f2a85435288ae2202e0e43.tar.bz2
linux-stable-9391dd00d13c853ab4f2a85435288ae2202e0e43.zip
fix a braino in ovl_d_select_inode()
when opening a directory we want the overlayfs inode, not one from the topmost layer. Reported-By: Andrey Jr. Melnikov <temnota.am@gmail.com> Tested-By: Andrey Jr. Melnikov <temnota.am@gmail.com> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs')
-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 f140e3dbfb7b..d9da5a4e9382 100644
--- a/fs/overlayfs/inode.c
+++ b/fs/overlayfs/inode.c
@@ -343,6 +343,9 @@ struct inode *ovl_d_select_inode(struct dentry *dentry, unsigned file_flags)
struct path realpath;
enum ovl_path_type type;
+ if (d_is_dir(dentry))
+ return d_backing_inode(dentry);
+
type = ovl_path_real(dentry, &realpath);
if (ovl_open_need_copy_up(file_flags, type, realpath.dentry)) {
err = ovl_want_write(dentry);