[Metakit] Re: Metakit bug, could be critical

Jean-Claude Wippler jcw at equi4.com
Fri Nov 18 03:43:55 CET 2005


The patch sent in the previous mail was inadequate.
This one appears to be more effective with disk-full errors:

$ cvs diff persist.cpp
Index: persist.cpp
===================================================================
RCS file: /home/cvs/metakit/src/persist.cpp,v
retrieving revision 1.26
diff -u -r1.26 persist.cpp
--- persist.cpp 28 Jan 2004 21:33:40 -0000      1.26
+++ persist.cpp 18 Nov 2005 02:41:28 -0000
@@ -684,6 +684,15 @@
      _nextSpace->Release(end0, 8);
      end0 -= 16; // overwrite existing tail markers
    } else {
+    /* 18-11-2005 write new end marker and flush it before  
*anything* else! */
+    if (!_fullScan && end0 < limit) {
+      c4_FileMark mark1 (limit, 0);
+      _strategy.DataWrite(limit, &mark1, sizeof mark1);
+      _strategy.DataCommit(0);
+      if (_strategy._failure != 0)
+       return;
+    }
+
      c4_FileMark head (limit + 16 - end, _strategy._bytesFlipped,  
end > 0);
      _strategy.DataWrite(end, &head, sizeof head);

$

-jcw



More information about the Metakit mailing list