From: Kern Sibbald Date: Fri, 7 Dec 2012 09:06:23 +0000 (+0100) Subject: Fix Virtual Full file close bug -- race condition X-Git-Tag: Release-7.0.0~59 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=281ae60f6b1eeda4c1f7629a1519bc5cd871a877;p=bacula%2Fbacula Fix Virtual Full file close bug -- race condition --- diff --git a/bacula/src/stored/mount.c b/bacula/src/stored/mount.c index fac100785d..dc1f38bc19 100644 --- a/bacula/src/stored/mount.c +++ b/bacula/src/stored/mount.c @@ -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);