]> git.sur5r.net Git - bacula/bacula/commitdiff
Apply Eric's suggested volume_unused patch
authorKern Sibbald <kern@sibbald.com>
Mon, 7 Apr 2008 20:50:54 +0000 (20:50 +0000)
committerKern Sibbald <kern@sibbald.com>
Mon, 7 Apr 2008 20:50:54 +0000 (20:50 +0000)
git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@6754 91ce42f0-d328-0410-95d8-f526ca767f89

bacula/src/stored/acquire.c
bacula/src/stored/dev.h
bacula/src/version.h

index ae65592251c5d245369b223295c28a8afe717fd6..b930e64974140918dab509c5a32e9d4186c1cf3b 100644 (file)
@@ -530,11 +530,13 @@ bool release_device(DCR *dcr)
             Jmsg(jcr, M_FATAL, 0, _("Could not create JobMedia record for Volume=\"%s\" Job=%s\n"),
                dcr->VolCatInfo.VolCatName, jcr->Job);
          }
-         /* If no more writers, write an EOF */
+         /* If no more writers, and no errors, and wrote something, write an EOF */
          if (!dev->num_writers && dev->can_write() && dev->block_num > 0) {
             dev->weof(1);
             write_ansi_ibm_labels(dcr, ANSI_EOF_LABEL, dev->VolHdr.VolumeName);
-            volume_unused(dcr);
+         }
+         if (!dev->num_writers) {             /* if no more writers */
+            volume_unused(dcr);               /*  we obviously are not using the volume */
          }
          if (!dev->at_weot()) {
             dev->VolCatInfo.VolCatFiles = dev->file;   /* set number of files */
index 2e21e16f229a1302111e440627f3ce617c791651..7162dde092a9f0bcc612bb429d176f096a086844 100644 (file)
@@ -419,10 +419,13 @@ inline const char *DEVICE::print_name() const { return prt_name; }
  *  DCRs open, each pointing to a different device. 
  */
 class DCR {
+private:
+   bool m_dev_locked;                 /* set if dev already locked */
+
 public:
    dlink dev_link;                    /* link to attach to dev */
    JCR *jcr;                          /* pointer to JCR */
-   DEVICE *dev;                       /* pointer to device */
+   DEVICE * volatile dev;             /* pointer to device */
    DEVRES *device;                    /* pointer to device resource */
    DEV_BLOCK *block;                  /* pointer to block */
    DEV_RECORD *rec;                   /* pointer to record */
@@ -432,7 +435,6 @@ public:
    bool spooling;                     /* set when actually spooling */
    bool despooling;                   /* set when despooling */
    bool despool_wait;                 /* waiting for despooling */
-   bool m_dev_locked;                 /* set if dev already locked */
    bool NewVol;                       /* set if new Volume mounted */
    bool WroteVol;                     /* set if Volume written */
    bool NewFile;                      /* set when EOF written */
index 8bc07f9ce533070c26f552b485b95d4497863d0a..58c829d6080adc21bf927537c62b415c73ac4214 100644 (file)
@@ -4,8 +4,8 @@
 
 #undef  VERSION
 #define VERSION "2.3.16"
-#define BDATE   "06 April 2008"
-#define LSMDATE "06Apr08"
+#define BDATE   "07 April 2008"
+#define LSMDATE "07Apr08"
 
 #define PROG_COPYRIGHT "Copyright (C) %d-2008 Free Software Foundation Europe e.V.\n"
 #define BYEAR "2008"       /* year for copyright messages in progs */