2 This patch fix a catalog query error while trying to update
3 Volume information. You can apply this patch if you have seen
6 Error getting Volume info: 1990 Invalid Catalog Request: CatReq Job=ZOLTAN.2008-04-07_02.17.28 UpdateMedia
7 VolName=IMG011 VolJobs=1 VolFiles=17 VolBlocks=247999 VolBytes=15998976000 VolMounts=2 VolErrors=0
8 VolWrites=2609347 MaxVolBytes=0 EndTime=1207602760 VolStatus=Full Slot=2 relabel=0 InChanger=1
9 VolReadTime=0 VolWriteTime=-2382413895 VolFirstWritten=0 VolParts=0
11 Apply it to version 2.2.8 or earlier with:
14 patch -p0 <2.2.8-volstats.patch
15 ./configure <your-options>
23 Index: src/stored/askdir.c
24 ===================================================================
25 --- src/stored/askdir.c (révision 6743)
26 +++ src/stored/askdir.c (copie de travail)
28 " VolBlocks=%lu VolBytes=%lld VolMounts=%lu VolErrors=%lu VolWrites=%lu"
29 " MaxVolBytes=%lld VolCapacityBytes=%lld VolStatus=%20s"
30 " Slot=%ld MaxVolJobs=%lu MaxVolFiles=%lu InChanger=%ld"
31 - " VolReadTime=%lld VolWriteTime=%lld EndFile=%lu EndBlock=%lu"
32 + " VolReadTime=%s VolWriteTime=%s EndFile=%lu EndBlock=%lu"
33 " VolParts=%lu LabelType=%ld MediaId=%lld\n";
38 static bool do_get_volume_info(DCR *dcr)
40 + char ed_vrt[50], ed_vwt[50];
42 BSOCK *dir = jcr->dir_bsock;
45 &vol.VolCatWrites, &vol.VolCatMaxBytes,
46 &vol.VolCatCapacityBytes, vol.VolCatStatus,
47 &vol.Slot, &vol.VolCatMaxJobs, &vol.VolCatMaxFiles,
48 - &InChanger, &vol.VolReadTime, &vol.VolWriteTime,
49 + &InChanger, ed_vrt, ed_vwt,
50 &vol.EndFile, &vol.EndBlock, &vol.VolCatParts,
51 &vol.LabelType, &vol.VolMediaId);
54 Mmsg(jcr->errmsg, _("Error getting Volume info: %s"), dir->msg);
57 + vol.VolReadTime = str_to_int64(ed_vrt);
58 + vol.VolWriteTime = str_to_int64(ed_vwt);
59 vol.InChanger = InChanger; /* bool in structure */
60 unbash_spaces(vol.VolCatName);
61 bstrncpy(dcr->VolumeName, vol.VolCatName, sizeof(dcr->VolumeName));
62 Index: src/dird/catreq.c
63 ===================================================================
64 --- src/dird/catreq.c (révision 6743)
65 +++ src/dird/catreq.c (copie de travail)
67 static char Update_media[] = "CatReq Job=%127s UpdateMedia VolName=%s"
68 " VolJobs=%u VolFiles=%u VolBlocks=%u VolBytes=%" lld " VolMounts=%u"
69 " VolErrors=%u VolWrites=%u MaxVolBytes=%" lld " EndTime=%d VolStatus=%10s"
70 - " Slot=%d relabel=%d InChanger=%d VolReadTime=%" lld " VolWriteTime=%" lld
71 + " Slot=%d relabel=%d InChanger=%d VolReadTime=%s VolWriteTime=%s"
72 " VolFirstWritten=%" lld " VolParts=%u\n";
74 static char Create_job_media[] = "CatReq Job=%127s CreateJobMedia "
77 void catalog_request(JCR *jcr, BSOCK *bs)
79 + char ed_vrt[50], ed_vwt[50];
82 char Job[MAX_NAME_LENGTH];
84 &sdmr.VolJobs, &sdmr.VolFiles, &sdmr.VolBlocks, &sdmr.VolBytes,
85 &sdmr.VolMounts, &sdmr.VolErrors, &sdmr.VolWrites, &sdmr.MaxVolBytes,
86 &sdmr.LastWritten, &sdmr.VolStatus, &sdmr.Slot, &label, &sdmr.InChanger,
87 - &sdmr.VolReadTime, &sdmr.VolWriteTime, &VolFirstWritten,
88 + ed_vrt, ed_vwt, &VolFirstWritten,
89 &sdmr.VolParts) == 19) {
91 + sdmr.VolReadTime = str_to_int64(ed_vrt);
92 + sdmr.VolWriteTime = str_to_int64(ed_vwt);
95 Dmsg3(400, "Update media %s oldStat=%s newStat=%s\n", sdmr.VolumeName,