From 667f720ce438b1eff42f93ca46c366cd3e6e1201 Mon Sep 17 00:00:00 2001 From: Kern Sibbald Date: Wed, 28 May 2008 13:18:22 +0000 Subject: [PATCH] kes Add debug code to SD. kes Fix renaming a Volume, which used the wrong Volume name. git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@7042 91ce42f0-d328-0410-95d8-f526ca767f89 --- bacula/src/stored/label.c | 11 ++++++++--- bacula/src/version.h | 4 ++-- bacula/technotes-2.3 | 3 +++ 3 files changed, 13 insertions(+), 5 deletions(-) diff --git a/bacula/src/stored/label.c b/bacula/src/stored/label.c index fbded4347c..d5c981bbd6 100644 --- a/bacula/src/stored/label.c +++ b/bacula/src/stored/label.c @@ -295,7 +295,8 @@ bool write_volume_label_to_block(DCR *dcr) dev->print_name()); return false; } else { - Dmsg1(130, "Wrote label of %d bytes to block\n", rec.data_len); + Dmsg2(130, "Wrote label of %d bytes to block. Vol=%s\n", rec.data_len, + dcr->VolumeName); } free_pool_memory(rec.data); return true; @@ -447,6 +448,7 @@ bool rewrite_volume_label(DCR *dcr, bool recycle) Dmsg0(200, "Error from write volume label.\n"); return false; } + Dmsg1(150, "wrote vol label to block. Vol=%s\n", dcr->VolumeName); dev->VolCatInfo.VolCatBytes = 0; /* reset byte count */ @@ -464,6 +466,7 @@ bool rewrite_volume_label(DCR *dcr, bool recycle) return false; } if (recycle) { + Dmsg1(150, "Doing recycle. Vol=%s\n", dcr->VolumeName); // volume_unused(dcr); /* mark volume unused */ if (!dev->truncate(dcr)) { Jmsg2(jcr, M_FATAL, 0, _("Truncate error on device %s: ERR=%s\n"), @@ -517,8 +520,9 @@ bool rewrite_volume_label(DCR *dcr, bool recycle) dev->VolCatInfo.VolCatWrites = 1; dev->VolCatInfo.VolCatReads = 1; } - Dmsg0(150, "dir_update_vol_info. Set Append\n"); + Dmsg1(150, "dir_update_vol_info. Set Append vol=%s\n", dcr->VolumeName); bstrncpy(dev->VolCatInfo.VolCatStatus, "Append", sizeof(dev->VolCatInfo.VolCatStatus)); + bstrncpy(dev->VolCatInfo.VolCatName, dcr->VolumeName, sizeof(dev->VolCatInfo.VolCatName)); if (!dir_update_volume_info(dcr, true, true)) { /* indicate doing relabel */ return false; } @@ -533,7 +537,7 @@ bool rewrite_volume_label(DCR *dcr, bool recycle) * End writing real Volume label (from pre-labeled tape), or recycling * the volume. */ - Dmsg0(200, "OK from rewrite vol label.\n"); + Dmsg1(150, "OK from rewrite vol label. Vol=%s\n", dcr->VolumeName); return true; } @@ -589,6 +593,7 @@ static void create_volume_label_record(DCR *dcr, DEV_RECORD *rec) ser_string(dev->VolHdr.ProgDate); ser_end(rec->data, SER_LENGTH_Volume_Label); + bstrncpy(dcr->VolumeName, dev->VolHdr.VolumeName, sizeof(dcr->VolumeName)); rec->data_len = ser_length(rec->data); rec->FileIndex = dev->VolHdr.LabelType; rec->VolSessionId = jcr->VolSessionId; diff --git a/bacula/src/version.h b/bacula/src/version.h index eb2018e650..bfe8b98b47 100644 --- a/bacula/src/version.h +++ b/bacula/src/version.h @@ -4,8 +4,8 @@ #undef VERSION #define VERSION "2.3.22" -#define BDATE "26 May 2008" -#define LSMDATE "26May08" +#define BDATE "28 May 2008" +#define LSMDATE "28May08" #define PROG_COPYRIGHT "Copyright (C) %d-2008 Free Software Foundation Europe e.V.\n" #define BYEAR "2008" /* year for copyright messages in progs */ diff --git a/bacula/technotes-2.3 b/bacula/technotes-2.3 index e1a839434c..97af471b50 100644 --- a/bacula/technotes-2.3 +++ b/bacula/technotes-2.3 @@ -24,6 +24,9 @@ Add long term statistics job table General: +28May08 +kes Add debug code to SD. +kes Fix renaming a Volume, which used the wrong Volume name. 26May08 kes If operator has rewind tape, print warning, release tape and try once more. If tape is positioned somewhere, something went -- 2.39.5