diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2015-07-12 10:39:45 -0400 |
---|---|---|
committer | Sasha Levin <sasha.levin@oracle.com> | 2015-10-27 22:14:25 -0400 |
commit | d706c400314ac9486012fd52f1efc48e6cb7678a (patch) | |
tree | c176ed57f8a40f833cda33b13009072ea6cd064e /fs | |
parent | e93f29ffbb99d45f718c18832007d0c77091ed54 (diff) | |
download | lwn-d706c400314ac9486012fd52f1efc48e6cb7678a.tar.gz lwn-d706c400314ac9486012fd52f1efc48e6cb7678a.zip |
fix a braino in ovl_d_select_inode()
[ Upstream commit 9391dd00d13c853ab4f2a85435288ae2202e0e43 ]
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>
Signed-off-by: Sasha Levin <sasha.levin@oracle.com>
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 336aeddbacfe..e3903b74a1f2 100644 --- a/fs/overlayfs/inode.c +++ b/fs/overlayfs/inode.c @@ -339,6 +339,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); |