aboutsummaryrefslogtreecommitdiffstats
path: root/fs/gfs2/ops_inode.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/gfs2/ops_inode.c')
-rw-r--r--fs/gfs2/ops_inode.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/fs/gfs2/ops_inode.c b/fs/gfs2/ops_inode.c
index 98cdd05f3316..d7d410a4ca42 100644
--- a/fs/gfs2/ops_inode.c
+++ b/fs/gfs2/ops_inode.c
@@ -1136,8 +1136,16 @@ static int setattr_chown(struct inode *inode, struct iattr *attr)
1136 if (error) 1136 if (error)
1137 goto out_end_trans; 1137 goto out_end_trans;
1138 1138
1139 error = inode_setattr(inode, attr); 1139 if ((attr->ia_valid & ATTR_SIZE) &&
1140 gfs2_assert_warn(sdp, !error); 1140 attr->ia_size != i_size_read(inode)) {
1141 int error;
1142
1143 error = vmtruncate(inode, attr->ia_size);
1144 gfs2_assert_warn(sdp, !error);
1145 }
1146
1147 setattr_copy(inode, attr);
1148 mark_inode_dirty(inode);
1141 1149
1142 gfs2_trans_add_bh(ip->i_gl, dibh, 1); 1150 gfs2_trans_add_bh(ip->i_gl, dibh, 1);
1143 gfs2_dinode_out(ip, dibh->b_data); 1151 gfs2_dinode_out(ip, dibh->b_data);