From: Jan Kara <jack@suse.cz>
Date: Tue, 11 May 2010 15:04:14 +0000 (+0200)
Subject: ocfs2: Fix estimate of credits needed for quota allocation
X-Git-Tag: firefly_0821_release~9833^2~2069^2~4
X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=832d09cf1438bd172f69478bde74f20f05ec0115;p=firefly-linux-kernel-4.4.55.git

ocfs2: Fix estimate of credits needed for quota allocation

We were missing reservation of a journal credit for modification of quota
file inode when creating new dquot structure in the global quota file.

Acked-by: Joel Becker <Joel.Becker@oracle.com>
Signed-off-by: Jan Kara <jack@suse.cz>
---

diff --git a/fs/ocfs2/quota_global.c b/fs/ocfs2/quota_global.c
index 1e3e0d5b3ae7..734995823740 100644
--- a/fs/ocfs2/quota_global.c
+++ b/fs/ocfs2/quota_global.c
@@ -468,9 +468,10 @@ static int ocfs2_global_qinit_alloc(struct super_block *sb, int type)
 
 static int ocfs2_calc_global_qinit_credits(struct super_block *sb, int type)
 {
-	/* We modify all the allocated blocks, tree root, and info block */
+	/* We modify all the allocated blocks, tree root, info block and
+	 * the inode */
 	return (ocfs2_global_qinit_alloc(sb, type) + 2) *
-			OCFS2_QUOTA_BLOCK_UPDATE_CREDITS;
+			OCFS2_QUOTA_BLOCK_UPDATE_CREDITS + 1;
 }
 
 /* Sync local information about quota modifications with global quota file.