]> git.sur5r.net Git - bacula/bacula/commitdiff
Correct ansi patch
authorKern Sibbald <kern@sibbald.com>
Thu, 20 Sep 2007 19:01:19 +0000 (19:01 +0000)
committerKern Sibbald <kern@sibbald.com>
Thu, 20 Sep 2007 19:01:19 +0000 (19:01 +0000)
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

index 2be88801957130590e5a463d58dc4655fec62cf6..d68e618aca673e524b83add411fd9c310f69099d 100644 (file)
  ...
  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;