Skip to content

Commit

Permalink
ocfs2: Make global quota files blocksize aligned
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Jan Kara authored and Joel Becker committed Jul 23, 2009
1 parent 82e1264 commit b57ac2c
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions fs/ocfs2/quota_global.c
Original file line number Diff line number Diff line change
Expand Up @@ -211,14 +211,17 @@ ssize_t ocfs2_quota_write(struct super_block *sb, int type,

mutex_lock_nested(&gqinode->i_mutex, I_MUTEX_QUOTA);
if (gqinode->i_size < off + len) {
loff_t rounded_end =
ocfs2_align_bytes_to_blocks(sb, off + len);

down_write(&OCFS2_I(gqinode)->ip_alloc_sem);
err = ocfs2_extend_no_holes(gqinode, off + len, off);
err = ocfs2_extend_no_holes(gqinode, rounded_end, off);
up_write(&OCFS2_I(gqinode)->ip_alloc_sem);
if (err < 0)
goto out;
err = ocfs2_simple_size_update(gqinode,
oinfo->dqi_gqi_bh,
off + len);
rounded_end);
if (err < 0)
goto out;
new = 1;
Expand Down

0 comments on commit b57ac2c

Please sign in to comment.