From 0ddffe9c090a35e8a8e672996deb400da91bb55e Mon Sep 17 00:00:00 2001 From: Eric Bollengier Date: Fri, 26 Oct 2007 17:19:39 +0000 Subject: [PATCH] ebl Fix the LastWritten field which was updated during a restore (or a reading migration) This fixes bug #982 git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/branches/Branch-2.2@5814 91ce42f0-d328-0410-95d8-f526ca767f89 --- bacula/src/dird/catreq.c | 6 +++++- bacula/technotes-2.1 | 3 +++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/bacula/src/dird/catreq.c b/bacula/src/dird/catreq.c index cc1903615f..fe4eacc94a 100644 --- a/bacula/src/dird/catreq.c +++ b/bacula/src/dird/catreq.c @@ -266,6 +266,11 @@ void catalog_request(JCR *jcr, BSOCK *bs) } } 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 @@ void catalog_request(JCR *jcr, BSOCK *bs) 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; diff --git a/bacula/technotes-2.1 b/bacula/technotes-2.1 index 3708209945..94a45b4852 100644 --- a/bacula/technotes-2.1 +++ b/bacula/technotes-2.1 @@ -1,6 +1,9 @@ Technical notes on version 2.2 General: +26Oct07 +ebl Apply 2.2.5-lastwritten.patch to fix the LastWritten field + which was updated during a restore (or a reading migration) bug #982 24Oct07 ebl Use qmake-qt4 instead of qmake when available (debian system). 22Oct07 -- 2.39.5