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 <behlendorf1@llnl.gov> Signed-off-by: yanping.gao <yanping.gao@xtaotech.com> Closes #13581
This commit is contained in:
parent
325096545a
commit
e7d90362e5
|
@ -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,
|
||||
|
|
Loading…
Reference in New Issue