]> git.sur5r.net Git - bacula/bacula/commitdiff
Make re-read last block fatal if block numbers differ by more than one.
authorKern Sibbald <kern@sibbald.com>
Thu, 5 Feb 2009 11:30:35 +0000 (11:30 +0000)
committerKern Sibbald <kern@sibbald.com>
Thu, 5 Feb 2009 11:30:35 +0000 (11:30 +0000)
git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@8424 91ce42f0-d328-0410-95d8-f526ca767f89

bacula/src/stored/block.c
bacula/technotes-2.5

index 97dac7ca57fe60f55f34899254a77b0e5df8aef3..3980328f03d4d5a9e70690350be491224d2fb4b0 100644 (file)
@@ -689,15 +689,17 @@ static void reread_last_block(DCR *dcr)
              * If we wrote block and the block numbers don't agree
              *  we have a possible problem.
              */
-#ifdef xxx
-            if (lblock->VolSessionId == block->VolSessionId &&
-                lblock->VolSessionTime == block->VolSessionTime &&
-                lblock->BlockNumber+1 != block->BlockNumber) {
-#endif
             if (lblock->BlockNumber != dev->LastBlock) {
-               Jmsg(jcr, M_ERROR, 0, _(
+                if (dev->LastBlock > (lblock->BlockNumber + 1)) {
+                   Jmsg(jcr, M_FATAL, 0, _(
+"Re-read of last block: block numbers differ by more than one.\n"
+"Probable tape misconfiguration and data loss. Read block=%u Want block=%u.\n"),
+                       lblock->BlockNumber, dev->LastBlock);
+                 } else {
+                   Jmsg(jcr, M_ERROR, 0, _(
 "Re-read of last block OK, but block numbers differ. Read block=%u Want block=%u.\n"),
-                    lblock->BlockNumber, dev->LastBlock);
+                       lblock->BlockNumber, dev->LastBlock);
+                 }
             } else {
                Jmsg(jcr, M_INFO, 0, _("Re-read of last block succeeded.\n"));
             }
index c08861d82d076971209faac35700dafc6cbfdc22..e0b78956ff027dcbd78d1c94a663678f26b3c8e2 100644 (file)
@@ -25,6 +25,9 @@ filepattern (restore with regex in bsr)
 mixed priorities
 
 General:
+05Feb09
+kes  Make re-read last block fatal if block numbers differ by
+     more than one.
 30Jan09
 ebl  Try to disable _FORTIFY_SOURCE by default
 29Jan09