]> git.sur5r.net Git - bacula/bacula/commitdiff
ebl Fix negative VolWriteTime value during UpdateMedia
authorEric Bollengier <eric@eb.homelinux.org>
Tue, 8 Apr 2008 18:54:40 +0000 (18:54 +0000)
committerEric Bollengier <eric@eb.homelinux.org>
Tue, 8 Apr 2008 18:54:40 +0000 (18:54 +0000)
git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/branches/Branch-2.2@6761 91ce42f0-d328-0410-95d8-f526ca767f89

bacula/src/dird/catreq.c
bacula/src/stored/askdir.c
bacula/technotes-2.1

index dcc58a48a51ad75af491e7bfca18b3683b50c22a..52fc914cd2e5ed3e0392b877b0ee13d6f1ae9893 100644 (file)
@@ -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=%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 @@ 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];
@@ -218,8 +219,11 @@ void catalog_request(JCR *jcr, BSOCK *bs)
       &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,
index c5adcdbe5f53a93e043381c2ecd93a12ccc2acb7..2224b4a7804c982a42bae08e87097778860c3556 100644 (file)
@@ -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=%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 @@ 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;
@@ -187,7 +188,7 @@ static bool do_get_volume_info(DCR *dcr)
                &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 @@ 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));
index 13148860f7741c6d4ef6bae9b0dd975b7cfcdda0..4ef473a2d688a59221a4398048d6239113a1ece3 100644 (file)
@@ -1,6 +1,8 @@
               Technical notes on version 2.2
 
 General:
+08Apr08
+ebl  Fix negative VolWriteTime value during UpdateMedia
 06Apr08
 kes  Eliminate ./configure warning on po directory 
 kes  Fix bug #1063, reuse of freed ptr in list nextvol.