From fcce8922b9f84eb032ea57196b4950008d32bb8d Mon Sep 17 00:00:00 2001 From: Eric Bollengier Date: Tue, 22 Oct 2019 14:40:15 +0200 Subject: [PATCH] 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. --- bacula/src/stored/mount.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) 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; + } } /* -- 2.47.3