From 84aa97d5f763cce82a897d01b551e36c81b107c5 Mon Sep 17 00:00:00 2001 From: Kern Sibbald Date: Thu, 5 Feb 2009 11:30:35 +0000 Subject: [PATCH] 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 --- bacula/src/stored/block.c | 16 +++++++++------- bacula/technotes-2.5 | 3 +++ 2 files changed, 12 insertions(+), 7 deletions(-) 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 -- 2.39.5