mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2026-05-26 12:12:13 +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
@@ -871,7 +871,7 @@ zfs_write(struct inode *ip, uio_t *uio, int ioflag, cred_t *cr)
|
||||
((zp->z_mode & S_ISUID) != 0 && uid == 0)) != 0) {
|
||||
uint64_t newmode;
|
||||
zp->z_mode &= ~(S_ISUID | S_ISGID);
|
||||
newmode = zp->z_mode;
|
||||
ip->i_mode = newmode = zp->z_mode;
|
||||
(void) sa_update(zp->z_sa_hdl, SA_ZPL_MODE(zsb),
|
||||
(void *)&newmode, sizeof (uint64_t), tx);
|
||||
}
|
||||
@@ -2993,7 +2993,7 @@ top:
|
||||
if (mask & ATTR_MODE) {
|
||||
SA_ADD_BULK_ATTR(bulk, count, SA_ZPL_MODE(zsb), NULL,
|
||||
&new_mode, sizeof (new_mode));
|
||||
zp->z_mode = new_mode;
|
||||
zp->z_mode = ZTOI(zp)->i_mode = new_mode;
|
||||
ASSERT3P(aclp, !=, NULL);
|
||||
err = zfs_aclset_common(zp, aclp, cr, tx);
|
||||
ASSERT0(err);
|
||||
|
||||
Reference in New Issue
Block a user