[PATCH 4.4 126/137] ovl: root: copy attr

From: Greg Kroah-Hartman
Date: Tue Feb 23 2016 - 23:16:37 EST


4.4-stable review patch. If anyone has any objections, please let me know.

------------------

From: Miklos Szeredi <miklos@xxxxxxxxxx>

commit ed06e069775ad9236087594a1c1667367e983fb5 upstream.

We copy i_uid and i_gid of underlying inode into overlayfs inode. Except
for the root inode.

Fix this omission.

Signed-off-by: Miklos Szeredi <miklos@xxxxxxxxxx>
Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx>

---
fs/overlayfs/super.c | 3 +++
1 file changed, 3 insertions(+)

--- a/fs/overlayfs/super.c
+++ b/fs/overlayfs/super.c
@@ -1053,6 +1053,9 @@ static int ovl_fill_super(struct super_b

root_dentry->d_fsdata = oe;

+ ovl_copyattr(ovl_dentry_real(root_dentry)->d_inode,
+ root_dentry->d_inode);
+
sb->s_magic = OVERLAYFS_SUPER_MAGIC;
sb->s_op = &ovl_super_operations;
sb->s_root = root_dentry;