Skip to content

Commit

Permalink
Fix znode group permission different from acl mask
Browse files Browse the repository at this point in the history
Zp->z_mode is set at the same time inode->i_mode
is being changed. This has the effect of keeping both
in sync without relying on zfs_znode_update_vfs.

Reviewed-by: Brian Behlendorf <[email protected]>
Signed-off-by: yanping.gao <[email protected]>
Closes openzfs#13581
  • Loading branch information
YanyunGao authored Jun 29, 2022
1 parent 3250965 commit e7d9036
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions module/os/linux/zfs/zpl_xattr.c
Original file line number Diff line number Diff line change
Expand Up @@ -1001,7 +1001,7 @@ zpl_set_acl_impl(struct inode *ip, struct posix_acl *acl, int type)
* the inode to write the Posix mode bits.
*/
if (ip->i_mode != mode) {
ip->i_mode = mode;
ip->i_mode = ITOZ(ip)->z_mode = mode;
ip->i_ctime = current_time(ip);
zfs_mark_inode_dirty(ip);
}
Expand Down Expand Up @@ -1148,7 +1148,7 @@ zpl_init_acl(struct inode *ip, struct inode *dir)
if (IS_ERR(acl))
return (PTR_ERR(acl));
if (!acl) {
ip->i_mode &= ~current_umask();
ITOZ(ip)->z_mode = (ip->i_mode &= ~current_umask());
ip->i_ctime = current_time(ip);
zfs_mark_inode_dirty(ip);
return (0);
Expand All @@ -1167,7 +1167,7 @@ zpl_init_acl(struct inode *ip, struct inode *dir)
mode = ip->i_mode;
error = __posix_acl_create(&acl, GFP_KERNEL, &mode);
if (error >= 0) {
ip->i_mode = mode;
ip->i_mode = ITOZ(ip)->z_mode = mode;
zfs_mark_inode_dirty(ip);
if (error > 0) {
error = zpl_set_acl_impl(ip, acl,
Expand Down

0 comments on commit e7d9036

Please sign in to comment.