ocfs2: Make global quota files blocksize aligned

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Linux Kernel Mailing List
Date: Thursday, August 13, 2009 - 11:59 am

Gitweb:     http://git.kernel.org/linus/b57ac2c43e66cb4aa76c9d2d0e9e0e04f19cc5a6
Commit:     b57ac2c43e66cb4aa76c9d2d0e9e0e04f19cc5a6
Parent:     82e12644cf5227dab15201fbcaf0ca6330ebd70f
Author:     Jan Kara <jack@suse.cz>
AuthorDate: Wed Jul 22 13:17:15 2009 +0200
Committer:  Joel Becker <joel.becker@oracle.com>
CommitDate: Thu Jul 23 10:58:59 2009 -0700

    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>
---
 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 edfa60c..a66cb82 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,
 
 	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;
--
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
ocfs2: Make global quota files blocksize aligned, Linux Kernel Mailing ..., (Thu Aug 13, 11:59 am)