Skip to contentSkip to conversation

Add bits_wanted while calculating credits in ocfs2_calc_extend_credits

PATCH New Goldwyn Rodrigues 2 participants 2 messages Jun 17, 2013 OCFS2

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 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.

---

fs/ocfs2/journal.h +1 -1
index a3385b6..7d927cd 100644
@@ -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)
#1 lore raw

PATCH 1/1 Add bits_wanted while calculating credits in ocfs2_calc_extend_credits

Quoted 8 lines · Goldwyn Rodrigues

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.

Looks good to me, thank you!

Quoted 20 lines

---

fs/ocfs2/journal.h +1 -1
index a3385b6..7d927cd 100644
@@ -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)

_______________________________________________
Ocfs2-devel mailing list
Ocfs2-devel at oss.oracle.com
https://oss.oracle.com/mailman/listinfo/ocfs2-devel