]> git.sur5r.net Git - bacula/bacula/commitdiff
Apply Eric's patch to ensure that autoprune does not return
authorKern Sibbald <kern@sibbald.com>
Sat, 5 Jul 2008 13:35:28 +0000 (13:35 +0000)
committerKern Sibbald <kern@sibbald.com>
Sat, 5 Jul 2008 13:35:28 +0000 (13:35 +0000)
     a Volume not in the autochanger unless requested to do so.

git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/branches/Branch-2.4@7320 91ce42f0-d328-0410-95d8-f526ca767f89

bacula/src/dird/autoprune.c
bacula/technotes-2.4

index 38aab4f4a5b1d13a97020d7541bf19a850ba5a8f..8f6f400fafb60001bbd00f17d7f0d52de0c7eaba 100644 (file)
@@ -184,6 +184,17 @@ bool prune_volumes(JCR *jcr, bool InChanger, MEDIA_DBR *mr)
             prune_list.num_ids = 0;             /* reset count */
          }
          ok = is_volume_purged(ua, &lmr);
+
+         /*
+          * Check if this volume is available (InChanger + StorageId)
+          * If not, just skip this volume and try the next one
+          */
+         if (ok && InChanger) {
+            if (!lmr.InChanger || (lmr.StorageId != mr->StorageId)) {
+               ok = false;             /* skip this volume, ie not loadable */
+            }
+         }
+
          /*
           * If purged and not moved to another Pool, 
           *   then we stop pruning and take this volume.
index 1baa7da3fb727942d679633fc8501e2cde301a9c..ae6d9c3f73fdb1dbc7ddbe0db99332ecf3742fe5 100644 (file)
@@ -3,6 +3,8 @@
 General:
 
 05Jul08
+kes  Apply Eric's patch to ensure that autoprune does not return
+     a Volume not in the autochanger unless requested to do so.
 kes  Correct bat restore display of multiple drives. This fixes    
      bug #1117.
 kes  Do find_a_volume() each time an unload is done. This