]> git.sur5r.net Git - bacula/bacula/commitdiff
ebl fix #982 about LastWritten field which is updated during restore.
authorEric Bollengier <eric@eb.homelinux.org>
Thu, 25 Oct 2007 21:08:05 +0000 (21:08 +0000)
committerEric Bollengier <eric@eb.homelinux.org>
Thu, 25 Oct 2007 21:08:05 +0000 (21:08 +0000)
git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@5806 91ce42f0-d328-0410-95d8-f526ca767f89

bacula/patches/2.2.5-lastwritten.patch [new file with mode: 0644]

diff --git a/bacula/patches/2.2.5-lastwritten.patch b/bacula/patches/2.2.5-lastwritten.patch
new file mode 100644 (file)
index 0000000..c5373bc
--- /dev/null
@@ -0,0 +1,41 @@
+
+  This bug fixes the LastWritten field which was updated during
+  a restore (or a reading migration)
+  This fixes bug #982
+
+  This patch applies to Bacula version 2.2.5 (and previous versions),
+  and can be applied with the following:
+
+  cd <bacula-source>
+  patch -p0 <2.2.5-lastwritten.patch
+  ./configure (your options)
+  make
+  ...
+  make install
+
+
+
+Index: src/dird/catreq.c
+===================================================================
+--- src/dird/catreq.c  (rĂ©vision 5789)
++++ src/dird/catreq.c  (copie de travail)
+@@ -266,6 +266,11 @@
+          }
+       }
+       Dmsg2(400, "Update media: BefVolJobs=%u After=%u\n", mr.VolJobs, sdmr.VolJobs);
++      /* Check if the volume has been written by the job, 
++       * and update the LastWritten field if needed */
++      if (mr.VolBlocks != sdmr.VolBlocks) {
++         mr.LastWritten = sdmr.LastWritten;
++      }
+       /* Copy updated values to original media record */
+       mr.VolJobs      = sdmr.VolJobs;
+       mr.VolFiles     = sdmr.VolFiles;
+@@ -274,7 +279,6 @@
+       mr.VolMounts    = sdmr.VolMounts;
+       mr.VolErrors    = sdmr.VolErrors;
+       mr.VolWrites    = sdmr.VolWrites;
+-      mr.LastWritten  = sdmr.LastWritten;
+       mr.Slot         = sdmr.Slot;
+       mr.InChanger    = sdmr.InChanger;
+       mr.VolReadTime  = sdmr.VolReadTime;