linux/debian/patches/bugfix/all/fix-a-braino-in-ovl_d_selec...

29 lines
926 B
Diff

From: Al Viro <viro@zeniv.linux.org.uk>
Date: Sun, 12 Jul 2015 10:39:45 -0400
Subject: fix a braino in ovl_d_select_inode()
Origin: https://git.kernel.org/linus/9391dd00d13c853ab4f2a85435288ae2202e0e43
Bug-Debian: https://bugs.debian.org/786925
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>
---
fs/overlayfs/inode.c | 3 +++
1 file changed, 3 insertions(+)
--- a/fs/overlayfs/inode.c
+++ b/fs/overlayfs/inode.c
@@ -344,6 +344,9 @@ static int ovl_dentry_open(struct dentry
enum ovl_path_type type;
bool want_write = false;
+ if (d_is_dir(dentry))
+ return d_backing_inode(dentry);
+
type = ovl_path_real(dentry, &realpath);
if (ovl_open_need_copy_up(file->f_flags, type, realpath.dentry)) {
want_write = true;