From 3f7f2924de5e5b71c64fbd37db0764f6ab97e125 Mon Sep 17 00:00:00 2001 From: Kern Sibbald Date: Sun, 8 Jun 2008 10:13:01 +0000 Subject: [PATCH] kes Add make clean of qt-source directory during ./configure kes Store last block number written to tape in DEVICE and use it for testing for correct last block on EOT. git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@7116 91ce42f0-d328-0410-95d8-f526ca767f89 --- bacula/autoconf/configure.in | 1 + bacula/configure | 1 + bacula/src/stored/block.c | 9 +++++++-- bacula/src/stored/dev.h | 1 + bacula/src/version.h | 2 +- bacula/technotes-2.5 | 3 +++ 6 files changed, 14 insertions(+), 3 deletions(-) diff --git a/bacula/autoconf/configure.in b/bacula/autoconf/configure.in index 5cc212f30f..d0461b65ec 100644 --- a/bacula/autoconf/configure.in +++ b/bacula/autoconf/configure.in @@ -2342,6 +2342,7 @@ if test "${support_bat}" = "yes" ; then chmod 755 install_conf_file build-depkgs-qt-console echo "Creating bat Makefile" $QMAKEBIN + make clean cd ${BUILD_DIR} fi diff --git a/bacula/configure b/bacula/configure index 42440e2bfb..55745e5e81 100755 --- a/bacula/configure +++ b/bacula/configure @@ -32121,6 +32121,7 @@ if test "${support_bat}" = "yes" ; then chmod 755 install_conf_file build-depkgs-qt-console echo "Creating bat Makefile" $QMAKEBIN + make clean cd ${BUILD_DIR} fi diff --git a/bacula/src/stored/block.c b/bacula/src/stored/block.c index 5efc332669..7ac0491eab 100644 --- a/bacula/src/stored/block.c +++ b/bacula/src/stored/block.c @@ -599,6 +599,7 @@ bool write_block_to_dev(DCR *dcr) dev->VolCatInfo.VolCatBlocks++; dev->EndBlock = dev->block_num; dev->EndFile = dev->file; + dev->LastBlock = block->BlockNumber; block->BlockNumber++; /* Update dcr values */ @@ -688,11 +689,15 @@ 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, _( -"Re-read of last block OK, but block numbers differ. Last block=%u Current block=%u.\n"), - lblock->BlockNumber, block->BlockNumber); +"Re-read of last block OK, but block numbers differ. Read block=%u Want block=%u.\n"), + lblock->BlockNumber, dev->LastBlock); } else { Jmsg(jcr, M_INFO, 0, _("Re-read of last block succeeded.\n")); } diff --git a/bacula/src/stored/dev.h b/bacula/src/stored/dev.h index fbfa735b68..265680f5b7 100644 --- a/bacula/src/stored/dev.h +++ b/bacula/src/stored/dev.h @@ -241,6 +241,7 @@ public: POOLMEM *prt_name; /* Name used for display purposes */ char *errmsg; /* nicely edited error message */ uint32_t block_num; /* current block number base 0 */ + uint32_t LastBlock; /* last DEV_BLOCK number written to Volume */ uint32_t file; /* current file number base 0 */ uint64_t file_addr; /* Current file read/write address */ uint64_t file_size; /* Current file size */ diff --git a/bacula/src/version.h b/bacula/src/version.h index 3530506c88..cba9b27869 100644 --- a/bacula/src/version.h +++ b/bacula/src/version.h @@ -62,7 +62,7 @@ * run regress test. */ #ifdef DEVELOPER -#define USE_FAKETAPE +//#define USE_FAKETAPE #endif /* diff --git a/bacula/technotes-2.5 b/bacula/technotes-2.5 index ef6b90bde7..1e027dce09 100644 --- a/bacula/technotes-2.5 +++ b/bacula/technotes-2.5 @@ -26,6 +26,9 @@ Add long term statistics job table General: 08Jun08 ebl Modify faketape driver to avoid sparse file. +kes Add make clean of qt-source directory during ./configure +kes Store last block number written to tape in DEVICE and + use it for testing for correct last block on EOT. Release Version 2.4.0: 04Jun08 -- 2.39.5