]> git.sur5r.net Git - bacula/bacula/commitdiff
kes Apply patch supplied in bug #656 to pass priority field
authorKern Sibbald <kern@sibbald.com>
Thu, 7 Sep 2006 11:52:20 +0000 (11:52 +0000)
committerKern Sibbald <kern@sibbald.com>
Thu, 7 Sep 2006 11:52:20 +0000 (11:52 +0000)
     in the run dialog to the Director.
kes  Restore DCR after VOL_NAME_ERROR in mount.c.  Hopefully
     this will fix bug #627 where Bacula eventually gets
     confused about what Volume it wants.

git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@3425 91ce42f0-d328-0410-95d8-f526ca767f89

bacula/src/stored/mount.c
bacula/src/version.h
bacula/technotes-1.39

index 61443a6e7f8370fbc5926024fca8628b11820f1e..e6b97fa76026728417e313ba9b61a481d0370dea 100644 (file)
@@ -216,7 +216,7 @@ read_volume:
       recycle = strcmp(dev->VolCatInfo.VolCatStatus, "Recycle") == 0;
       break;                    /* got a Volume */
    case VOL_NAME_ERROR:
-      VOLUME_CAT_INFO VolCatInfo, devVolCatInfo;
+      VOLUME_CAT_INFO dcrVolCatInfo, devVolCatInfo;
 
       /* If not removable, Volume is broken */
       if (!dev->is_removable()) {
@@ -239,7 +239,7 @@ read_volume:
        *  this volume is really OK. If not, put back the desired
        *  volume name, mark it not in changer and continue.
        */
-      memcpy(&VolCatInfo, &dcr->VolCatInfo, sizeof(VolCatInfo));
+      memcpy(&dcrVolCatInfo, &dcr->VolCatInfo, sizeof(dcrVolCatInfo));
       memcpy(&devVolCatInfo, &dev->VolCatInfo, sizeof(devVolCatInfo));
       /* Check if this is a valid Volume in the pool */
       bstrncpy(dcr->VolumeName, dev->VolHdr.VolumeName, sizeof(dcr->VolumeName));
@@ -248,6 +248,11 @@ read_volume:
          /* This gets the info regardless of the Pool */
          bstrncpy(dcr->VolumeName, dev->VolHdr.VolumeName, sizeof(dcr->VolumeName));
          if (autochanger && !dir_get_volume_info(dcr, GET_VOL_INFO_FOR_READ)) {
+            /*
+             * If we get here, we know we cannot write on the Volume,
+             *  and we know that we cannot read it either, so it 
+             *  is not in the autochanger.
+             */
             mark_volume_not_inchanger(dcr);
          }
          memcpy(&dev->VolCatInfo, &devVolCatInfo, sizeof(dev->VolCatInfo));
@@ -255,12 +260,15 @@ read_volume:
          Jmsg(jcr, M_WARNING, 0, _("Director wanted Volume \"%s\".\n"
               "    Current Volume \"%s\" not acceptable because:\n"
               "    %s"),
-             VolCatInfo.VolCatName, dev->VolHdr.VolumeName,
+             dcrVolCatInfo.VolCatName, dev->VolHdr.VolumeName,
              jcr->dir_bsock->msg);
          ask = true;
+         /* Restore saved DCR before continuing */
+         memcpy(&dcr->VolCatInfo, &dcrVolCatInfo, sizeof(dcr->VolCatInfo));
          goto mount_next_vol;
       }
-      /* This was not the volume we expected, but it is OK with
+      /*
+       * This was not the volume we expected, but it is OK with
        * the Director, so use it.
        */
       Dmsg1(150, "want new name=%s\n", dcr->VolumeName);
index 5f68f53358384c7a720f1e5a46fa53ab95eebea0..76823605422ee3d962913c7f3442288e88c4b4fb 100644 (file)
@@ -4,8 +4,8 @@
 
 #undef  VERSION
 #define VERSION "1.39.22"
-#define BDATE   "06 Septermber 2006"
-#define LSMDATE "06Sep06"
+#define BDATE   "07 Septermber 2006"
+#define LSMDATE "07Sep06"
 #define BYEAR "2006"       /* year for copyright messages in progs */
 
 /* Debug flags */
index 3abf44e4412909baf3a126c05985a0cc6f919c1b..ce49b3a54fd35bf62597fe71df9dd5d1ff52a5ee 100644 (file)
@@ -2,6 +2,11 @@
 
 General:
 07Sep06
+kes  Apply patch supplied in bug #656 to pass priority field
+     in the run dialog to the Director.
+kes  Restore DCR after VOL_NAME_ERROR in mount.c.  Hopefully
+     this will fix bug #627 where Bacula eventually gets 
+     confused about what Volume it wants.
 kes  Add a new close_part() class in the SD to save the device
      state around open/close_part/open for DVD writing.  This
      should fix the num_dvd_parts getting zeroed as reported by