I was testing ddsnap journal replay with different chunk sizes and found
the current journal flush criteria does not leave enough space to prevent
ddsnap from overwriting old un-flushed journal blocks. I decreased the
flush criteria from half of journal size to one third of journal size.
After that, my test passed. Here is my current fix.
@@ -601,7 +620,7 @@ static void commit_transaction(struct su
if (list_empty(&dirty_buffers) && !sb->defer.count)
return;
- if (sb->deferred_allocs >= sb->image.journal_size / 2 ||
journaled_count >= sb->image.journal_size / 2) {
+ if (sb->deferred_allocs >= sb->image.journal_size / 3 ||
journaled_count >= sb->image.journal_size / 2) {
flush_journaled_buffers();
flush_deferred_allocs(sb);
barrier = 1;
I think a better approach is to keep track of last written commit barrier
to make sure we never overwrite any un-flushed journal blocks.
Original issue reported on code.google.com by jiahotc...@gmail.com on 11 Jul 2008 at 12:46
Original issue reported on code.google.com by
jiahotc...@gmail.com
on 11 Jul 2008 at 12:46