All of lore.kernel.org
 help / color / mirror / Atom feed
* [Ocfs2-devel] [PATCH] Add bits_wanted while calculating credits in ocfs2_calc_extend_credits
@ 2013-06-17 14:08 Goldwyn Rodrigues
  2013-06-17 14:40 ` Jeff Liu
  0 siblings, 1 reply; 2+ messages in thread
From: Goldwyn Rodrigues @ 2013-06-17 14:08 UTC (permalink / raw)
  To: ocfs2-devel

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>

--- 
diff --git a/fs/ocfs2/journal.h b/fs/ocfs2/journal.h
index a3385b6..7d927cd 100644
--- a/fs/ocfs2/journal.h
+++ b/fs/ocfs2/journal.h
@@ -538,7 +538,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)

^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2013-06-17 14:40 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-06-17 14:08 [Ocfs2-devel] [PATCH] Add bits_wanted while calculating credits in ocfs2_calc_extend_credits Goldwyn Rodrigues
2013-06-17 14:40 ` Jeff Liu

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.