]> git.ipfire.org Git - thirdparty/bacula.git/commitdiff
Fix #5461 #5513 #4717 About WroteVol non-zero message
authorEric Bollengier <eric@baculasystems.com>
Tue, 22 Oct 2019 12:40:15 +0000 (14:40 +0200)
committerRadosław Korzeniewski <radekk@inteos.pl>
Sat, 14 Dec 2019 15:02:18 +0000 (16:02 +0100)
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

index c0e89e09ec5c98eefc71de27e59658fe068a6f83..4a00b02186f1c8edbf71b45b02f15f276486c145 100644 (file)
@@ -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;
+      }
    }
 
    /*