]> git.sur5r.net Git - bacula/bacula/blobdiff - bacula/src/stored/mount.c
Backport new lock calls + debug for SD
[bacula/bacula] / bacula / src / stored / mount.c
index f59bb6ae370ee6ace0e08b90155012e4a7ef6d0a..dc1f38bc1927d543d64b4b373caf0cdc37b9c2a8 100644 (file)
@@ -243,7 +243,7 @@ read_volume:
     * Check that volcatinfo is good   
     */
    if (!dev->haveVolCatInfo()) {
-      Dmsg0(100, "Do not have volcatinfo\n");
+      Dmsg0(210, "Do not have volcatinfo\n");
       if (!find_a_volume()) {
          goto mount_next_vol;
       }
@@ -579,7 +579,11 @@ void DCR::do_swapping(bool is_writing)
          Dmsg2(100, "Vol=%s on dev=%s\n", dev->swap_dev->vol->vol_name,
               dev->swap_dev->print_name());
       }
+      Dmsg2(100, "Set swap_dev=NULL for dev=%s swap_dev=%s\n",
+         dev->print_name(), dev->swap_dev->print_name());
       dev->swap_dev = NULL;
+   } else {
+      Dmsg0(100, "No swap_dev set\n");
    }
 }
 
@@ -859,7 +863,11 @@ bool mount_next_read_volume(DCR *dcr)
     * End Of Tape -- mount next Volume (if another specified)
     */
    if (jcr->NumReadVolumes > 1 && jcr->CurReadVolume < jcr->NumReadVolumes) {
+      dev->Lock();
       dev->close();
+      dev->set_read();
+      dcr->set_reserved();
+      dev->Unlock();
       if (!acquire_device_for_read(dcr)) {
          Jmsg2(jcr, M_FATAL, 0, _("Cannot open Dev=%s, Vol=%s\n"), dev->print_name(),
                dcr->VolumeName);