]> git.sur5r.net Git - bacula/bacula/commitdiff
kes Fix bug #935, and probably also bug #903 where files were not
authorKern Sibbald <kern@sibbald.com>
Sun, 9 Sep 2007 10:03:23 +0000 (10:03 +0000)
committerKern Sibbald <kern@sibbald.com>
Sun, 9 Sep 2007 10:03:23 +0000 (10:03 +0000)
     restored. MediaId was not properly set in JobMedia record after
     a Volume change.

git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/branches/Branch-2.2@5503 91ce42f0-d328-0410-95d8-f526ca767f89

bacula/src/stored/askdir.c
bacula/src/stored/block.c
bacula/src/stored/bscan.c
bacula/src/stored/dev.h
bacula/src/stored/fd_cmds.c
bacula/technotes-2.1

index f6fd066898c59fcd93fd5c8695d61ae7e53f8be2..e533d76f83118a472c23b5033fcf1720395d0b55 100644 (file)
@@ -398,7 +398,7 @@ bool dir_create_jobmedia_record(DCR *dcr)
       dcr->StartFile, dcr->EndFile,
       dcr->StartBlock, dcr->EndBlock, 
       dcr->Copy, dcr->Stripe, 
-      edit_uint64(dcr->dev->VolCatInfo.VolMediaId, ed1));
+      edit_uint64(dcr->VolMediaId, ed1));
     Dmsg1(100, ">dird: %s", dir->msg);
    if (bnet_recv(dir) <= 0) {
       Dmsg0(190, "create_jobmedia error bnet_recv\n");
index 447d57b5da765401833384c4d0bb500363887cb7..eb16996014265e29166c21436efe95f5dd0687f2 100644 (file)
@@ -611,6 +611,7 @@ bool write_block_to_dev(DCR *dcr)
       dev->block_num = dcr->EndBlock;
       dev->file = dcr->EndFile;
    }
+   dcr->VolMediaId = dev->VolCatInfo.VolMediaId;
    if (dcr->VolFirstIndex == 0 && block->FirstIndex > 0) {
       dcr->VolFirstIndex = block->FirstIndex;
    }
@@ -1098,6 +1099,7 @@ reread:
       dev->block_num = dcr->EndBlock;
       dev->file = dcr->EndFile;
    }
+   dcr->VolMediaId = dev->VolCatInfo.VolMediaId;
    dev->file_addr += block->read_len;
    dev->file_size += block->read_len;
 
index 24f721a9b0531cb14c1e6c15f1cd2fa7de1915d8..c8e38ad0fdad9fbc939b0a14e16c1cdeaccab08f 100644 (file)
@@ -326,6 +326,7 @@ static bool bscan_mount_next_read_volume(DCR *dcr)
       mdcr->StartFile = dcr->StartFile;
       mdcr->EndBlock = dcr->EndBlock;
       mdcr->EndFile = dcr->EndFile;
+      mdcr->VolMediaId = dcr->VolMediaId;
       mjcr->read_dcr->VolLastIndex = dcr->VolLastIndex;
       if (!create_jobmedia_record(db, mjcr)) {
          Pmsg2(000, _("Could not create JobMedia record for Volume=%s Job=%s\n"),
@@ -476,6 +477,7 @@ static bool record_cb(DCR *dcr, DEV_RECORD *rec)
             dcr->VolFirstIndex = dcr->FileIndex = 0;
             dcr->StartBlock = dcr->EndBlock = 0;
             dcr->StartFile = dcr->EndFile = 0;
+            dcr->VolMediaId = 0;
          }
 
          Pmsg1(000, _("VOL_LABEL: OK for Volume: %s\n"), mr.VolumeName);
@@ -1177,6 +1179,7 @@ static int create_jobmedia_record(B_DB *db, JCR *mjcr)
 
    dcr->EndBlock = dev->EndBlock;
    dcr->EndFile  = dev->EndFile;
+   dcr->VolMediaId = dev->VolCatInfo.VolMediaId;
 
    memset(&jmr, 0, sizeof(jmr));
    jmr.JobId = mjcr->JobId;
index 39f4306b5dfb0d9b1d4ef983f67244b7b2bd34c7..f51f3ce1602fca6cb0b1b51b641069e2b10c166e 100644 (file)
@@ -447,6 +447,7 @@ public:
    uint32_t StartFile;                /* Start write file */
    uint32_t StartBlock;               /* Start write block */
    uint32_t EndBlock;                 /* Ending block written */
+   int64_t  VolMediaId;               /* MediaId */
    int64_t job_spool_size;            /* Current job spool size */
    int64_t max_job_spool_size;        /* Max job spool size */
    char VolumeName[MAX_NAME_LENGTH];  /* Volume name */
index 1c16b0f24c5d9fba57dde4b0e37ff075684aa0d3..e6e35a09535d8ad3d85568ac1c76609a455ee26f 100644 (file)
@@ -1,17 +1,3 @@
-/*
- * This file handles commands from the File daemon.
- *
- *  Kern Sibbald, MM
- *
- * We get here because the Director has initiated a Job with
- *  the Storage daemon, then done the same with the File daemon,
- *  then when the Storage daemon receives a proper connection from
- *  the File daemon, control is passed here to handle the
- *  subsequent File daemon commands.
- *
- *   Version $Id$
- *
- */
 /*
    Bacula® - The Network Backup Solution
 
    (FSFE), Fiduciary Program, Sumatrastrasse 25, 8006 Zürich,
    Switzerland, email:ftf@fsfeurope.org.
 */
+/*
+ * This file handles commands from the File daemon.
+ *
+ *  Kern Sibbald, MM
+ *
+ * We get here because the Director has initiated a Job with
+ *  the Storage daemon, then done the same with the File daemon,
+ *  then when the Storage daemon receives a proper connection from
+ *  the File daemon, control is passed here to handle the
+ *  subsequent File daemon commands.
+ *
+ *   Version $Id$
+ *
+ */
 
 #include "bacula.h"
 #include "stored.h"
index 7fde314feeb4890945e64389d7bba4d58df8d9d7..cd022f7bc122d253d86510dec70ceb44e181c930 100644 (file)
@@ -1,6 +1,10 @@
               Technical notes on version 2.2
 
 General:
+09Sep07
+kes  Fix bug #935, and probably also bug #903 where files were not
+     restored. MediaId was not properly set in JobMedia record after 
+     a Volume change.
 07Sep07
 kes  Add ./configure search in qwt-qt4 for qwt package
 kes  Apply Martin Simmons patch that should turn off the new API usage