aboutsummaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorJan Kara <jack@suse.cz>2009-07-22 07:17:15 -0400
committerJoel Becker <joel.becker@oracle.com>2009-07-23 13:58:59 -0400
commitb57ac2c43e66cb4aa76c9d2d0e9e0e04f19cc5a6 (patch)
treee377a53fe3aab4034c6f24fd439eb4f3bed51745 /fs
parent82e12644cf5227dab15201fbcaf0ca6330ebd70f (diff)
ocfs2: Make global quota files blocksize aligned
Change i_size of global quota files so that it always remains aligned to block size. This is mainly because the end of quota block may contain checksum (if checksumming is enabled) and it's a bit awkward for it to be "outside" of quota file (and it makes life harder for ocfs2-tools). Signed-off-by: Jan Kara <jack@suse.cz> Signed-off-by: Joel Becker <joel.becker@oracle.com>
Diffstat (limited to 'fs')
-rw-r--r--fs/ocfs2/quota_global.c7
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;