Skip to content

Commit

Permalink
fs/ocfs2/journal.h: add bits_wanted while calculating credits in ocfs…
Browse files Browse the repository at this point in the history
…2_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 <rgoldwyn@suse.com>
Reviewed-by: Jie Liu <jeff.liu@oracle.com>
Cc: Joel Becker <jlbec@evilplan.org>
Cc: Mark Fasheh <mfasheh@suse.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
  • Loading branch information
goldwynr authored and torvalds committed Jul 3, 2013
1 parent 33add0e commit 40bd62e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion fs/ocfs2/journal.h
Expand Up @@ -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)
Expand Down

0 comments on commit 40bd62e

Please sign in to comment.