]> git.sur5r.net Git - bacula/bacula/blobdiff - bacula/src/stored/dircmd.c
Prevent a Volume that is being swapped from being freed from
[bacula/bacula] / bacula / src / stored / dircmd.c
index 95a05e075abd295baa0db0702fcedf11c9656cf1..411d6687a369d7fd622b79417c907cf177bfe490 100644 (file)
@@ -1,7 +1,7 @@
 /*
    Bacula® - The Network Backup Solution
 
-   Copyright (C) 2001-2007 Free Software Foundation Europe e.V.
+   Copyright (C) 2001-2008 Free Software Foundation Europe e.V.
 
    The main author of Bacula is Kern Sibbald, with contributions from
    many others, a complete list can be found in the file AUTHORS.
@@ -515,6 +515,7 @@ bail_out:
    if (!dev->is_open()) {
       dev->clear_volhdr();
    }
+   volume_unused(dcr);                   /* no longer using volume */
    give_back_device_lock(dev, &hold);
    return;
 }
@@ -548,6 +549,7 @@ static bool read_label(DCR *dcr)
       ok = false;
       break;
    }
+   volume_unused(dcr);
    give_back_device_lock(dev, &hold);
    return ok;
 }
@@ -913,7 +915,7 @@ static bool release_cmd(JCR *jcr)
          } else {                     /* device not being used */
             Dmsg0(90, "Device not in use, releaseing\n");
             unload_autochanger(dcr, -1);
-            release_volume(dcr);
+            dcr->release_volume();
             dir->fsend(_("3022 Device %s released.\n"), 
                dev->print_name());
          }