1 From 96e8cc43fbecaee5a2b9eee4ec27a765474e7671 Mon Sep 17 00:00:00 2001
2 From: Jan Kara <jack@suse.cz>
3 Date: Wed, 17 Jun 2009 17:35:07 +0200
4 Subject: [PATCH 1/6] ocfs2: Make global quota files blocksize aligned
6 Change i_size of global quota files so that it always remains aligned to block
7 size. This is mainly because the end of quota block may contain checksum (if
8 checksumming is enabled) and it's a bit awkward for it to be "outside" of quota
9 file (and it makes life harder for ocfs2-tools).
11 Signed-off-by: Jan Kara <jack@suse.cz>
13 fs/ocfs2/quota_global.c | 6 ++++--
14 1 files changed, 4 insertions(+), 2 deletions(-)
16 Index: linux-2.6.27-SLE11_BRANCH/fs/ocfs2/quota_global.c
17 ===================================================================
18 --- linux-2.6.27-SLE11_BRANCH.orig/fs/ocfs2/quota_global.c 2009-07-16 13:21:13.000000000 +0200
19 +++ linux-2.6.27-SLE11_BRANCH/fs/ocfs2/quota_global.c 2009-07-16 13:25:41.000000000 +0200
22 mutex_lock_nested(&gqinode->i_mutex, I_MUTEX_QUOTA);
23 if (gqinode->i_size < off + len) {
24 + loff_t rounded_end = ALIGN(off + len, sb->s_blocksize);
26 down_write(&OCFS2_I(gqinode)->ip_alloc_sem);
27 - err = ocfs2_extend_no_holes(gqinode, off + len, off);
28 + err = ocfs2_extend_no_holes(gqinode, rounded_end, off);
29 up_write(&OCFS2_I(gqinode)->ip_alloc_sem);
32 err = ocfs2_simple_size_update(gqinode,