Skip to content

Commit aaf19f1

Browse files
Al Virogregkh
authored andcommitted
fix a braino in ovl_d_select_inode()
commit 9391dd0 upstream. when opening a directory we want the overlayfs inode, not one from the topmost layer. Reported-By: Andrey Jr. Melnikov <[email protected]> Tested-By: Andrey Jr. Melnikov <[email protected]> Signed-off-by: Al Viro <[email protected]> Cc: "Kamata, Munehisa" <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent 9abb3b8 commit aaf19f1

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

fs/overlayfs/inode.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -342,6 +342,9 @@ struct inode *ovl_d_select_inode(struct dentry *dentry, unsigned file_flags)
342342
struct path realpath;
343343
enum ovl_path_type type;
344344

345+
if (d_is_dir(dentry))
346+
return d_backing_inode(dentry);
347+
345348
type = ovl_path_real(dentry, &realpath);
346349
if (ovl_open_need_copy_up(file_flags, type, realpath.dentry)) {
347350
err = ovl_want_write(dentry);

0 commit comments

Comments
 (0)