diff options
Diffstat (limited to 'fs')
-rw-r--r-- | fs/ocfs2/quota_global.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/fs/ocfs2/quota_global.c b/fs/ocfs2/quota_global.c index edfa60cd155c..a66cb82fd6e6 100644 --- a/fs/ocfs2/quota_global.c +++ b/fs/ocfs2/quota_global.c | |||
@@ -211,14 +211,17 @@ ssize_t ocfs2_quota_write(struct super_block *sb, int type, | |||
211 | 211 | ||
212 | mutex_lock_nested(&gqinode->i_mutex, I_MUTEX_QUOTA); | 212 | mutex_lock_nested(&gqinode->i_mutex, I_MUTEX_QUOTA); |
213 | if (gqinode->i_size < off + len) { | 213 | if (gqinode->i_size < off + len) { |
214 | loff_t rounded_end = | ||
215 | ocfs2_align_bytes_to_blocks(sb, off + len); | ||
216 | |||
214 | down_write(&OCFS2_I(gqinode)->ip_alloc_sem); | 217 | down_write(&OCFS2_I(gqinode)->ip_alloc_sem); |
215 | err = ocfs2_extend_no_holes(gqinode, off + len, off); | 218 | err = ocfs2_extend_no_holes(gqinode, rounded_end, off); |
216 | up_write(&OCFS2_I(gqinode)->ip_alloc_sem); | 219 | up_write(&OCFS2_I(gqinode)->ip_alloc_sem); |
217 | if (err < 0) | 220 | if (err < 0) |
218 | goto out; | 221 | goto out; |
219 | err = ocfs2_simple_size_update(gqinode, | 222 | err = ocfs2_simple_size_update(gqinode, |
220 | oinfo->dqi_gqi_bh, | 223 | oinfo->dqi_gqi_bh, |
221 | off + len); | 224 | rounded_end); |
222 | if (err < 0) | 225 | if (err < 0) |
223 | goto out; | 226 | goto out; |
224 | new = 1; | 227 | new = 1; |