mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2026-06-06 22:16:38 +03:00
Refactor inode->i_mode management
Refactor the code in such a way so that inode->i_mode is being set at the same time zp->z_mode is being changed. This has the effect of keeping both in sync without relying on zfs_inode_update. Reviewed-by: Richard Laager <rlaager@wiktel.com> Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Signed-off-by: Nikolay Borisov <n.borisov.lkml@gmail.com> Closes #5158
This commit is contained in:
committed by
Brian Behlendorf
parent
df7c4059cb
commit
12fa7f3436
@@ -1166,7 +1166,8 @@ zfs_acl_chown_setattr(znode_t *zp)
|
||||
|
||||
error = zfs_acl_node_read(zp, B_TRUE, &aclp, B_FALSE);
|
||||
if (error == 0 && aclp->z_acl_count > 0)
|
||||
zp->z_mode = zfs_mode_compute(zp->z_mode, aclp,
|
||||
zp->z_mode = ZTOI(zp)->i_mode =
|
||||
zfs_mode_compute(zp->z_mode, aclp,
|
||||
&zp->z_pflags, KUID_TO_SUID(ZTOI(zp)->i_uid),
|
||||
KGID_TO_SGID(ZTOI(zp)->i_gid));
|
||||
|
||||
@@ -1328,7 +1329,7 @@ zfs_aclset_common(znode_t *zp, zfs_acl_t *aclp, cred_t *cr, dmu_tx_t *tx)
|
||||
mode = zfs_mode_compute(mode, aclp, &zp->z_pflags,
|
||||
KUID_TO_SUID(ZTOI(zp)->i_uid), KGID_TO_SGID(ZTOI(zp)->i_gid));
|
||||
|
||||
zp->z_mode = mode;
|
||||
zp->z_mode = ZTOI(zp)->i_mode = mode;
|
||||
SA_ADD_BULK_ATTR(bulk, count, SA_ZPL_MODE(zsb), NULL,
|
||||
&mode, sizeof (mode));
|
||||
SA_ADD_BULK_ATTR(bulk, count, SA_ZPL_FLAGS(zsb), NULL,
|
||||
|
||||
Reference in New Issue
Block a user