From: Kern Sibbald Date: Thu, 20 Sep 2007 19:00:31 +0000 (+0000) Subject: Add missed return in fixing verify bug -- trunk only. X-Git-Tag: Release-3.0.0~2485 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=a4a52b6d73b6a53e8b2f7663bda352933d3b36b4;p=bacula%2Fbacula Add missed return in fixing verify bug -- trunk only. git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@5619 91ce42f0-d328-0410-95d8-f526ca767f89 --- diff --git a/bacula/patches/2.2.4-ansi-label.patch b/bacula/patches/2.2.4-ansi-label.patch index 2be8880195..d68e618aca 100644 --- a/bacula/patches/2.2.4-ansi-label.patch +++ b/bacula/patches/2.2.4-ansi-label.patch @@ -11,11 +11,52 @@ ... make install -Index: src/stored/label.c +Index: block.c +=================================================================== +--- src/stored/block.c (revision 5615) ++++ src/stored/block.c (revision 5615) +@@ -273,6 +273,7 @@ + dev->dev_errno = EIO; + Mmsg4(dev->errmsg, _("Volume data error at %u:%u! Wanted ID: \"%s\", got \"%s\". Buffer discarded.\n"), + dev->file, dev->block_num, BLKHDR2_ID, Id); ++ Dmsg1(50, "%s", dev->errmsg); + if (block->read_errors == 0 || verbose >= 2) { + Jmsg(jcr, M_ERROR, 0, "%s", dev->errmsg); + } +@@ -1008,8 +1009,19 @@ + dev->set_ateof(); + return false; /* return eof */ + } ++ + /* Continue here for successful read */ ++ + block->read_len = stat; /* save length read */ ++ if (dev->at_eof() && block->read_len == 80 && ++ (dcr->VolCatInfo.LabelType != B_BACULA_LABEL || ++ dcr->device->label_type != B_BACULA_LABEL)) { ++ /* ***FIXME*** should check label */ ++ Dmsg2(100, "Ignore 80 byte ANSI label at %u:%u\n", dev->file, dev->block_num); ++ dev->clear_eof(); ++ goto reread; /* skip ANSI/IBM label */ ++ } ++ + if (block->read_len < BLKHDR2_LENGTH) { + dev->dev_errno = EIO; + Mmsg4(dev->errmsg, _("Volume data error at %u:%u! Very short block of %d bytes on device %s discarded.\n"), + +Index: label.c =================================================================== --- src/stored/label.c (revision 5602) +++ src/stored/label.c (working copy) -@@ -344,6 +344,9 @@ +@@ -119,7 +119,6 @@ + bstrncpy(dev->VolHdr.Id, "**error**", sizeof(dev->VolHdr.Id)); + + /* Read ANSI/IBM label if so requested */ +- + want_ansi_label = dcr->VolCatInfo.LabelType != B_BACULA_LABEL || + dcr->device->label_type != B_BACULA_LABEL; + if (want_ansi_label || dev->has_cap(CAP_CHECKLABELS)) { +@@ -344,6 +343,9 @@ } } @@ -25,7 +66,7 @@ Index: src/stored/label.c /* Create PRE_LABEL or VOL_LABEL if DVD */ create_volume_label(dev, VolName, PoolName, dvdnow); -@@ -364,8 +367,6 @@ +@@ -364,8 +366,6 @@ create_volume_label_record(dcr, dcr->rec); dcr->rec->Stream = 0; diff --git a/bacula/src/dird/verify.c b/bacula/src/dird/verify.c index c7863f9b05..0981b104b7 100644 --- a/bacula/src/dird/verify.c +++ b/bacula/src/dird/verify.c @@ -333,6 +333,7 @@ bool do_verify(JCR *jcr) stat = wait_for_job_termination(jcr); verify_cleanup(jcr, stat); + return true; bail_out: return false; @@ -417,7 +418,7 @@ void verify_cleanup(JCR *jcr, int TermCode) jobstatus_to_ascii(jcr->FDJobStatus, fd_term_msg, sizeof(fd_term_msg)); if (jcr->JobLevel == L_VERIFY_VOLUME_TO_CATALOG) { jobstatus_to_ascii(jcr->SDJobStatus, sd_term_msg, sizeof(sd_term_msg)); - Jmsg(jcr, msg_type, 0, _("Bacula %s %s (%s): %s\n" + Jmsg(jcr, msg_type, 0, _("Bacula %s %s (%s): %s\n" " Build OS: %s %s %s\n" " JobId: %d\n" " Job: %s\n" @@ -452,7 +453,7 @@ void verify_cleanup(JCR *jcr, int TermCode) sd_term_msg, term_msg); } else { - Jmsg(jcr, msg_type, 0, _("Bacula %s %s (%s): %s\n" + Jmsg(jcr, msg_type, 0, _("Bacula %s %s (%s): %s\n" " Build: %s %s %s\n" " JobId: %d\n" " Job: %s\n" diff --git a/bacula/technotes-2.3 b/bacula/technotes-2.3 index 251b83468b..be9f6dfd24 100644 --- a/bacula/technotes-2.3 +++ b/bacula/technotes-2.3 @@ -2,6 +2,7 @@ General: 20Sep07 +kes Add missed return in fixing verify bug -- trunk only. ebl Fix a command parser issue causing a director segfault. kes Fix ANSI tape labeling. Fix restoring ANSI labeled Volumes. This fixes bug #954.