From 2bddf273b333d24bb1e4579d2b1a7b51d1ddb014 Mon Sep 17 00:00:00 2001 From: Eric Bollengier Date: Tue, 8 Apr 2008 20:01:06 +0000 Subject: [PATCH] ebl Revert volstats patch git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@6765 91ce42f0-d328-0410-95d8-f526ca767f89 --- bacula/patches/2.2.8-volstats.patch | 95 ----------------------------- bacula/src/dird/catreq.c | 8 +-- bacula/src/stored/askdir.c | 7 +-- bacula/technotes-2.3 | 2 - 4 files changed, 4 insertions(+), 108 deletions(-) delete mode 100644 bacula/patches/2.2.8-volstats.patch diff --git a/bacula/patches/2.2.8-volstats.patch b/bacula/patches/2.2.8-volstats.patch deleted file mode 100644 index db6dd73906..0000000000 --- a/bacula/patches/2.2.8-volstats.patch +++ /dev/null @@ -1,95 +0,0 @@ - - This patch fix a catalog query error while trying to update - Volume information. You can apply this patch if you have seen - this error : - - Error getting Volume info: 1990 Invalid Catalog Request: CatReq Job=ZOLTAN.2008-04-07_02.17.28 UpdateMedia - VolName=IMG011 VolJobs=1 VolFiles=17 VolBlocks=247999 VolBytes=15998976000 VolMounts=2 VolErrors=0 - VolWrites=2609347 MaxVolBytes=0 EndTime=1207602760 VolStatus=Full Slot=2 relabel=0 InChanger=1 - VolReadTime=0 VolWriteTime=-2382413895 VolFirstWritten=0 VolParts=0 - - Apply it to version 2.2.8 or earlier with: - - cd - patch -p0 <2.2.8-volstats.patch - ./configure - make - ... - make install - - - - -Index: src/stored/askdir.c -=================================================================== ---- src/stored/askdir.c (révision 6743) -+++ src/stored/askdir.c (copie de travail) -@@ -56,7 +56,7 @@ - " VolBlocks=%lu VolBytes=%lld VolMounts=%lu VolErrors=%lu VolWrites=%lu" - " MaxVolBytes=%lld VolCapacityBytes=%lld VolStatus=%20s" - " Slot=%ld MaxVolJobs=%lu MaxVolFiles=%lu InChanger=%ld" -- " VolReadTime=%lld VolWriteTime=%lld EndFile=%lu EndBlock=%lu" -+ " VolReadTime=%s VolWriteTime=%s EndFile=%lu EndBlock=%lu" - " VolParts=%lu LabelType=%ld MediaId=%lld\n"; - - -@@ -167,6 +167,7 @@ - */ - static bool do_get_volume_info(DCR *dcr) - { -+ char ed_vrt[50], ed_vwt[50]; - JCR *jcr = dcr->jcr; - BSOCK *dir = jcr->dir_bsock; - VOLUME_CAT_INFO vol; -@@ -187,7 +188,7 @@ - &vol.VolCatWrites, &vol.VolCatMaxBytes, - &vol.VolCatCapacityBytes, vol.VolCatStatus, - &vol.Slot, &vol.VolCatMaxJobs, &vol.VolCatMaxFiles, -- &InChanger, &vol.VolReadTime, &vol.VolWriteTime, -+ &InChanger, ed_vrt, ed_vwt, - &vol.EndFile, &vol.EndBlock, &vol.VolCatParts, - &vol.LabelType, &vol.VolMediaId); - if (n != 22) { -@@ -196,6 +197,8 @@ - Mmsg(jcr->errmsg, _("Error getting Volume info: %s"), dir->msg); - return false; - } -+ vol.VolReadTime = str_to_int64(ed_vrt); -+ vol.VolWriteTime = str_to_int64(ed_vwt); - vol.InChanger = InChanger; /* bool in structure */ - unbash_spaces(vol.VolCatName); - bstrncpy(dcr->VolumeName, vol.VolCatName, sizeof(dcr->VolumeName)); -Index: src/dird/catreq.c -=================================================================== ---- src/dird/catreq.c (révision 6743) -+++ src/dird/catreq.c (copie de travail) -@@ -56,7 +56,7 @@ - static char Update_media[] = "CatReq Job=%127s UpdateMedia VolName=%s" - " VolJobs=%u VolFiles=%u VolBlocks=%u VolBytes=%" lld " VolMounts=%u" - " VolErrors=%u VolWrites=%u MaxVolBytes=%" lld " EndTime=%d VolStatus=%10s" -- " Slot=%d relabel=%d InChanger=%d VolReadTime=%" lld " VolWriteTime=%" lld -+ " Slot=%d relabel=%d InChanger=%d VolReadTime=%s VolWriteTime=%s" - " VolFirstWritten=%" lld " VolParts=%u\n"; - - static char Create_job_media[] = "CatReq Job=%127s CreateJobMedia " -@@ -103,6 +103,7 @@ - - void catalog_request(JCR *jcr, BSOCK *bs) - { -+ char ed_vrt[50], ed_vwt[50]; - MEDIA_DBR mr, sdmr; - JOBMEDIA_DBR jm; - char Job[MAX_NAME_LENGTH]; -@@ -218,8 +219,11 @@ - &sdmr.VolJobs, &sdmr.VolFiles, &sdmr.VolBlocks, &sdmr.VolBytes, - &sdmr.VolMounts, &sdmr.VolErrors, &sdmr.VolWrites, &sdmr.MaxVolBytes, - &sdmr.LastWritten, &sdmr.VolStatus, &sdmr.Slot, &label, &sdmr.InChanger, -- &sdmr.VolReadTime, &sdmr.VolWriteTime, &VolFirstWritten, -+ ed_vrt, ed_vwt, &VolFirstWritten, - &sdmr.VolParts) == 19) { -+ -+ sdmr.VolReadTime = str_to_int64(ed_vrt); -+ sdmr.VolWriteTime = str_to_int64(ed_vwt); - - db_lock(jcr->db); - Dmsg3(400, "Update media %s oldStat=%s newStat=%s\n", sdmr.VolumeName, diff --git a/bacula/src/dird/catreq.c b/bacula/src/dird/catreq.c index 5089c0d58e..ee1d059c06 100644 --- a/bacula/src/dird/catreq.c +++ b/bacula/src/dird/catreq.c @@ -56,7 +56,7 @@ static char Get_Vol_Info[] = "CatReq Job=%127s GetVolInfo VolName=%127s write=%d static char Update_media[] = "CatReq Job=%127s UpdateMedia VolName=%s" " VolJobs=%u VolFiles=%u VolBlocks=%u VolBytes=%lld VolMounts=%u" " VolErrors=%u VolWrites=%u MaxVolBytes=%lld EndTime=%lld VolStatus=%10s" - " Slot=%d relabel=%d InChanger=%d VolReadTime=%s VolWriteTime=%s" + " Slot=%d relabel=%d InChanger=%d VolReadTime=%lld VolWriteTime=%lld" " VolFirstWritten=%lld VolParts=%u\n"; static char Create_job_media[] = "CatReq Job=%127s CreateJobMedia " @@ -103,7 +103,6 @@ static int send_volume_info_to_storage_daemon(JCR *jcr, BSOCK *sd, MEDIA_DBR *mr void catalog_request(JCR *jcr, BSOCK *bs) { - char ed_vrt[50], ed_vwt[50]; MEDIA_DBR mr, sdmr; JOBMEDIA_DBR jm; char Job[MAX_NAME_LENGTH]; @@ -220,12 +219,9 @@ void catalog_request(JCR *jcr, BSOCK *bs) &sdmr.VolJobs, &sdmr.VolFiles, &sdmr.VolBlocks, &sdmr.VolBytes, &sdmr.VolMounts, &sdmr.VolErrors, &sdmr.VolWrites, &sdmr.MaxVolBytes, &VolLastWritten, &sdmr.VolStatus, &sdmr.Slot, &label, &sdmr.InChanger, - ed_vrt, ed_vwt, &VolFirstWritten, + &sdmr.VolReadTime, &sdmr.VolWriteTime, &VolFirstWritten, &sdmr.VolParts) == 19) { - sdmr.VolReadTime = str_to_int64(ed_vrt); - sdmr.VolWriteTime = str_to_int64(ed_vwt); - db_lock(jcr->db); Dmsg3(400, "Update media %s oldStat=%s newStat=%s\n", sdmr.VolumeName, mr.VolStatus, sdmr.VolStatus); diff --git a/bacula/src/stored/askdir.c b/bacula/src/stored/askdir.c index 48c30d5c7a..96ba8d1de0 100644 --- a/bacula/src/stored/askdir.c +++ b/bacula/src/stored/askdir.c @@ -56,7 +56,7 @@ static char OK_media[] = "1000 OK VolName=%127s VolJobs=%u VolFiles=%lu" " VolBlocks=%lu VolBytes=%lld VolMounts=%lu VolErrors=%lu VolWrites=%lu" " MaxVolBytes=%lld VolCapacityBytes=%lld VolStatus=%20s" " Slot=%ld MaxVolJobs=%lu MaxVolFiles=%lu InChanger=%ld" - " VolReadTime=%s VolWriteTime=%s EndFile=%lu EndBlock=%lu" + " VolReadTime=%lld VolWriteTime=%lld EndFile=%lu EndBlock=%lu" " VolParts=%lu LabelType=%ld MediaId=%lld\n"; @@ -167,7 +167,6 @@ bool dir_send_job_status(JCR *jcr) */ static bool do_get_volume_info(DCR *dcr) { - char ed_vrt[50], ed_vwt[50]; JCR *jcr = dcr->jcr; BSOCK *dir = jcr->dir_bsock; VOLUME_CAT_INFO vol; @@ -188,7 +187,7 @@ static bool do_get_volume_info(DCR *dcr) &vol.VolCatWrites, &vol.VolCatMaxBytes, &vol.VolCatCapacityBytes, vol.VolCatStatus, &vol.Slot, &vol.VolCatMaxJobs, &vol.VolCatMaxFiles, - &InChanger, ed_vrt, ed_vwt, + &InChanger, &vol.VolReadTime, &vol.VolWriteTime, &vol.EndFile, &vol.EndBlock, &vol.VolCatParts, &vol.LabelType, &vol.VolMediaId); if (n != 22) { @@ -197,8 +196,6 @@ static bool do_get_volume_info(DCR *dcr) Mmsg(jcr->errmsg, _("Error getting Volume info: %s"), dir->msg); return false; } - vol.VolReadTime = str_to_int64(ed_vrt); - vol.VolWriteTime = str_to_int64(ed_vwt); vol.InChanger = InChanger; /* bool in structure */ unbash_spaces(vol.VolCatName); bstrncpy(dcr->VolumeName, vol.VolCatName, sizeof(dcr->VolumeName)); diff --git a/bacula/technotes-2.3 b/bacula/technotes-2.3 index 4d49b5d8d9..e034899c83 100644 --- a/bacula/technotes-2.3 +++ b/bacula/technotes-2.3 @@ -24,8 +24,6 @@ Add long term statistics job table General: -08Apr08 -ebl Fix a catalog query error while trying to update Volume information. 06Apr08 kes Correctly detect Ubuntu systems, and add ubuntu platform directory. kes Fix bug #1063, reuse of freed ptr in list nextvol. -- 2.39.5