]> git.sur5r.net Git - bacula/bacula/commitdiff
ebl Fix #1173 where prune_volume() returns a volume from the scratch.
authorEric Bollengier <eric@eb.homelinux.org>
Mon, 27 Oct 2008 18:38:55 +0000 (18:38 +0000)
committerEric Bollengier <eric@eb.homelinux.org>
Mon, 27 Oct 2008 18:38:55 +0000 (18:38 +0000)
git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@7916 91ce42f0-d328-0410-95d8-f526ca767f89

bacula/src/dird/autoprune.c
bacula/src/dird/next_vol.c
bacula/technotes-2.5

index 1eaaeb10d4dce743a1a155d0ded60fca8149285e..a80386cbfd75ae2d731cc67d8dc5e2d3cbfb078c 100644 (file)
@@ -204,13 +204,6 @@ bool prune_volumes(JCR *jcr, bool InChanger, MEDIA_DBR *mr)
             memcpy(mr, &lmr, sizeof(lmr));
             break;                        /* got a volume */
          }
-         /*
-          * We purged something but did not get a volume in the current pool.
-          *  It must be a scratch volume, so try to get it.
-          */
-         if (ok && get_scratch_volume(jcr, InChanger, mr)) {
-            break;                       /* got a volume */
-         }
          ok = false;                     /* clear OK, in case we fall out */
       } else {
          Dmsg2(050, "Nothing pruned MediaId=%d Volume=%s\n", (int)lmr.MediaId, lmr.VolumeName);
index a86342bbfc2a41fafb7b2f66cbeb9740a19816a8..b070b7777c83159825c1ccb6aba0f334f58162ed 100644 (file)
@@ -94,28 +94,30 @@ int find_next_volume_for_append(JCR *jcr, MEDIA_DBR *mr, int index,
                 */
                if (prune) {
                   Dmsg0(150, "Call prune_volumes\n");
-                  prune_volumes(jcr, InChanger, mr);
+                  ok = prune_volumes(jcr, InChanger, mr);
                }
-               ok = recycle_oldest_purged_volume(jcr, InChanger, mr);
-               if (!ok && create) {
-                  Dmsg4(050, "after prune volumes_vol ok=%d index=%d InChanger=%d Vstat=%s\n",
-                        ok, index, InChanger, mr->VolStatus);
-                  /*
-                   * 5. Try pulling a volume from the Scratch pool
-                   */ 
-                  ok = get_scratch_volume(jcr, InChanger, mr);
-               }
-               /*
-                * If we are using an Autochanger and have not found
-                * a volume, retry looking for any volume. 
-                */
-               if (InChanger) {
-                  InChanger = false;
-                  if (!ok) {
-                     continue;           /* retry again accepting any volume */
-                  }
-               }
-            }
+              if (!ok) {
+                 ok = recycle_oldest_purged_volume(jcr, InChanger, mr);
+                 if (!ok && create) {
+                    Dmsg4(050, "after prune volumes_vol ok=%d index=%d InChanger=%d Vstat=%s\n",
+                          ok, index, InChanger, mr->VolStatus);
+                    /*
+                     * 5. Try pulling a volume from the Scratch pool
+                     */ 
+                    ok = get_scratch_volume(jcr, InChanger, mr);
+                    Dmsg4(050, "after get scratch volume ok=%d index=%d InChanger=%d Vstat=%s\n",
+                          ok, index, InChanger, mr->VolStatus);
+                 }
+                 /*
+                  * If we are using an Autochanger and have not found
+                  * a volume, retry looking for any volume. 
+                  */
+                 if (!ok && InChanger) {
+                    InChanger = false;
+                    continue;           /* retry again accepting any volume */
+                 }
+              }
+           }
          }
 
 
index 070f53538ac4e80cca98cb3da6740f4dde6b7ca8..7f16dbf91994098f5afd86b432c2dd493763cd09 100644 (file)
@@ -10,6 +10,8 @@ filepattern (restore with regex in bsr)
 mixed priorities
 
 General:
+27Oct08
+ebl  Fix #1173 where prune_volume() returns a volume from the scratch.
 25Oct08
 kes  Remove jobq.c constraint that read and write SD must be
      different. This may lead to more deadlocks in the SD,