summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMiklos Szeredi <mszeredi@redhat.com>2016-09-01 11:12:00 +0200
committerMiklos Szeredi <mszeredi@redhat.com>2016-09-01 11:12:00 +0200
commitce31513a9114f74fe3e9caa6534d201bdac7238d (patch)
tree22e6072f34525b1e0634a2e01f8f5fb9f2c86a1d
parent0e585ccc13b3edbb187fb4f1b7cc9397f17d64a9 (diff)
ovl: copyattr after setting POSIX ACL
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>
-rw-r--r--fs/overlayfs/super.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/fs/overlayfs/super.c b/fs/overlayfs/super.c
index 45a2eb0b4693..cba2c9fea98c 100644
--- a/fs/overlayfs/super.c
+++ b/fs/overlayfs/super.c
@@ -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);