From: Kern Sibbald Date: Sun, 14 Dec 2008 21:13:35 +0000 (+0000) Subject: Tweak block.c read to more closely simulate write for computing X-Git-Tag: Release-3.0.0~482 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=0f5fab807bf9009abf4d9e5d85fa3d4c1b482b4c;p=bacula%2Fbacula Tweak block.c read to more closely simulate write for computing block addresses and turn on disk block testing. git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@8160 91ce42f0-d328-0410-95d8-f526ca767f89 --- diff --git a/bacula/src/stored/block.c b/bacula/src/stored/block.c index a173b8eb47..75538522f7 100644 --- a/bacula/src/stored/block.c +++ b/bacula/src/stored/block.c @@ -1116,11 +1116,15 @@ reread: dcr->EndBlock = dev->EndBlock; dcr->EndFile = dev->EndFile; } else { - uint64_t addr = dev->file_addr + block->read_len - 1; + uint32_t len = block->read_len; + if (len > block->block_len) { + len = block->block_len; + } + uint64_t addr = dev->file_addr + len - 1; dcr->EndBlock = (uint32_t)addr; dcr->EndFile = (uint32_t)(addr >> 32); - dev->block_num = dcr->EndBlock; - dev->file = dcr->EndFile; + dev->block_num = dev->EndBlock = dcr->EndBlock; + dev->file = dev->EndFile = dcr->EndFile; } dcr->VolMediaId = dev->VolCatInfo.VolMediaId; dev->file_addr += block->read_len; diff --git a/bacula/src/stored/match_bsr.c b/bacula/src/stored/match_bsr.c index ca05a54580..0376275777 100644 --- a/bacula/src/stored/match_bsr.c +++ b/bacula/src/stored/match_bsr.c @@ -612,7 +612,7 @@ static int match_volblock(BSR *bsr, BSR_VOLBLOCK *volblock, DEV_RECORD *rec, boo * files in all cases, so it is "turned off" by the following * return statement. */ - return 1; +// return 1; if (!volblock) { diff --git a/bacula/technotes-2.5 b/bacula/technotes-2.5 index 1a9af7b0fa..3b413cff03 100644 --- a/bacula/technotes-2.5 +++ b/bacula/technotes-2.5 @@ -10,6 +10,10 @@ filepattern (restore with regex in bsr) mixed priorities General: +kes Tweak block.c read to more closely simulate write for computing + block addresses and turn on disk block testing. +14Dec08 +kes Implement a crude 'list joblog' mostly for debugging. 13Dec08 kes Fix Migration bug #1206 sql error with NULL FileSetId when no jobs to migrate.