From: Goldwyn Rodrigues Date: Wed, 19 Jun 2013 00:05:39 +0000 (+1000) Subject: fs/ocfs2/journal.h: add bits_wanted while calculating credits in ocfs2_calc_extend_cr... X-Git-Tag: next-20130619~2^2~598 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=f256ef401aa91a7d4fa54071f801e9c35cffd57f;p=karo-tx-linux.git fs/ocfs2/journal.h: add bits_wanted while calculating credits in ocfs2_calc_extend_credits While adding extends to a file, the credits are calculated incorrectly and if the requested clusters is more than one (or more because we used a conservative limit) then we run out of journal credits and we hit an assert in journalling code. The function parameter bits_wanted variable was not used at all. Signed-off-by: Goldwyn Rodrigues Reviewed-by: Jie Liu Cc: Joel Becker Cc: Mark Fasheh Signed-off-by: Andrew Morton --- diff --git a/fs/ocfs2/journal.h b/fs/ocfs2/journal.h index 0a992737dcaf..96f9ac237e86 100644 --- a/fs/ocfs2/journal.h +++ b/fs/ocfs2/journal.h @@ -537,7 +537,7 @@ static inline int ocfs2_calc_extend_credits(struct super_block *sb, extent_blocks = 1 + 1 + le16_to_cpu(root_el->l_tree_depth); return bitmap_blocks + sysfile_bitmap_blocks + extent_blocks + - ocfs2_quota_trans_credits(sb); + ocfs2_quota_trans_credits(sb) + bits_wanted; } static inline int ocfs2_calc_symlink_credits(struct super_block *sb)