From: Kern Sibbald Date: Mon, 7 Jul 2008 08:28:21 +0000 (+0000) Subject: Clear in-use bit on vol when unused while swapping X-Git-Tag: Release-2.4.1~4 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=67a6209f5543078b56435cc19f070350f188c6f7;p=bacula%2Fbacula Clear in-use bit on vol when unused while swapping git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/branches/Branch-2.4@7328 91ce42f0-d328-0410-95d8-f526ca767f89 --- diff --git a/bacula/src/stored/reserve.c b/bacula/src/stored/reserve.c index adc3bfaa85..6532634c8e 100644 --- a/bacula/src/stored/reserve.c +++ b/bacula/src/stored/reserve.c @@ -337,8 +337,6 @@ VOLRES *reserve_volume(DCR *dcr, const char *VolumeName) if (strcmp(vol->vol_name, VolumeName) == 0) { Dmsg3(dbglvl, "jid=%u === set reserved vol=%s dev=%s\n", jid(), VolumeName, vol->dev->print_name()); - vol->set_in_use(); /* retake vol if released previously */ - dcr->reserved_volume = true; /* reserved volume */ goto get_out; /* Volume already on this device */ } else { /* Don't release a volume if it was reserved by someone other than us */ @@ -534,6 +532,8 @@ bool volume_unused(DCR *dcr) if (!dev->vol) { Dmsg2(dbglvl, "jid=%u vol_unused: no vol on %s\n", (int)dcr->jcr->JobId, dev->print_name()); + Dmsg1(dbglvl, "=== clear in_use vol=%s\n", dev->vol->vol_name); + dev->vol->clear_in_use(); debug_list_volumes("null vol cannot unreserve_volume"); return false; } @@ -543,19 +543,6 @@ bool volume_unused(DCR *dcr) return false; } -#ifdef xxx - if (dev->is_busy()) { - Dmsg2(dbglvl, "jid=%u vol_unused: busy on %s\n", (int)dcr->jcr->JobId, dev->print_name()); - debug_list_volumes("dev busy cannot unreserve_volume"); - return false; - } -#endif -#ifdef xxx - if (dev->num_writers > 0 || dev->num_reserved() > 0) { - ASSERT(0); - } -#endif - /* * If this is a tape, we do not free the volume, rather we wait * until the autoloader unloads it, or until another tape is @@ -564,6 +551,7 @@ bool volume_unused(DCR *dcr) */ Dmsg5(dbglvl, "jid=%u === set not reserved vol=%s num_writers=%d dev_reserved=%d dev=%s\n", jid(), dev->vol->vol_name, dev->num_writers, dev->num_reserved(), dev->print_name()); + Dmsg1(dbglvl, "=== clear in_use vol=%s\n", dev->vol->vol_name); dev->vol->clear_in_use(); if (dev->is_tape() || dev->is_autochanger()) { return true; @@ -591,6 +579,7 @@ bool free_volume(DEVICE *dev) vol = dev->vol; /* Don't free a volume while it is being swapped */ if (!vol->is_swapping()) { + Dmsg1(dbglvl, "=== clear in_use vol=%s\n", dev->vol->vol_name); dev->vol = NULL; vol_list->remove(vol); Dmsg3(dbglvl, "jid=%u === remove volume %s dev=%s\n", jid(), vol->vol_name, dev->print_name()); diff --git a/bacula/src/version.h b/bacula/src/version.h index 3b436770a6..5997ad3148 100644 --- a/bacula/src/version.h +++ b/bacula/src/version.h @@ -4,8 +4,8 @@ #undef VERSION #define VERSION "2.4.1-b3" -#define BDATE "06 July 2008" -#define LSMDATE "06Jul08" +#define BDATE "07 July 2008" +#define LSMDATE "07Jul08" #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.4 b/bacula/technotes-2.4 index decd1de5e7..fc35bb86cc 100644 --- a/bacula/technotes-2.4 +++ b/bacula/technotes-2.4 @@ -2,6 +2,8 @@ General: +07Jul08 +kes Clear in-use bit on vol when unused while swapping. 06Jul08 kes Remove sleep at end of ./bacula kes Clear hash packet for hardlinked files correctly. This corrects