From: Eric Bollengier Date: Tue, 22 Oct 2019 12:40:15 +0000 (+0200) Subject: Fix #5461 #5513 #4717 About WroteVol non-zero message X-Git-Tag: Release-9.6.0~53 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=fcce8922b9f84eb032ea57196b4950008d32bb8d;p=thirdparty%2Fbacula.git Fix #5461 #5513 #4717 About WroteVol non-zero message When this message is printed, we have seen data corruptions on volumes that are currently mounted. This patch should prevent that situation to happen. --- diff --git a/bacula/src/stored/mount.c b/bacula/src/stored/mount.c index c0e89e09e..4a00b0218 100644 --- a/bacula/src/stored/mount.c +++ b/bacula/src/stored/mount.c @@ -262,7 +262,14 @@ read_volume: if (!find_a_volume()) { goto mount_next_vol; } - dev->set_volcatinfo_from_dcr(this); + if (strcmp(dev->VolHdr.VolumeName, dcr->VolCatInfo.VolCatName) == 0) { + dev->set_volcatinfo_from_dcr(this); + + } else { /* We have a volume, but not the current one */ + Dmsg2(5, "Will need to re-mount volumes %s %s\n", + dev->VolHdr.VolumeName, dcr->VolCatInfo.VolCatName); + goto mount_next_vol; + } } /*