[prev in list] [next in list] [prev in thread] [next in thread] 

List:       bacula-commits
Subject:    [Bacula-commits] git: Bacula branch, Branch-5.1,
From:       "Kern Sibbald" <kerns () users ! sourceforge ! net>
Date:       2011-02-24 16:40:03
Message-ID: E1PseEf-0002En-SL () sfs-ml-3 ! v29 ! ch3 ! sourceforge ! com
[Download RAW message or body]

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Bacula".

The branch, Branch-5.1 has been updated
       via  adcc28e21dcb66b9e5f538ccbea28bfcd6fd49e7 (commit)
       via  d886c970282a5dbe205949a907ac10e0ac810ce3 (commit)
       via  a5ea0ef59fefbcf31c596a1265fe8ec79c80dc83 (commit)
       via  4b9af8e66a4d066a205e3873e724f70314023f19 (commit)
       via  cbc2819f502282151ac387e574bb1247691285f5 (commit)
       via  1454b8a07f1d8a2498b6dda72a640be15b4d912d (commit)
       via  aeb4d66e68a753045033721eaa5aa656cc5c6c2a (commit)
      from  64732ce01e39bc4d2787a84f33892ad4b03dcead (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit adcc28e21dcb66b9e5f538ccbea28bfcd6fd49e7
Author: Kern Sibbald <kern@sibbald.com>
Date:   Thu Feb 24 17:22:44 2011 +0100

    Fix week of year schduling bug #1699

commit d886c970282a5dbe205949a907ac10e0ac810ce3
Author: Kern Sibbald <kern@sibbald.com>
Date:   Thu Feb 24 13:12:27 2011 +0100

    Comment out unused variables in tray-monitor

commit a5ea0ef59fefbcf31c596a1265fe8ec79c80dc83
Author: Kern Sibbald <kern@sibbald.com>
Date:   Thu Feb 24 13:12:02 2011 +0100

    Fix uninitialized variable in bat

commit 4b9af8e66a4d066a205e3873e724f70314023f19
Author: Kern Sibbald <kern@sibbald.com>
Date:   Thu Feb 24 12:56:22 2011 +0100

    Fix lock race conditions in bug #1675

commit cbc2819f502282151ac387e574bb1247691285f5
Author: Kern Sibbald <kern@sibbald.com>
Date:   Thu Feb 24 07:52:45 2011 +0100

    Add missing code for rename incomplete to rerunning

commit 1454b8a07f1d8a2498b6dda72a640be15b4d912d
Author: Kern Sibbald <kern@sibbald.com>
Date:   Thu Feb 24 07:51:16 2011 +0100

    Rename incomplete to rerunning for clarity

commit aeb4d66e68a753045033721eaa5aa656cc5c6c2a
Author: Kern Sibbald <kern@sibbald.com>
Date:   Wed Feb 23 21:51:42 2011 +0100

    Fix bug #1700 no timestamp with -dt on Windows

-----------------------------------------------------------------------

Summary of changes:
diff --git a/bacula/src/dird/backup.c b/bacula/src/dird/backup.c
index b1b5d7a..ddedd95 100644
--- a/bacula/src/dird/backup.c
+++ b/bacula/src/dird/backup.c
@@ -246,7 +246,7 @@ bool send_accurate_current_files(JCR *jcr)
    if (jcr->is_canceled() || jcr->is_JobLevel(L_BASE)) {
       return true;
    }
-   if (!jcr->accurate && !jcr->incomplete) {
+   if (!jcr->accurate && !jcr->rerunning) {
       return true;
    }
 
@@ -255,7 +255,7 @@ bool send_accurate_current_files(JCR *jcr)
       if (get_base_jobids(jcr, &jobids)) {
          jcr->HasBase = true;
          Jmsg(jcr, M_INFO, 0, _("Using BaseJobId(s): %s\n"), jobids.list);
-      } else if (!jcr->incomplete) {
+      } else if (!jcr->rerunning) {
          return true;
       }
    } else {
@@ -270,7 +270,7 @@ bool send_accurate_current_files(JCR *jcr)
    }
 
    /* For incomplete Jobs, we add our own id */
-   if (jcr->incomplete) {
+   if (jcr->rerunning) {
       edit_int64(jcr->JobId, ed1);   
       jobids.add(ed1);
    }
@@ -332,7 +332,7 @@ bool do_backup(JCR *jcr)
    }
 
    /* Print Job Start message */
-   if (jcr->incomplete) {
+   if (jcr->rerunning) {
       Jmsg(jcr, M_INFO, 0, _("Restart Incomplete Backup JobId %s, Job=%s\n"),
            edit_uint64(jcr->JobId, ed1), jcr->Job);
    } else {
@@ -348,7 +348,7 @@ bool do_backup(JCR *jcr)
    }
 
    /* For incomplete Jobs, we add our own id */
-   if (jcr->incomplete) {
+   if (jcr->rerunning) {
       edit_int64(jcr->JobId, ed1);   
       Mmsg(buf, "SELECT max(FileIndex) FROM File WHERE JobId=%s", ed1);
       if (db_sql_query(jcr->db, buf.c_str(), db_int64_handler, &job)) {
diff --git a/bacula/src/dird/fd_cmds.c b/bacula/src/dird/fd_cmds.c
index 1eb0399..c192973 100644
--- a/bacula/src/dird/fd_cmds.c
+++ b/bacula/src/dird/fd_cmds.c
@@ -311,25 +311,25 @@ bool send_level_command(JCR *jcr)
    BSOCK   *fd = jcr->file_bsock;
    const char *accurate = jcr->accurate?"accurate_":"";
    const char *not_accurate = "";
-   const char *incomplete = jcr->incomplete?" incomplete ":" ";
+   const char *rerunning = jcr->rerunning?" rerunning ":" ";
    /*
     * Send Level command to File daemon
     */
    switch (jcr->getJobLevel()) {
    case L_BASE:
-      fd->fsend(levelcmd, not_accurate, "base", incomplete, 0);
+      fd->fsend(levelcmd, not_accurate, "base", rerunning, 0);
       break;
    /* L_NONE is the console, sending something off to the FD */
    case L_NONE:
    case L_FULL:
-      fd->fsend(levelcmd, not_accurate, "full", incomplete, 0);
+      fd->fsend(levelcmd, not_accurate, "full", rerunning, 0);
       break;
    case L_DIFFERENTIAL:
-      fd->fsend(levelcmd, accurate, "differential", incomplete, 0);
+      fd->fsend(levelcmd, accurate, "differential", rerunning, 0);
       send_since_time(jcr);
       break;
    case L_INCREMENTAL:
-      fd->fsend(levelcmd, accurate, "incremental", incomplete, 0);
+      fd->fsend(levelcmd, accurate, "incremental", rerunning, 0);
       send_since_time(jcr);
       break;
    case L_SINCE:
diff --git a/bacula/src/dird/jobq.c b/bacula/src/dird/jobq.c
index 7c19ac6..4e05cbd 100644
--- a/bacula/src/dird/jobq.c
+++ b/bacula/src/dird/jobq.c
@@ -637,7 +637,7 @@ static bool reschedule_job(JCR *jcr, jobq_t *jq, jobq_item_t *je)
         * Reschedule this job by cleaning it up, but
         *  reuse the same JobId if possible.
         */
-      jcr->incomplete = jcr->is_incomplete();   /* save incomplete status */
+      jcr->rerunning = jcr->is_incomplete();   /* save incomplete status */
       time_t now = time(NULL);
       jcr->reschedule_count++;
       jcr->sched_time = now + jcr->job->RescheduleInterval;
@@ -656,7 +656,7 @@ static bool reschedule_job(JCR *jcr, jobq_t *jq, jobq_item_t *je)
          return false;
       }
       /* Only jobs with no output or Incomplete jobs can run on same JCR */
-      if (jcr->JobBytes == 0 || jcr->incomplete) {
+      if (jcr->JobBytes == 0 || jcr->rerunning) {
          Dmsg2(2300, "Requeue job=%d use=%d\n", jcr->JobId, jcr->use_count());
          V(jq->mutex);
          jobq_add(jq, jcr);     /* queue the job to run again */
diff --git a/bacula/src/dird/msgchan.c b/bacula/src/dird/msgchan.c
index 2b1d3f5..b3f5e8f 100644
--- a/bacula/src/dird/msgchan.c
+++ b/bacula/src/dird/msgchan.c
@@ -51,7 +51,7 @@ static pthread_mutex_t mutex = PTHREAD_MUTEX_INITIALIZER;
 static char jobcmd[]     = "JobId=%s job=%s job_name=%s client_name=%s "
    "type=%d level=%d FileSet=%s NoAttr=%d SpoolAttr=%d FileSetMD5=%s "
    "SpoolData=%d WritePartAfterJob=%d PreferMountedVols=%d SpoolSize=%s "
-   "incomplete=%d VolSessionId=%d VolSessionTime=%d\n";
+   "rerunning=%d VolSessionId=%d VolSessionTime=%d\n";
 static char use_storage[] = "use storage=%s media_type=%s pool_name=%s "
    "pool_type=%s append=%d copy=%d stripe=%d\n";
 static char use_device[] = "use device=%s\n";
@@ -194,7 +194,7 @@ bool start_storage_daemon_job(JCR *jcr, alist *rstore, alist \
*wstore, bool send_  fileset_name.c_str(), !jcr->pool->catalog_files,
              jcr->job->SpoolAttributes, jcr->fileset->MD5, jcr->spool_data, 
              jcr->write_part_after_job, jcr->job->PreferMountedVolumes,
-             edit_int64(jcr->spool_size, ed2), jcr->incomplete,
+             edit_int64(jcr->spool_size, ed2), jcr->rerunning,
              jcr->VolSessionId, jcr->VolSessionTime);
    Dmsg1(100, ">stored: %s", sd->msg);
    if (bget_dirmsg(sd) > 0) {
diff --git a/bacula/src/dird/scheduler.c b/bacula/src/dird/scheduler.c
index 95c80be..866194d 100644
--- a/bacula/src/dird/scheduler.c
+++ b/bacula/src/dird/scheduler.c
@@ -1,7 +1,7 @@
 /*
    Bacula ® - The Network Backup Solution
 
-   Copyright (C) 2000-2009 Free Software Foundation Europe e.V.
+   Copyright (C) 2000-2011 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.
@@ -34,7 +34,6 @@
  *
  *     Kern Sibbald, May MM, major revision December MMIII
  *
- *   Version $Id$
  */
 
 #include "bacula.h"
@@ -296,7 +295,7 @@ static void find_runs()
    nh_month = tm.tm_mon;
    nh_year  = tm.tm_year;
    nh_wom = nh_mday / 7;
-   nh_woy = tm_woy(now);                     /* get week of year */
+   nh_woy = tm_woy(next_hour);              /* get week of year */
 
    Dmsg7(dbglvl, "nh = %x: h=%d m=%d md=%d wd=%d wom=%d woy=%d\n",
          next_hour, nh_hour, nh_month, nh_mday, nh_wday, nh_wom, nh_woy);
diff --git a/bacula/src/filed/accurate.c b/bacula/src/filed/accurate.c
index 57317bd..70ab5bb 100644
--- a/bacula/src/filed/accurate.c
+++ b/bacula/src/filed/accurate.c
@@ -190,7 +190,7 @@ bool accurate_finish(JCR *jcr)
    }
    if (jcr->accurate) {
       if (jcr->is_JobLevel(L_FULL)) {
-         if (!jcr->incomplete) {
+         if (!jcr->rerunning) {
             ret = accurate_send_base_file_list(jcr);
          }
       } else {
@@ -258,7 +258,7 @@ bool accurate_check_file(JCR *jcr, FF_PKT *ff_pkt)
 
    ff_pkt->delta_seq = 0;
 
-   if (!jcr->accurate && !jcr->incomplete) {
+   if (!jcr->accurate && !jcr->rerunning) {
       return true;
    }
 
@@ -285,7 +285,7 @@ bool accurate_check_file(JCR *jcr, FF_PKT *ff_pkt)
 
    decode_stat(elt.lstat, &statc, &LinkFIc); /* decode catalog stat */
 
-   if (!jcr->incomplete && (jcr->getJobLevel() == L_FULL)) {
+   if (!jcr->rerunning && (jcr->getJobLevel() == L_FULL)) {
       opts = ff_pkt->BaseJobOpts;
    } else {
       opts = ff_pkt->AccurateOpts;
@@ -391,7 +391,7 @@ bool accurate_check_file(JCR *jcr, FF_PKT *ff_pkt)
               ff_pkt->flags & (FO_MD5|FO_SHA1|FO_SHA256|FO_SHA512))) 
          {
 
-            if (!*elt.chksum && !jcr->incomplete) {
+            if (!*elt.chksum && !jcr->rerunning) {
                Jmsg(jcr, M_WARNING, 0, _("Cannot verify checksum for %s\n"),
                     ff_pkt->fname);
                stat = true;
diff --git a/bacula/src/filed/job.c b/bacula/src/filed/job.c
index 168d17a..23b0812 100644
--- a/bacula/src/filed/job.c
+++ b/bacula/src/filed/job.c
@@ -1556,8 +1556,8 @@ static int level_cmd(JCR *jcr)
    if (strstr(dir->msg, "accurate")) {
       jcr->accurate = true;
    }
-   if (strstr(dir->msg, "incomplete")) {
-      jcr->incomplete = true;
+   if (strstr(dir->msg, "rerunning")) {
+      jcr->rerunning = true;
    }
    if (sscanf(dir->msg, "level = %s ", level) != 1) {
       goto bail_out;
diff --git a/bacula/src/jcr.h b/bacula/src/jcr.h
index 24dbca6..adb760a 100644
--- a/bacula/src/jcr.h
+++ b/bacula/src/jcr.h
@@ -265,7 +265,7 @@ public:
    bool keep_path_list;               /* Keep newly created path in a hash */
    bool accurate;                     /* true if job is accurate */
    bool HasBase;                      /* True if job use base jobs */
-   bool incomplete;                   /* finishing an incomplete job */
+   bool rerunning;                    /* rerunning an incomplete job */
 
    void *Python_job;                  /* Python Job Object */
    void *Python_events;               /* Python Events Object */
diff --git a/bacula/src/lib/message.c b/bacula/src/lib/message.c
index 97a3a01..3d7fc0e 100644
--- a/bacula/src/lib/message.c
+++ b/bacula/src/lib/message.c
@@ -990,7 +990,7 @@ d_msg(const char *file, int line, int level, const char *fmt,...)
           len = strlen(buf);
           buf[len++] = ' ';
           buf[len] = 0;
-          fputs(buf, stdout);
+          pt_out(buf);
        }
     
 #ifdef FULL_LOCATION
diff --git a/bacula/src/qt-console/mainwin.cpp b/bacula/src/qt-console/mainwin.cpp
index 6984b03..eeaf966 100644
--- a/bacula/src/qt-console/mainwin.cpp
+++ b/bacula/src/qt-console/mainwin.cpp
@@ -778,7 +778,7 @@ void MainWin::closeCurrentPage()
 void MainWin::closePage(int item)
 {
    QTreeWidgetItem *currentitem;
-   Pages *page;
+   Pages *page = NULL;
 
    if (item >= 0) {
      page = (Pages *)tabWidget->widget(item);
diff --git a/bacula/src/qt-console/tray-monitor/tray-monitor.cpp \
b/bacula/src/qt-console/tray-monitor/tray-monitor.cpp index 9c64f48..345a535 100644
--- a/bacula/src/qt-console/tray-monitor/tray-monitor.cpp
+++ b/bacula/src/qt-console/tray-monitor/tray-monitor.cpp
@@ -52,8 +52,8 @@ static CONFIG *config;
 static TrayUI *tray;
 
 /* Data received from DIR/FD/SD */
-static char OKqstatus[]   = "%c000 OK .status\n";
-static char DotStatusJob[] = "JobId=%d JobStatus=%c JobErrors=%d\n";
+//static char OKqstatus[]   = "%c000 OK .status\n";
+//static char DotStatusJob[] = "JobId=%d JobStatus=%c JobErrors=%d\n";
 
 
 void updateStatusIcon(monitoritem* item);
diff --git a/bacula/src/stored/append.c b/bacula/src/stored/append.c
index 47af0d9..89c3716 100644
--- a/bacula/src/stored/append.c
+++ b/bacula/src/stored/append.c
@@ -193,7 +193,7 @@ bool do_append_data(JCR *jcr)
        * An incomplete job can start the file_index at any number.
        * otherwise, it must start at 1.
        */
-      if (jcr->incomplete && file_index > 0 && last_file_index == 0) {
+      if (jcr->rerunning && file_index > 0 && last_file_index == 0) {
          goto fi_checked;
       }
       if (file_index > 0 && (file_index == last_file_index ||
diff --git a/bacula/src/stored/autochanger.c b/bacula/src/stored/autochanger.c
index b01f4cf..b32656e 100644
--- a/bacula/src/stored/autochanger.c
+++ b/bacula/src/stored/autochanger.c
@@ -1,7 +1,7 @@
 /*
    Bacula ® - The Network Backup Solution
 
-   Copyright (C) 2002-2010 Free Software Foundation Europe e.V.
+   Copyright (C) 2002-2011 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.
@@ -321,8 +321,13 @@ static void lock_changer(DCR *dcr)
 {
    AUTOCHANGER *changer_res = dcr->device->changer_res;
    if (changer_res) {
+      int errstat;
       Dmsg1(200, "Locking changer %s\n", changer_res->hdr.name);
-      P(changer_res->changer_mutex);  /* Lock changer script */
+      if ((errstat=rwl_writelock(&changer_res->changer_lock)) != 0) {
+         berrno be;
+         Jmsg(dcr->jcr, M_ERROR_TERM, 0, _("Lock failure on autochanger. ERR=%s\n"),
+              be.bstrerror(errstat));
+      }
    }
 }
 
@@ -330,8 +335,13 @@ static void unlock_changer(DCR *dcr)
 {
    AUTOCHANGER *changer_res = dcr->device->changer_res;
    if (changer_res) {
+      int errstat;
       Dmsg1(200, "Unlocking changer %s\n", changer_res->hdr.name);
-      V(changer_res->changer_mutex);  /* Unlock changer script */
+      if ((errstat=rwl_writeunlock(&changer_res->changer_lock)) != 0) {
+         berrno be;
+         Jmsg(dcr->jcr, M_ERROR_TERM, 0, _("Unlock failure on autochanger. \
ERR=%s\n"), +              be.bstrerror(errstat));
+      }
    }
 }
 
@@ -364,6 +374,7 @@ bool unload_autochanger(DCR *dcr, int loaded)
       return true;
    }
 
+   lock_changer(dcr);
    if (loaded < 0) {
       loaded = get_autochanger_loaded_slot(dcr);
    }
@@ -371,7 +382,6 @@ bool unload_autochanger(DCR *dcr, int loaded)
    if (loaded > 0) {
       POOL_MEM results(PM_MESSAGE);
       POOLMEM *changer = get_pool_memory(PM_FNAME);
-      lock_changer(dcr);
       Jmsg(jcr, M_INFO, 0,
            _("3307 Issuing autochanger \"unload slot %d, drive %d\" command.\n"),
            loaded, dev->drive_index);
@@ -394,11 +404,11 @@ bool unload_autochanger(DCR *dcr, int loaded)
       } else {
          dev->set_slot(0);         /* nothing loaded */
       }
-      unlock_changer(dcr);
 
       free_volume(dev);            /* Free any volume associated with this drive */
       free_pool_memory(changer);
    }
+   unlock_changer(dcr);
    if (ok) {
       dev->clear_unload();
    }
diff --git a/bacula/src/stored/job.c b/bacula/src/stored/job.c
index 9fa42e1..c2d9259 100644
--- a/bacula/src/stored/job.c
+++ b/bacula/src/stored/job.c
@@ -49,7 +49,7 @@ extern bool do_mac(JCR *jcr);
 static char jobcmd[] = "JobId=%d job=%127s job_name=%127s client_name=%127s "
       "type=%d level=%d FileSet=%127s NoAttr=%d SpoolAttr=%d FileSetMD5=%127s "
       "SpoolData=%d WritePartAfterJob=%d PreferMountedVols=%d SpoolSize=%s "
-      "incomplete=%d VolSessionId=%d VolSessionTime=%d\n";
+      "rerunning=%d VolSessionId=%d VolSessionTime=%d\n";
 
 /* Responses sent to Director daemon */
 static char OKjob[]     = "3000 OK Job SDid=%u SDtime=%u Authorization=%s\n";
@@ -88,7 +88,7 @@ bool job_cmd(JCR *jcr)
               &JobType, &level, fileset_name.c_str(), &no_attributes,
               &spool_attributes, fileset_md5.c_str(), &spool_data,
               &write_part_after_job, &PreferMountedVols, spool_size,
-              &jcr->incomplete, &jcr->VolSessionId, &jcr->VolSessionTime);
+              &jcr->rerunning, &jcr->VolSessionId, &jcr->VolSessionTime);
    if (stat != 17) {
       pm_strcpy(jcr->errmsg, dir->msg);
       dir->fsend(BAD_job, stat, jcr->errmsg);
@@ -96,7 +96,7 @@ bool job_cmd(JCR *jcr)
       jcr->setJobStatus(JS_ErrorTerminated);
       return false;
    }
-   Dmsg3(100, "==== incomplete=%d VolSesId=%d VolSesTime=%d\n", jcr->incomplete,
+   Dmsg3(100, "==== rerunning=%d VolSesId=%d VolSesTime=%d\n", jcr->rerunning,
          jcr->VolSessionId, jcr->VolSessionTime);
    /*
     * Since this job could be rescheduled, we
@@ -115,7 +115,7 @@ bool job_cmd(JCR *jcr)
     * the Resched flag is set and VolSessionId and VolSessionTime
     * are given to us (same as restarted job).
     */
-   if (!jcr->incomplete) {
+   if (!jcr->rerunning) {
       jcr->VolSessionId = newVolSessionId();
       jcr->VolSessionTime = VolSessionTime;
    }
diff --git a/bacula/src/stored/stored_conf.c b/bacula/src/stored/stored_conf.c
index 11abee2..a9fc44d 100644
--- a/bacula/src/stored/stored_conf.c
+++ b/bacula/src/stored/stored_conf.c
@@ -457,6 +457,7 @@ void free_resource(RES *sres, int type)
       if (res->res_changer.device) {
          delete res->res_changer.device;
       }
+      rwl_destroy(&res->res_changer.changer_lock);
       break; 
    case R_STORAGE:
       if (res->res_store.sdaddrs) {
@@ -629,9 +630,9 @@ void save_resource(int type, RES_ITEM *items, int pass)
          foreach_alist(dev, res->res_changer.device) {
             dev->changer_res = (AUTOCHANGER *)&res->res_changer;
          }
-         if ((errstat = pthread_mutex_init(&res->res_changer.changer_mutex, NULL)) \
!= 0) { +         if ((errstat = rwl_init(&res->res_changer.changer_lock)) != 0) {
             berrno be;
-            Jmsg1(NULL, M_ERROR_TERM, 0, _("Unable to init mutex: ERR=%s\n"), 
+            Jmsg1(NULL, M_ERROR_TERM, 0, _("Unable to init lock: ERR=%s\n"), 
                   be.bstrerror(errstat));
          }
          break;
diff --git a/bacula/src/stored/stored_conf.h b/bacula/src/stored/stored_conf.h
index 7597ff0..13d8c74 100644
--- a/bacula/src/stored/stored_conf.h
+++ b/bacula/src/stored/stored_conf.h
@@ -1,7 +1,7 @@
 /*
    Bacula ® - The Network Backup Solution
 
-   Copyright (C) 2000-2009 Free Software Foundation Europe e.V.
+   Copyright (C) 2000-2011 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.
@@ -28,7 +28,6 @@
 /*
  * Resource codes -- they must be sequential for indexing
  *
- *   Version $Id$
  */
 
 enum {
@@ -110,7 +109,7 @@ public:
    alist *device;                     /* List of DEVRES device pointers */
    char *changer_name;                /* Changer device name */
    char *changer_command;             /* Changer command  -- external program */
-   pthread_mutex_t changer_mutex;     /* One changer operation at a time */
+   brwlock_t changer_lock;            /* One changer operation at a time */
 };
 
 /* Device specific definitions */
diff --git a/bacula/src/stored/vol_mgr.c b/bacula/src/stored/vol_mgr.c
index 788d644..e16e433 100644
--- a/bacula/src/stored/vol_mgr.c
+++ b/bacula/src/stored/vol_mgr.c
@@ -1,7 +1,7 @@
 /*
    Bacula ® - The Network Backup Solution
 
-   Copyright (C) 2000-2009 Free Software Foundation Europe e.V.
+   Copyright (C) 2000-2011 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.
@@ -32,8 +32,6 @@
  *
  *   Split from reserve.c October 2008
  *
- *   Version $Id: reserve.c 7380 2008-07-14 10:42:59Z kerns $
- *
  */
 
 #include "bacula.h"
@@ -611,12 +609,13 @@ bool free_volume(DEVICE *dev)
 {
    VOLRES *vol;
 
-   if (dev->vol == NULL) {
+   lock_volumes();
+   vol = dev->vol;
+   if (vol == NULL) {
       Dmsg1(dbglvl, "No vol on dev %s\n", dev->print_name());
+      unlock_volumes();
       return false;
    }
-   lock_volumes();
-   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", vol->vol_name);


hooks/post-receive
-- 
Bacula

------------------------------------------------------------------------------
Free Software Download: Index, Search & Analyze Logs and other IT data in 
Real-Time with Splunk. Collect, index and harness all the fast moving IT data 
generated by your applications, servers and devices whether physical, virtual
or in the cloud. Deliver compliance at lower cost and gain new business 
insights. http://p.sf.net/sfu/splunk-dev2dev 
_______________________________________________
Bacula-commits mailing list
Bacula-commits@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bacula-commits


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic