diff options
Diffstat (limited to 'fs/gfs2/ops_inode.c')
-rw-r--r-- | fs/gfs2/ops_inode.c | 18 |
1 files changed, 1 insertions, 17 deletions
diff --git a/fs/gfs2/ops_inode.c b/fs/gfs2/ops_inode.c index 12cbea7502c2..1db6b7343229 100644 --- a/fs/gfs2/ops_inode.c +++ b/fs/gfs2/ops_inode.c | |||
@@ -1069,7 +1069,6 @@ static int setattr_chown(struct inode *inode, struct iattr *attr) | |||
1069 | { | 1069 | { |
1070 | struct gfs2_inode *ip = GFS2_I(inode); | 1070 | struct gfs2_inode *ip = GFS2_I(inode); |
1071 | struct gfs2_sbd *sdp = GFS2_SB(inode); | 1071 | struct gfs2_sbd *sdp = GFS2_SB(inode); |
1072 | struct buffer_head *dibh; | ||
1073 | u32 ouid, ogid, nuid, ngid; | 1072 | u32 ouid, ogid, nuid, ngid; |
1074 | int error; | 1073 | int error; |
1075 | 1074 | ||
@@ -1100,25 +1099,10 @@ static int setattr_chown(struct inode *inode, struct iattr *attr) | |||
1100 | if (error) | 1099 | if (error) |
1101 | goto out_gunlock_q; | 1100 | goto out_gunlock_q; |
1102 | 1101 | ||
1103 | error = gfs2_meta_inode_buffer(ip, &dibh); | 1102 | error = gfs2_setattr_simple(ip, attr); |
1104 | if (error) | 1103 | if (error) |
1105 | goto out_end_trans; | 1104 | goto out_end_trans; |
1106 | 1105 | ||
1107 | if ((attr->ia_valid & ATTR_SIZE) && | ||
1108 | attr->ia_size != i_size_read(inode)) { | ||
1109 | int error; | ||
1110 | |||
1111 | error = vmtruncate(inode, attr->ia_size); | ||
1112 | gfs2_assert_warn(sdp, !error); | ||
1113 | } | ||
1114 | |||
1115 | setattr_copy(inode, attr); | ||
1116 | mark_inode_dirty(inode); | ||
1117 | |||
1118 | gfs2_trans_add_bh(ip->i_gl, dibh, 1); | ||
1119 | gfs2_dinode_out(ip, dibh->b_data); | ||
1120 | brelse(dibh); | ||
1121 | |||
1122 | if (ouid != NO_QUOTA_CHANGE || ogid != NO_QUOTA_CHANGE) { | 1106 | if (ouid != NO_QUOTA_CHANGE || ogid != NO_QUOTA_CHANGE) { |
1123 | u64 blocks = gfs2_get_inode_blocks(&ip->i_inode); | 1107 | u64 blocks = gfs2_get_inode_blocks(&ip->i_inode); |
1124 | gfs2_quota_change(ip, -blocks, ouid, ogid); | 1108 | gfs2_quota_change(ip, -blocks, ouid, ogid); |