]> git.sur5r.net Git - bacula/bacula/blob - bacula/patches/testing/next_vol.patch
ebl Try to fix little bug in volume selection
[bacula/bacula] / bacula / patches / testing / next_vol.patch
1 Index: src/dird/next_vol.c
2 ===================================================================
3 --- src/dird/next_vol.c (revision 7148)
4 +++ src/dird/next_vol.c (working copy)
5 @@ -94,28 +94,30 @@
6                  */
7                 if (prune) {
8                    Dmsg0(150, "Call prune_volumes\n");
9 -                  prune_volumes(jcr, InChanger, mr);
10 +                  ok = prune_volumes(jcr, InChanger, mr);
11                 }
12 -               ok = recycle_oldest_purged_volume(jcr, InChanger, mr);
13 -               if (!ok && create) {
14 -                  Dmsg4(050, "after prune volumes_vol ok=%d index=%d InChanger=%d Vstat=%s\n",
15 -                        ok, index, InChanger, mr->VolStatus);
16 -                  /*
17 -                   * 5. Try pulling a volume from the Scratch pool
18 -                   */ 
19 -                  ok = get_scratch_volume(jcr, InChanger, mr);
20 -               }
21 -               /*
22 -                * If we are using an Autochanger and have not found
23 -                * a volume, retry looking for any volume. 
24 -                */
25 -               if (InChanger) {
26 -                  InChanger = false;
27 -                  if (!ok) {
28 -                     continue;           /* retry again accepting any volume */
29 -                  }
30 -               }
31 -            }
32 +              if (!ok) {
33 +                 ok = recycle_oldest_purged_volume(jcr, InChanger, mr);
34 +                 if (!ok && create) {
35 +                    Dmsg4(050, "after prune volumes_vol ok=%d index=%d InChanger=%d Vstat=%s\n",
36 +                          ok, index, InChanger, mr->VolStatus);
37 +                    /*
38 +                     * 5. Try pulling a volume from the Scratch pool
39 +                     */ 
40 +                    ok = get_scratch_volume(jcr, InChanger, mr);
41 +                    Dmsg4(050, "after get scratch volume ok=%d index=%d InChanger=%d Vstat=%s\n",
42 +                          ok, index, InChanger, mr->VolStatus);
43 +                 }
44 +                 /*
45 +                  * If we are using an Autochanger and have not found
46 +                  * a volume, retry looking for any volume. 
47 +                  */
48 +                 if (!ok && InChanger) {
49 +                    InChanger = false;
50 +                    continue;           /* retry again accepting any volume */
51 +                 }
52 +              }
53 +           }
54           }
55  
56