From: Wang Shilong <wshilong@xxxxxxx> From: Wang Shilong <wshilong@xxxxxxx> Signed-off-by: Wang Shilong <wshilong@xxxxxxx> --- fs/ext4/inode.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/fs/ext4/inode.c b/fs/ext4/inode.c index 34d7e0703cc6..b6c451407dcd 100644 --- a/fs/ext4/inode.c +++ b/fs/ext4/inode.c @@ -5537,10 +5537,12 @@ int ext4_setattr(struct dentry *dentry, struct iattr *attr) return error; } if ((ia_valid & ATTR_UID && !uid_eq(attr->ia_uid, inode->i_uid)) || - (ia_valid & ATTR_GID && !gid_eq(attr->ia_gid, inode->i_gid))) { + (ia_valid & ATTR_GID && !gid_eq(attr->ia_gid, inode->i_gid)) || + (ia_valid & ATTR_PROJID && !projid_eq(attr->ia_projid, + EXT4_I(inode)->i_projid))) { handle_t *handle; - /* (user+group)*(old+new) structure, inode write (sb, + /* (user+group+project)*(old+new) structure, inode write (sb, * inode block, ? - but truncate inode update has it) */ handle = ext4_journal_start(inode, EXT4_HT_QUOTA, (EXT4_MAXQUOTAS_INIT_BLOCKS(inode->i_sb) + @@ -5567,6 +5569,8 @@ int ext4_setattr(struct dentry *dentry, struct iattr *attr) inode->i_uid = attr->ia_uid; if (attr->ia_valid & ATTR_GID) inode->i_gid = attr->ia_gid; + if (attr->ia_valid & ATTR_PROJID) + EXT4_I(inode)->i_projid = attr->ia_projid; error = ext4_mark_inode_dirty(handle, inode); ext4_journal_stop(handle); } -- 2.19.1