]> git.sur5r.net Git - bacula/bacula/blobdiff - bacula/src/stored/mount.c
Fix Virtual Full file close bug -- race condition
[bacula/bacula] / bacula / src / stored / mount.c
index fac100785d66b26a14c7812a063b6ba51aca2d4c..dc1f38bc1927d543d64b4b373caf0cdc37b9c2a8 100644 (file)
@@ -863,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);