]> git.sur5r.net Git - bacula/bacula/blob - bacula/patches/2.2.x/2.2.5-lastwritten.patch
Cleanup patches a bit
[bacula/bacula] / bacula / patches / 2.2.x / 2.2.5-lastwritten.patch
1
2   This bug fixes the LastWritten field which was updated during
3   a restore (or a reading migration)
4   This fixes bug #982
5
6   This patch applies to Bacula version 2.2.5 (and previous versions),
7   and can be applied with the following:
8
9   cd <bacula-source>
10   patch -p0 <2.2.5-lastwritten.patch
11   ./configure (your options)
12   make
13   ...
14   make install
15
16
17
18 Index: src/dird/catreq.c
19 ===================================================================
20 --- src/dird/catreq.c   (rĂ©vision 5789)
21 +++ src/dird/catreq.c   (copie de travail)
22 @@ -266,6 +266,11 @@
23           }
24        }
25        Dmsg2(400, "Update media: BefVolJobs=%u After=%u\n", mr.VolJobs, sdmr.VolJobs);
26 +      /* Check if the volume has been written by the job, 
27 +       * and update the LastWritten field if needed */
28 +      if (mr.VolBlocks != sdmr.VolBlocks) {
29 +         mr.LastWritten = sdmr.LastWritten;
30 +      }
31        /* Copy updated values to original media record */
32        mr.VolJobs      = sdmr.VolJobs;
33        mr.VolFiles     = sdmr.VolFiles;
34 @@ -274,7 +279,6 @@
35        mr.VolMounts    = sdmr.VolMounts;
36        mr.VolErrors    = sdmr.VolErrors;
37        mr.VolWrites    = sdmr.VolWrites;
38 -      mr.LastWritten  = sdmr.LastWritten;
39        mr.Slot         = sdmr.Slot;
40        mr.InChanger    = sdmr.InChanger;
41        mr.VolReadTime  = sdmr.VolReadTime;