Merge tag 'arm-dt-6.0' of git://git.kernel.org/pub/scm/linux/kernel/git/soc/soc
[linux-2.6-microblaze.git] / fs / ext4 / inode.c
index 84c0eb5..3dcc1dd 100644 (file)
@@ -5350,14 +5350,14 @@ int ext4_setattr(struct user_namespace *mnt_userns, struct dentry *dentry,
        if (error)
                return error;
 
-       if (is_quota_modification(inode, attr)) {
+       if (is_quota_modification(mnt_userns, inode, attr)) {
                error = dquot_initialize(inode);
                if (error)
                        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))) {
+       if (i_uid_needs_update(mnt_userns, attr, inode) ||
+           i_gid_needs_update(mnt_userns, attr, inode)) {
                handle_t *handle;
 
                /* (user+group)*(old+new) structure, inode write (sb,
@@ -5374,7 +5374,7 @@ int ext4_setattr(struct user_namespace *mnt_userns, struct dentry *dentry,
                 * counts xattr inode references.
                 */
                down_read(&EXT4_I(inode)->xattr_sem);
-               error = dquot_transfer(inode, attr);
+               error = dquot_transfer(mnt_userns, inode, attr);
                up_read(&EXT4_I(inode)->xattr_sem);
 
                if (error) {
@@ -5383,10 +5383,8 @@ int ext4_setattr(struct user_namespace *mnt_userns, struct dentry *dentry,
                }
                /* Update corresponding info in inode so that everything is in
                 * one transaction */
-               if (attr->ia_valid & ATTR_UID)
-                       inode->i_uid = attr->ia_uid;
-               if (attr->ia_valid & ATTR_GID)
-                       inode->i_gid = attr->ia_gid;
+               i_uid_update(mnt_userns, attr, inode);
+               i_gid_update(mnt_userns, attr, inode);
                error = ext4_mark_inode_dirty(handle, inode);
                ext4_journal_stop(handle);
                if (unlikely(error)) {