]> git.sur5r.net Git - bacula/bacula/commitdiff
kes Apply patch submitted for bug #1107 with a small modification.
authorKern Sibbald <kern@sibbald.com>
Wed, 23 Jul 2008 15:21:42 +0000 (15:21 +0000)
committerKern Sibbald <kern@sibbald.com>
Wed, 23 Jul 2008 15:21:42 +0000 (15:21 +0000)
     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

bacula/src/stored/bcopy.c
bacula/technotes-2.4

index 33a60d7bb00637a40dffa5dfce49e4de2d2f1302..836a43415daaec53940c2a0f5efa507bdeefa68d 100644 (file)
@@ -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,
index ed82e26f5751e41189db9733520c8201698fa293..7b44c28d13e942b40a32fe607d6089ca08996896 100644 (file)
@@ -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.