From: Kern Sibbald Date: Wed, 23 Jul 2008 15:21:42 +0000 (+0000) Subject: kes Apply patch submitted for bug #1107 with a small modification. X-Git-Tag: Release-2.4.2~10 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=918b5d8fd393251b022acf6920f29e67b251489a;p=bacula%2Fbacula kes 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/branches/Branch-2.4@7424 91ce42f0-d328-0410-95d8-f526ca767f89 --- diff --git a/bacula/src/stored/bcopy.c b/bacula/src/stored/bcopy.c index 33a60d7bb0..836a43415d 100644 --- a/bacula/src/stored/bcopy.c +++ b/bacula/src/stored/bcopy.c @@ -20,7 +20,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - Bacula® is a registered trademark of John Walker. + Bacula® is a registered trademark of Kern Sibbald. The licensor of Bacula is the Free Software Foundation Europe (FSFE), Fiduciary Program, Sumatrastrasse 25, 8006 Zürich, Switzerland, email:ftf@fsfeurope.org. @@ -254,9 +254,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); @@ -288,6 +299,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.4 b/bacula/technotes-2.4 index ed82e26f57..7b44c28d13 100644 --- a/bacula/technotes-2.4 +++ b/bacula/technotes-2.4 @@ -3,6 +3,8 @@ General: Release Version 2.4.2 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.