From 9220a2db776e1bda2862e88064b5334c046dd2d1 Mon Sep 17 00:00:00 2001 From: Kern Sibbald Date: Fri, 7 Dec 2012 10:06:23 +0100 Subject: [PATCH] Fix Virtual Full file close bug -- race condition --- bacula/src/stored/mount.c | 4 ++++ 1 file changed, 4 insertions(+) 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); -- 2.39.5