junneyang / zumastor

Automatically exported from code.google.com/p/zumastor
0 stars 1 forks source link

the current ddsnap code does not check if journal size is too small #167

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
With the current ddsnap code, journal size can be set to as small as a
single chunk that is not enough for correct journal recovery. We should set
a low limit that leaves enough space for data blocks and commit block
generated in a transaction. Here is the proposed fix.

@@ -3364,6 +3436,7 @@ static int init_super(struct superblock

        trace_off(warn("cs_bits = %u", sb->snapdata.asi->allocsize_bits););
        u32 chunk_size = 1 << sb->snapdata.asi->allocsize_bits, js_chunks =
DIVROUND(js_bytes, chunk_size);
+       js_chunks = (js_chunks < 8) ? 8 : js_chunks;
        trace_off(warn("chunk_size = %u, js_chunks = %u", chunk_size,
js_chunks););

        sb->image.journal_size = js_chunks;

jiaying

Original issue reported on code.google.com by jiahotc...@gmail.com on 11 Jul 2008 at 1:07

GoogleCodeExporter commented 9 years ago
A comment as to why 8 chunks is sufficient and required might be in order.

Original comment by vand...@gmail.com on 11 Jul 2008 at 5:00