From: Kern Sibbald Date: Thu, 5 Feb 2009 11:30:35 +0000 (+0000) Subject: Make re-read last block fatal if block numbers differ by more than one. X-Git-Tag: Release-3.0.0~256 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=cb73957eec3ab634f54e9a820d0f7cd58b368e8f;p=bacula%2Fbacula Make re-read last block fatal if block numbers differ by more than one. git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@8424 91ce42f0-d328-0410-95d8-f526ca767f89 --- diff --git a/bacula/src/stored/block.c b/bacula/src/stored/block.c index 97dac7ca57..3980328f03 100644 --- a/bacula/src/stored/block.c +++ b/bacula/src/stored/block.c @@ -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")); } diff --git a/bacula/technotes-2.5 b/bacula/technotes-2.5 index c08861d82d..e0b78956ff 100644 --- a/bacula/technotes-2.5 +++ b/bacula/technotes-2.5 @@ -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