]> git.sur5r.net Git - bacula/bacula/commitdiff
Fix concurrent Job recycle bug #1288
authorKern Sibbald <kern@sibbald.com>
Mon, 5 Oct 2009 12:57:38 +0000 (14:57 +0200)
committerKern Sibbald <kern@sibbald.com>
Mon, 5 Oct 2009 13:27:07 +0000 (15:27 +0200)
bacula/src/dird/next_vol.c

index 462d4550237e8e14cc04d0e105fd4197fe8c62a4..5a973b8b6fd3b591079f768d778f51e86208cee0 100644 (file)
@@ -1,7 +1,7 @@
 /*
    Bacula® - The Network Backup Solution
 
-   Copyright (C) 2001-2008 Free Software Foundation Europe e.V.
+   Copyright (C) 2001-2009 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.
@@ -260,11 +260,6 @@ void check_if_volume_valid_or_recyclable(JCR *jcr, MEDIA_DBR *mr, const char **r
 
    *reason = NULL;
 
-   if (!mr->Recycle) {
-      *reason = _("volume has recycling disabled");
-      return;
-   }
-
    /*  Check if a duration or limit has expired */
    if (has_volume_expired(jcr, mr)) {
       *reason = _("volume has expired");
@@ -304,8 +299,12 @@ void check_if_volume_valid_or_recyclable(JCR *jcr, MEDIA_DBR *mr, const char **r
     * it now possible to reuse it for the job that it is currently
     * needed for?
     */
+   if (!mr->Recycle) {
+      *reason = _("volume has recycling disabled");
+      return;
+   }
    if ((mr->LastWritten + mr->VolRetention) < (utime_t)time(NULL)
-         && mr->Recycle && jcr->pool->recycle_current_volume
+         && jcr->pool->recycle_current_volume
          && (strcmp(mr->VolStatus, "Full") == 0 ||
             strcmp(mr->VolStatus, "Used") == 0)) {
       /*