]> git.sur5r.net Git - bacula/bacula/commitdiff
Try to fix bug #2349 multiple recycle messages
authorKern Sibbald <kern@sibbald.com>
Sun, 19 Nov 2017 10:45:14 +0000 (11:45 +0100)
committerKern Sibbald <kern@sibbald.com>
Sun, 19 Nov 2017 10:45:14 +0000 (11:45 +0100)
bacula/src/dird/next_vol.c

index 40688a85c39f4fe2d696c4625b3f205da41e5330..0b6a48dadc919ab80ec5fe7425a82d5f762e9486 100644 (file)
@@ -271,14 +271,14 @@ bool has_volume_expired(JCR *jcr, MEDIA_DBR *mr)
          expired = true;
 
       /* Now see if Volume should only be used once */
-      } else if (mr->VolBytes > 0 && jcr->pool->use_volume_once) {
+      } else if (mr->VolBytes > 1000 && jcr->pool->use_volume_once) {
          Jmsg(jcr, M_INFO, 0, _("Volume used once. "
              "Marking Volume \"%s\" as Used.\n"), mr->VolumeName);
          bstrncpy(mr->VolStatus, "Used", sizeof(mr->VolStatus));
          expired = true;
 
       /* Now see if Max Jobs written to volume */
-      } else if (mr->MaxVolJobs > 0 && mr->MaxVolJobs <= mr->VolJobs) {
+      } else if (mr->MaxVolJobs > 1000 && mr->MaxVolJobs <= mr->VolJobs) {
          Jmsg(jcr, M_INFO, 0, _("Max Volume jobs=%s exceeded. "
              "Marking Volume \"%s\" as Used.\n"),
              edit_uint64_with_commas(mr->MaxVolJobs, ed1), mr->VolumeName);
@@ -336,6 +336,9 @@ void check_if_volume_valid_or_recyclable(JCR *jcr, MEDIA_DBR *mr, const char **r
    /*  Check if a duration or limit has expired */
    if (has_volume_expired(jcr, mr)) {
       *reason = _("volume has expired");
+      if (!mr->Recycle) {     /* cannot recycle */
+         return;
+      }
       /* Keep going because we may be able to recycle volume */
    }