From: Kern Sibbald Date: Sat, 21 Apr 2007 05:54:29 +0000 (+0000) Subject: kes Don't call close_part in label.c if tape and relabel. X-Git-Tag: Release-7.0.0~6552 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=1f9458e131dd06cdac8e3b46fa3bd9598053b630;p=bacula%2Fbacula kes Don't call close_part in label.c if tape and relabel. kes Don't free volume if busy in close() -- should help with bug 801. git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@4576 91ce42f0-d328-0410-95d8-f526ca767f89 --- diff --git a/bacula/kernstodo b/bacula/kernstodo index 7426dc36a2..b80dacf5b8 100644 --- a/bacula/kernstodo +++ b/bacula/kernstodo @@ -43,6 +43,12 @@ Document: Priority: +- the director seg faulted when I omitted the pool directive from a +job resource. I was experimenting and thought it redundant that I had +specified Pool, Full Backup Pool. and Differential Backup Pool. but +apparently not. This happened when I removed the pool directive and +started the director. + - On restore add Restore Client, Original Client. 01-Apr 00:42 rufus-dir: Start Backup JobId 55, Job=kernsave.2007-04-01_00.42.48 01-Apr 00:42 rufus-sd: Python SD JobStart: JobId=55 Client=Rufus diff --git a/bacula/src/stored/autochanger.c b/bacula/src/stored/autochanger.c index be656ff337..dc6dae98c1 100644 --- a/bacula/src/stored/autochanger.c +++ b/bacula/src/stored/autochanger.c @@ -1,15 +1,7 @@ -/* - * - * Routines for handling the autochanger. - * - * Kern Sibbald, August MMII - * - * Version $Id$ - */ /* Bacula® - The Network Backup Solution - Copyright (C) 2002-2006 Free Software Foundation Europe e.V. + Copyright (C) 2002-2007 Free Software Foundation Europe e.V. The main author of Bacula is Kern Sibbald, with contributions from many others, a complete list can be found in the file AUTHORS. @@ -33,6 +25,14 @@ (FSFE), Fiduciary Program, Sumatrastrasse 25, 8006 Zürich, Switzerland, email:ftf@fsfeurope.org. */ +/* + * + * Routines for handling the autochanger. + * + * Kern Sibbald, August MMII + * + * Version $Id$ + */ #include "bacula.h" /* pull in global headers */ #include "stored.h" /* pull in Storage Deamon headers */ diff --git a/bacula/src/stored/dev.c b/bacula/src/stored/dev.c index 445a43e658..4c9e0d20c0 100644 --- a/bacula/src/stored/dev.c +++ b/bacula/src/stored/dev.c @@ -1849,7 +1849,10 @@ void DEVICE::clrerror(int func) */ void DEVICE::clear_volhdr() { - free_volume(this); + /* If we have an unused volume associated with this drive, free it */ + if (vol && !is_busy()) { + free_volume(this); + } Dmsg1(100, "Clear volhdr vol=%s\n", VolHdr.VolumeName); memset(&VolHdr, 0, sizeof(VolHdr)); } diff --git a/bacula/src/stored/device.c b/bacula/src/stored/device.c index 4ea7232d39..b654f28cd5 100644 --- a/bacula/src/stored/device.c +++ b/bacula/src/stored/device.c @@ -431,11 +431,10 @@ void DEVICE::r_dlock() */ void _block_device(const char *file, int line, DEVICE *dev, int state) { - Dmsg3(sd_dbglvl, "block set %d from %s:%d\n", state, file, line); - ASSERT(dev->blocked() == BST_NOT_BLOCKED); dev->set_blocked(state); /* make other threads wait */ dev->no_wait_id = pthread_self(); /* allow us to continue */ + Dmsg3(sd_dbglvl, "set blocked=%s from %s:%d\n", dev->print_blocked(), file, line); } /* diff --git a/bacula/src/stored/label.c b/bacula/src/stored/label.c index 746516cce5..e7fb9ee89f 100644 --- a/bacula/src/stored/label.c +++ b/bacula/src/stored/label.c @@ -321,8 +321,8 @@ bool write_new_volume_label_to_dev(DCR *dcr, const char *VolName, goto bail_out; } - if (relabel) { - dev->close_part(dcr); /* make sure closed for rename */ + if (relabel && !dev->is_tape()) { + dev->close_part(dcr); /* make sure DVD/file closed for rename */ } /* Set the new filename for open, ... */ diff --git a/bacula/src/stored/reserve.c b/bacula/src/stored/reserve.c index 2b7797b801..bea00ddda1 100644 --- a/bacula/src/stored/reserve.c +++ b/bacula/src/stored/reserve.c @@ -279,7 +279,6 @@ VOLRES *reserve_volume(DCR *dcr, const char *VolumeName) * when adding a new volume that no newly scheduled * job can reserve it. */ -// lock_reservations(); P(vol_list_lock); debug_list_volumes("begin reserve_volume", debug_nolock); /* @@ -350,7 +349,6 @@ VOLRES *reserve_volume(DCR *dcr, const char *VolumeName) get_out: debug_list_volumes("end new volume", debug_nolock); V(vol_list_lock); -// unlock_reservations(); return vol; } diff --git a/bacula/src/version.h b/bacula/src/version.h index 49f70cc07b..d35b786d65 100644 --- a/bacula/src/version.h +++ b/bacula/src/version.h @@ -4,8 +4,8 @@ #undef VERSION #define VERSION "2.1.8" -#define BDATE "18 April 2007" -#define LSMDATE "18Apr07" +#define BDATE "20 April 2007" +#define LSMDATE "20Apr07" #define PROG_COPYRIGHT "Copyright (C) %d-2007 Free Software Foundation Europe e.V.\n" #define BYEAR "2007" /* year for copyright messages in progs */ diff --git a/bacula/technotes-2.1 b/bacula/technotes-2.1 index 412bdf3983..ee036e8811 100644 --- a/bacula/technotes-2.1 +++ b/bacula/technotes-2.1 @@ -2,6 +2,9 @@ General: 20Apr07 +kes Don't call close_part in label.c if tape and relabel. +kes Don't free volume if busy in close() -- should help with + bug 801. ebl Fix #824 RunScript bug (After script could be execute twice) Now, Before Script can use RunsOnSuccess and RunsOnFailure options By default (like before) RunsOnSuccess=true and RunsOnFailure=false