ovl: copyattr after setting POSIX ACL
authorMiklos Szeredi <mszeredi@redhat.com>
Thu, 1 Sep 2016 09:12:00 +0000 (11:12 +0200)
committerMiklos Szeredi <mszeredi@redhat.com>
Thu, 1 Sep 2016 09:12:00 +0000 (11:12 +0200)
Setting POSIX acl may also modify the file mode, so need to copy that up to
the overlay inode.

Reported-by: Eryu Guan <eguan@redhat.com>
Fixes: d837a49bd57f ("ovl: fix POSIX ACL setting")
Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
fs/overlayfs/super.c

index 45a2eb0b4693e90c2d2a4060c357d9b192aba99f..cba2c9fea98c4252c59cb5db2dbfcea88283ec5c 100644 (file)
@@ -1018,7 +1018,11 @@ ovl_posix_acl_xattr_set(const struct xattr_handler *handler,
 
        posix_acl_release(acl);
 
-       return ovl_xattr_set(dentry, handler->name, value, size, flags);
+       err = ovl_xattr_set(dentry, handler->name, value, size, flags);
+       if (!err)
+               ovl_copyattr(ovl_inode_real(inode, NULL), inode);
+
+       return err;
 
 out_acl_release:
        posix_acl_release(acl);