From f8f848fdb5aace95292d905dc60fe0de45521859 Mon Sep 17 00:00:00 2001 From: Kern Sibbald Date: Thu, 7 Sep 2006 11:52:20 +0000 Subject: [PATCH] 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. git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@3425 91ce42f0-d328-0410-95d8-f526ca767f89 --- bacula/src/stored/mount.c | 16 ++++++++++++---- bacula/src/version.h | 4 ++-- bacula/technotes-1.39 | 5 +++++ 3 files changed, 19 insertions(+), 6 deletions(-) diff --git a/bacula/src/stored/mount.c b/bacula/src/stored/mount.c index 61443a6e7f..e6b97fa760 100644 --- a/bacula/src/stored/mount.c +++ b/bacula/src/stored/mount.c @@ -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); diff --git a/bacula/src/version.h b/bacula/src/version.h index 5f68f53358..7682360542 100644 --- a/bacula/src/version.h +++ b/bacula/src/version.h @@ -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 */ diff --git a/bacula/technotes-1.39 b/bacula/technotes-1.39 index 3abf44e441..ce49b3a54f 100644 --- a/bacula/technotes-1.39 +++ b/bacula/technotes-1.39 @@ -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 -- 2.39.5