diff options
author | gaoyanping <[email protected]> | 2022-06-30 04:38:46 +0800 |
---|---|---|
committer | GitHub <[email protected]> | 2022-06-29 13:38:46 -0700 |
commit | e7d90362e5d5f873e1272519da96780cf00a0e28 (patch) | |
tree | 51ff4412dd70979967fcfeb1175338354debec53 | |
parent | 325096545a47aa01cd5966301ba1f7a6e5eff349 (diff) |
Fix znode group permission different from acl mask
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 #13581
-rw-r--r-- | module/os/linux/zfs/zpl_xattr.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/module/os/linux/zfs/zpl_xattr.c b/module/os/linux/zfs/zpl_xattr.c index c30ce1c98..98378109c 100644 --- a/module/os/linux/zfs/zpl_xattr.c +++ b/module/os/linux/zfs/zpl_xattr.c @@ -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); } @@ -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); @@ -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, |