From 76242329e46aeb1249855aa18038ab5d0f58975b Mon Sep 17 00:00:00 2001 From: Kern Sibbald Date: Wed, 23 Jul 2008 14:17:40 +0000 Subject: [PATCH] Apply patch submitted for bug #1107 with a small modification. This fixes a bug where bcopy copied too many records. git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@7422 91ce42f0-d328-0410-95d8-f526ca767f89 --- bacula/src/stored/bcopy.c | 17 ++++++++++++++++- bacula/technotes-2.5 | 2 ++ 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/bacula/src/stored/bcopy.c b/bacula/src/stored/bcopy.c index e84560797c..fbb35120e5 100644 --- a/bacula/src/stored/bcopy.c +++ b/bacula/src/stored/bcopy.c @@ -258,9 +258,20 @@ static bool record_cb(DCR *in_dcr, DEV_RECORD *rec) Pmsg0(000, _("Volume label not copied.\n")); return true; case SOS_LABEL: - jobs++; + if (bsr && rec->match_stat < 1) { + /* Skipping record, because does not match BSR filter */ + if (verbose) { + Pmsg0(-1, _("Copy skipped. Record does not match BSR filter.\n")); + } + } else { + jobs++; + } break; case EOS_LABEL: + if (bsr && rec->match_stat < 1) { + /* Skipping record, because does not match BSR filter */ + return true; + } while (!write_record_to_block(out_block, rec)) { Dmsg2(150, "!write_record_to_block data_len=%d rem=%d\n", rec->data_len, rec->remainder); @@ -292,6 +303,10 @@ static bool record_cb(DCR *in_dcr, DEV_RECORD *rec) } /* Write record */ + if (bsr && rec->match_stat < 1) { + /* Skipping record, because does not match BSR filter */ + return true; + } records++; while (!write_record_to_block(out_block, rec)) { Dmsg2(150, "!write_record_to_block data_len=%d rem=%d\n", rec->data_len, diff --git a/bacula/technotes-2.5 b/bacula/technotes-2.5 index 2bc7822ba3..4c3ac71b83 100644 --- a/bacula/technotes-2.5 +++ b/bacula/technotes-2.5 @@ -33,6 +33,8 @@ separator in console (!$%&'()*+,-/:;<>?[]^`{|}~) General: 23Jul08 +kes Apply patch submitted for bug #1107 with a small modification. + This fixes a bug where bcopy copied too many records. kes Make some tweaks to bsmtp based on patch submitted in bug #1124. This fixes bug #1124. kes Make the default bat restore Pool be Any. This fixes bug #1118. -- 2.39.5