From 65e36051708e44810144be1fadba1ac984f7309b Mon Sep 17 00:00:00 2001 From: Kern Sibbald Date: Thu, 20 Sep 2007 19:01:19 +0000 Subject: [PATCH] Correct ansi patch git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/branches/Branch-2.2@5620 91ce42f0-d328-0410-95d8-f526ca767f89 --- bacula/patches/2.2.4-ansi-label.patch | 47 +++++++++++++++++++++++++-- 1 file changed, 44 insertions(+), 3 deletions(-) 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; -- 2.39.5