From: Kern Sibbald Date: Mon, 20 Jun 2005 09:14:50 +0000 (+0000) Subject: - Fix bug where Storage daemon gets confused about what X-Git-Tag: Release-7.0.0~8682 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=95669c04d2e61e2dc9d4cf486bfc13a05e46de94;p=bacula%2Fbacula - Fix bug where Storage daemon gets confused about what tape is mounted. (one line of code was inadvertently deleted). git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@2149 91ce42f0-d328-0410-95d8-f526ca767f89 --- diff --git a/bacula/ChangeLog b/bacula/ChangeLog index b9f4a32ecf..16e0db4fb7 100644 --- a/bacula/ChangeLog +++ b/bacula/ChangeLog @@ -1,4 +1,10 @@ +Changes to 1.37.25 release on 20 Jun 05: +20Jun05: +- Fix bug where Storage daemon gets confused about what + tape is mounted. (one line of code was inadvertently + deleted). + Changes to 1.37.24: 18Jun05 - DVD writing/reading seems to be mostly working. diff --git a/bacula/kes-1.37 b/bacula/kes-1.37 index 786fae41e8..de6bb573d5 100644 --- a/bacula/kes-1.37 +++ b/bacula/kes-1.37 @@ -3,6 +3,12 @@ General: +Changes to 1.37.25 release on 20 Jun 05: +20Jun05: +- Fix bug where Storage daemon gets confused about what + tape is mounted. (one line of code was inadvertently + deleted). + Changes to 1.37.24: 18Jun05 - DVD writing/reading seems to be mostly working. diff --git a/bacula/src/cats/postgresql.c b/bacula/src/cats/postgresql.c index f0af40cf3a..2ccb5a1e2c 100644 --- a/bacula/src/cats/postgresql.c +++ b/bacula/src/cats/postgresql.c @@ -7,24 +7,18 @@ * * Version $Id$ */ - /* Copyright (C) 2003-2005 Kern Sibbald This program is free software; you can redistribute it and/or - modify it under the terms of the GNU General Public License as - published by the Free Software Foundation; either version 2 of - the License, or (at your option) any later version. + modify it under the terms of the GNU General Public License + version 2 as ammended with additional clauses defined in the + file LICENSE in the main source directory. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - General Public License for more details. - - You should have received a copy of the GNU General Public - License along with this program; if not, write to the Free - Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, - MA 02111-1307, USA. + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + the file LICENSE for additional details. */ diff --git a/bacula/src/stored/label.c b/bacula/src/stored/label.c index 2e11958ae3..ac0dd6bab5 100644 --- a/bacula/src/stored/label.c +++ b/bacula/src/stored/label.c @@ -83,6 +83,7 @@ int read_dev_volume_label(DCR *dcr) if (!dev->poll && jcr->label_errors++ > 100) { Jmsg(jcr, M_FATAL, 0, "Too many tries: %s", jcr->errmsg); } + Dmsg0(100, "return VOL_NAME_ERROR\n"); return VOL_NAME_ERROR; } Dmsg0(30, "Leave read_volume_label() VOL_OK\n"); @@ -97,7 +98,7 @@ int read_dev_volume_label(DCR *dcr) if (!rewind_dev(dev)) { Mmsg(jcr->errmsg, _("Couldn't rewind device %s: ERR=%s\n"), dev->print_name(), strerror_dev(dev)); - Dmsg1(30, "%s", jcr->errmsg); + Dmsg1(30, "return VOL_NO_MEDIA: %s", jcr->errmsg); return VOL_NO_MEDIA; } bstrncpy(dev->VolHdr.Id, "**error**", sizeof(dev->VolHdr.Id)); @@ -122,6 +123,7 @@ int read_dev_volume_label(DCR *dcr) } empty_block(block); rewind_dev(dev); + Dmsg1(100, "return %d\n", stat); return stat; } if (stat != VOL_OK) { /* Not an ANSI/IBM label, so re-read */ @@ -163,6 +165,7 @@ int read_dev_volume_label(DCR *dcr) return VOL_OK; } rewind_dev(dev); + Dmsg0(100, "return VOL_NO_LABEL\n"); return VOL_NO_LABEL; } @@ -181,7 +184,7 @@ int read_dev_volume_label(DCR *dcr) dev->VolHdr.VerNum != OldCompatibleBaculaTapeVersion2) { Mmsg(jcr->errmsg, _("Volume on %s has wrong Bacula version. Wanted %d got %d\n"), dev->print_name(), BaculaTapeVersion, dev->VolHdr.VerNum); - Dmsg1(30, "%s", jcr->errmsg); + Dmsg1(30, "VOL_VERSION_ERROR: %s", jcr->errmsg); return VOL_VERSION_ERROR; } @@ -195,6 +198,7 @@ int read_dev_volume_label(DCR *dcr) if (!dev->poll && jcr->label_errors++ > 100) { Jmsg(jcr, M_FATAL, 0, "Too many tries: %s", jcr->errmsg); } + Dmsg0(100, "return VOL_LABEL_ERROR\n"); return VOL_LABEL_ERROR; } @@ -214,6 +218,7 @@ int read_dev_volume_label(DCR *dcr) if (!dev->poll && jcr->label_errors++ > 100) { Jmsg(jcr, M_FATAL, 0, "Too many tries: %s", jcr->errmsg); } + Dmsg0(100, "return VOL_NAME_ERROR\n"); return VOL_NAME_ERROR; } Dmsg1(30, "Copy vol_name=%s\n", dev->VolHdr.VolumeName); diff --git a/bacula/src/stored/mount.c b/bacula/src/stored/mount.c index 3f7d154cba..bcfb36da6f 100644 --- a/bacula/src/stored/mount.c +++ b/bacula/src/stored/mount.c @@ -190,7 +190,7 @@ read_volume: return false; } - Dmsg2(100, "dirVol=%s dirStat=%s\n", dcr->VolumeName, + Dmsg2(100, "Want dirVol=%s dirStat=%s\n", dcr->VolumeName, dcr->VolCatInfo.VolCatStatus); /* * At this point, dev->VolCatInfo has what is in the drive, if anything, @@ -230,6 +230,7 @@ read_volume: memcpy(&VolCatInfo, &dcr->VolCatInfo, sizeof(VolCatInfo)); 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)); if (!dir_get_volume_info(dcr, GET_VOL_INFO_FOR_WRITE)) { /* Restore desired volume name, note device info out of sync */ /* This gets the info regardless of the Pool */ diff --git a/bacula/src/version.h b/bacula/src/version.h index 2b07c919be..893aa54c3d 100644 --- a/bacula/src/version.h +++ b/bacula/src/version.h @@ -1,8 +1,8 @@ /* */ #undef VERSION -#define VERSION "1.37.24" -#define BDATE "18 June 2005" -#define LSMDATE "18Jun05" +#define VERSION "1.37.25" +#define BDATE "20 June 2005" +#define LSMDATE "20Jun05" /* Debug flags */ #undef DEBUG @@ -12,7 +12,7 @@ #define TRACE_FILE 1 /* If this is set stdout will not be closed on startup */ -/* #define DEVELOPER 1 */ +#define DEVELOPER 1