From f74262d5d5b2062b60d39b26e31925890160de4b Mon Sep 17 00:00:00 2001 From: Kern Sibbald Date: Sat, 21 Jun 2008 09:49:53 +0000 Subject: [PATCH] Fix bug where SD did not ask operator if the device could not be opened. Reported by Eric. git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/branches/Branch-2.4@7204 91ce42f0-d328-0410-95d8-f526ca767f89 --- bacula/src/stored/mount.c | 10 ++++++++-- bacula/src/version.h | 4 ++-- bacula/technotes-2.3 | 3 +++ 3 files changed, 13 insertions(+), 4 deletions(-) diff --git a/bacula/src/stored/mount.c b/bacula/src/stored/mount.c index 98c3b80b3e..26d0cb224f 100644 --- a/bacula/src/stored/mount.c +++ b/bacula/src/stored/mount.c @@ -159,6 +159,7 @@ mount_next_vol: } else { autochanger = false; VolCatInfo.Slot = 0; + ask = true; } Dmsg1(150, "autoload_dev returns %d\n", autochanger); /* @@ -177,7 +178,6 @@ mount_next_vol: ask = false; } Dmsg2(150, "Ask=%d autochanger=%d\n", ask, autochanger); - dev->must_unload(); /* release next time if we "recurse" */ if (ask && !dir_ask_sysop_to_mount_volume(dcr, ST_APPEND)) { Dmsg0(150, "Error return ask_sysop ...\n"); @@ -225,15 +225,20 @@ mount_next_vol: if (try_autolabel(false) == try_read_vol) { break; /* created a new volume label */ } + dev->set_unload(); /* force ask sysop */ + ask = true; + goto mount_next_vol; +#ifdef xxx /* If DVD, ignore the error, very often you cannot open the device * (when there is no DVD, or when the one inserted is a wrong one) */ if (dev->poll || dev->is_dvd()) { goto mount_next_vol; } else { - Jmsg(jcr, M_ERROR, 0, _("Could not open device %s: ERR=%s\n"), + Jmsg2(jcr, M_ERROR, 0, _("Could not open device %s: ERR=%s\n"), dev->print_name(), dev->print_errmsg()); goto bail_out; } +#endif } /* @@ -243,6 +248,7 @@ read_volume: switch (check_volume_label(ask, autochanger)) { case check_next_vol: + dev->set_unload(); /* want a different Volume */ goto mount_next_vol; case check_read_vol: goto read_volume; diff --git a/bacula/src/version.h b/bacula/src/version.h index 38184a7201..df9bb20460 100644 --- a/bacula/src/version.h +++ b/bacula/src/version.h @@ -4,8 +4,8 @@ #undef VERSION #define VERSION "2.4.1" -#define BDATE "19 June 2008" -#define LSMDATE "19Jun08" +#define BDATE "20 June 2008" +#define LSMDATE "20Jun08" #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 a0935c96bb..3d92b99976 100644 --- a/bacula/technotes-2.3 +++ b/bacula/technotes-2.3 @@ -1,6 +1,9 @@ Technical notes on version 2.2 General: +20Jun08 +kes Fix bug where SD did not ask operator if the device could not + be opened. Reported by Eric. 19Jun08 kes Add dbuser to DIR conf file (replaces user). kes Add --with-db-password to ./configure -- 2.39.5