]> git.sur5r.net Git - bacula/bacula/commitdiff
Fix Virtual Full file close bug -- race condition
authorKern Sibbald <kern@sibbald.com>
Fri, 7 Dec 2012 09:06:23 +0000 (10:06 +0100)
committerKern Sibbald <kern@sibbald.com>
Sat, 20 Apr 2013 12:51:05 +0000 (14:51 +0200)
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);