diff options
author | lorddoskias <[email protected]> | 2016-09-28 00:08:52 +0300 |
---|---|---|
committer | Brian Behlendorf <[email protected]> | 2016-09-27 14:08:52 -0700 |
commit | 12fa7f3436fbd89f4d6b00c2c076405e7a21d62f (patch) | |
tree | 123b980b9c8818a13ceabcfb874d54f8c8ef60b9 /module/zfs/zfs_acl.c | |
parent | df7c4059cb9ace35dfcbe37c68d27614191d0ef0 (diff) |
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 <[email protected]>
Reviewed-by: Brian Behlendorf <[email protected]>
Signed-off-by: Nikolay Borisov <[email protected]>
Closes #5158
Diffstat (limited to 'module/zfs/zfs_acl.c')
-rw-r--r-- | module/zfs/zfs_acl.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/module/zfs/zfs_acl.c b/module/zfs/zfs_acl.c index 28ebfcc67..451000010 100644 --- a/module/zfs/zfs_acl.c +++ b/module/zfs/zfs_acl.c @@ -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, |