From 793eb2d6a649457031a8f7b22b0b744451e4dbe3 Mon Sep 17 00:00:00 2001 From: Kern Sibbald Date: Mon, 5 Oct 2009 14:57:38 +0200 Subject: [PATCH] Fix concurrent Job recycle bug #1288 --- bacula/src/dird/next_vol.c | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/bacula/src/dird/next_vol.c b/bacula/src/dird/next_vol.c index 462d455023..5a973b8b6f 100644 --- a/bacula/src/dird/next_vol.c +++ b/bacula/src/dird/next_vol.c @@ -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)) { /* -- 2.39.5