From 0947466faefb90e7a71c5eec60b2a6b68250d43d Mon Sep 17 00:00:00 2001 From: Kern Sibbald Date: Sun, 24 Aug 2008 09:41:54 +0000 Subject: [PATCH] Commit NULL vol name patch git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@7502 91ce42f0-d328-0410-95d8-f526ca767f89 --- bacula/patches/2.4.2-null-vol.patch | 63 +++++++++++++++++++++++++++++ 1 file changed, 63 insertions(+) create mode 100644 bacula/patches/2.4.2-null-vol.patch diff --git a/bacula/patches/2.4.2-null-vol.patch b/bacula/patches/2.4.2-null-vol.patch new file mode 100644 index 0000000000..7480a3a54d --- /dev/null +++ b/bacula/patches/2.4.2-null-vol.patch @@ -0,0 +1,63 @@ + + This patch fixes an error when reading (restore, migration, Vbackup) and + SD acquire.c must switch drives. The error message complained of a NULL + volume name. + + Apply this patch to version 2.4.2 with: + + cd + patch -p0 <2.4.2-null-vol.patch + ./configure + make + ... + make install + + +Index: src/stored/acquire.c +=================================================================== +--- src/stored/acquire.c (revision 7500) ++++ src/stored/acquire.c (working copy) +@@ -111,10 +111,10 @@ + DIRSTORE *store; + int stat; + +- Jmsg3(jcr, M_INFO, 0, _("Changing device. Want Media Type=\"%s\" have=\"%s\"\n" ++ Jmsg3(jcr, M_INFO, 0, _("Changing read device. Want Media Type=\"%s\" have=\"%s\"\n" + " device=%s\n"), + dcr->media_type, dev->device->media_type, dev->print_name()); +- Dmsg3(50, "Changing device. Want Media Type=\"%s\" have=\"%s\"\n" ++ Dmsg3(50, "Changing read device. Want Media Type=\"%s\" have=\"%s\"\n" + " device=%s\n", + dcr->media_type, dev->device->media_type, dev->print_name()); + +@@ -147,9 +147,9 @@ + dev = dcr->dev; /* get new device pointer */ + dev->dblock(BST_DOING_ACQUIRE); + dcr->VolumeName[0] = 0; +- Jmsg(jcr, M_INFO, 0, _("Media Type change. New device %s chosen.\n"), ++ Jmsg(jcr, M_INFO, 0, _("Media Type change. New read device %s chosen.\n"), + dev->print_name()); +- Dmsg1(50, "Media Type change. New device %s chosen.\n", dev->print_name()); ++ Dmsg1(50, "Media Type change. New read device %s chosen.\n", dev->print_name()); + + bstrncpy(dcr->VolumeName, vol->VolumeName, sizeof(dcr->VolumeName)); + bstrncpy(dcr->VolCatInfo.VolCatName, vol->VolumeName, sizeof(dcr->VolCatInfo.VolCatName)); +@@ -430,11 +430,14 @@ + dcr->clear_reserved(); + + if (dev->can_read()) { ++ VOLUME_CAT_INFO *vol = &dev->VolCatInfo; + dev->clear_read(); /* clear read bit */ +- Dmsg0(100, "dir_update_vol_info. Release0\n"); +- dir_update_volume_info(dcr, false, false); /* send Volume info to Director */ +- volume_unused(dcr); +- ++ Dmsg2(000, "dir_update_vol_info. label=%d Vol=%s\n", ++ dev->is_labeled(), vol->VolCatName); ++ if (dev->is_labeled() && vol->VolCatName[0] != 0) { ++ dir_update_volume_info(dcr, false, false); /* send Volume info to Director */ ++ volume_unused(dcr); ++ } + } else if (dev->num_writers > 0) { + /* + * Note if WEOT is set, we are at the end of the tape -- 2.39.5