Skip to content

Commit 40bd62e

Browse files
goldwynrtorvalds
authored andcommitted
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 <[email protected]> Reviewed-by: Jie Liu <[email protected]> Cc: Joel Becker <[email protected]> Cc: Mark Fasheh <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
1 parent 33add0e commit 40bd62e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

fs/ocfs2/journal.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -537,7 +537,7 @@ static inline int ocfs2_calc_extend_credits(struct super_block *sb,
537537
extent_blocks = 1 + 1 + le16_to_cpu(root_el->l_tree_depth);
538538

539539
return bitmap_blocks + sysfile_bitmap_blocks + extent_blocks +
540-
ocfs2_quota_trans_credits(sb);
540+
ocfs2_quota_trans_credits(sb) + bits_wanted;
541541
}
542542

543543
static inline int ocfs2_calc_symlink_credits(struct super_block *sb)

0 commit comments

Comments
 (0)