Commit aaf19f12 authored by Al Viro's avatar Al Viro Committed by Greg Kroah-Hartman

fix a braino in ovl_d_select_inode()

commit 9391dd00 upstream.

when opening a directory we want the overlayfs inode, not one from
the topmost layer.
Reported-By: default avatarAndrey Jr. Melnikov <temnota.am@gmail.com>
Tested-By: default avatarAndrey Jr. Melnikov <temnota.am@gmail.com>
Signed-off-by: default avatarAl Viro <viro@zeniv.linux.org.uk>
Cc: "Kamata, Munehisa" <kamatam@amazon.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 9abb3b81
......@@ -342,6 +342,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);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment