]> git.sur5r.net Git - bacula/bacula/blobdiff - bacula/src/stored/label.c
Make btape fill/unfill work
[bacula/bacula] / bacula / src / stored / label.c
index a99b9188e1083366b151cfd9222d485cf08feaa8..74ea5157b2d3d8653f208a3458c8894c07e43f02 100644 (file)
@@ -74,8 +74,7 @@ int read_dev_volume_label(JCR *jcr, DEVICE *dev, DEV_BLOCK *block)
          * Cancel Job if too many label errors
          *  => we are in a loop
          */
-        if (jcr->label_errors > 100) {
-           set_jcr_job_status(jcr, JS_ErrorTerminated);
+        if (jcr->label_errors++ > 100) {
             Jmsg(jcr, M_FATAL, 0, "%s", jcr->errmsg);
         }
         return jcr->label_status = VOL_NAME_ERROR;
@@ -93,10 +92,10 @@ int read_dev_volume_label(JCR *jcr, DEVICE *dev, DEV_BLOCK *block)
    }
    strcpy(dev->VolHdr.Id, "**error**");
 
-   /* Read the device label block */
+   /* Read the Volume label block */
    record = new_record();
    Dmsg0(90, "Big if statement in read_volume_label\n");
-   if (!read_block_from_dev(dev, block)) { 
+   if (!read_block_from_dev(jcr, dev, block, NO_BLOCK_NUMBER_CHECK)) { 
       Mmsg(&jcr->errmsg, _("Volume on %s is not a Bacula labeled Volume, \
 because:\n   %s"), dev_name(dev), strerror_dev(dev));
    } else if (!read_record_from_block(block, record)) {
@@ -141,8 +140,7 @@ because:\n   %s"), dev_name(dev), strerror_dev(dev));
        * Cancel Job if too many label errors
        *  => we are in a loop
        */
-      if (jcr->label_errors > 100) {
-        set_jcr_job_status(jcr, JS_ErrorTerminated);
+      if (jcr->label_errors++ > 100) {
          Jmsg(jcr, M_FATAL, 0, "%s", jcr->errmsg);
       }
       return jcr->label_status = VOL_NAME_ERROR;