From: Kern Sibbald Date: Sat, 5 Jul 2008 13:35:28 +0000 (+0000) Subject: Apply Eric's patch to ensure that autoprune does not return X-Git-Tag: Release-2.4.1~7 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=4a16b34bcc8ba7c9a7e2bb39987314ce5107c3c6;p=bacula%2Fbacula Apply Eric's patch to ensure that autoprune does not return 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 --- diff --git a/bacula/src/dird/autoprune.c b/bacula/src/dird/autoprune.c index 38aab4f4a5..8f6f400faf 100644 --- a/bacula/src/dird/autoprune.c +++ b/bacula/src/dird/autoprune.c @@ -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. diff --git a/bacula/technotes-2.4 b/bacula/technotes-2.4 index 1baa7da3fb..ae6d9c3f73 100644 --- a/bacula/technotes-2.4 +++ b/bacula/technotes-2.4 @@ -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