aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--fs/gfs2/inode.c16
1 files changed, 15 insertions, 1 deletions
diff --git a/fs/gfs2/inode.c b/fs/gfs2/inode.c
index 4acc584038ee..51cf10df83e4 100644
--- a/fs/gfs2/inode.c
+++ b/fs/gfs2/inode.c
@@ -1623,10 +1623,22 @@ static int setattr_chown(struct inode *inode, struct iattr *attr)
1623 if (!(attr->ia_valid & ATTR_GID) || gid_eq(ogid, ngid)) 1623 if (!(attr->ia_valid & ATTR_GID) || gid_eq(ogid, ngid))
1624 ogid = ngid = NO_GID_QUOTA_CHANGE; 1624 ogid = ngid = NO_GID_QUOTA_CHANGE;
1625 1625
1626 error = gfs2_quota_lock(ip, nuid, ngid); 1626 error = get_write_access(inode);
1627 if (error) 1627 if (error)
1628 return error; 1628 return error;
1629 1629
1630 error = gfs2_rs_alloc(ip);
1631 if (error)
1632 goto out;
1633
1634 error = gfs2_rindex_update(sdp);
1635 if (error)
1636 goto out;
1637
1638 error = gfs2_quota_lock(ip, nuid, ngid);
1639 if (error)
1640 goto out;
1641
1630 if (!uid_eq(ouid, NO_UID_QUOTA_CHANGE) || 1642 if (!uid_eq(ouid, NO_UID_QUOTA_CHANGE) ||
1631 !gid_eq(ogid, NO_GID_QUOTA_CHANGE)) { 1643 !gid_eq(ogid, NO_GID_QUOTA_CHANGE)) {
1632 error = gfs2_quota_check(ip, nuid, ngid); 1644 error = gfs2_quota_check(ip, nuid, ngid);
@@ -1653,6 +1665,8 @@ out_end_trans:
1653 gfs2_trans_end(sdp); 1665 gfs2_trans_end(sdp);
1654out_gunlock_q: 1666out_gunlock_q:
1655 gfs2_quota_unlock(ip); 1667 gfs2_quota_unlock(ip);
1668out:
1669 put_write_access(inode);
1656 return error; 1670 return error;
1657} 1671}
1658 1672