dev->file, dev_name(dev), jcr->VolumeName);
continue;
} else if (dev_state(dev, ST_SHORT)) {
- Jmsg(jcr, M_ERROR, 0, "%s", dev->errmsg);
+ Jmsg1(jcr, M_ERROR, 0, "%s", dev->errmsg);
continue;
} else {
/* I/O error or strange end of tape */
display_tape_error_status(jcr, dev);
+ if (forge_on || jcr->ignore_label_errors) {
+ fsr_dev(dev, 1); /* try skipping bad record */
+ Dmsg0(000, "Did fsr\n");
+ continue; /* try to continue */
+ }
ok = FALSE;
break;
}
}
Dmsg2(100, "New block at position=(file:block) %d:%d\n", dev->file, dev->block_num);
-#define FAST_BLOCK_REJECTION
-#ifdef FAST_BLOCK_REJECTION
+#ifdef if_and_when_FAST_BLOCK_REJECTION_is_working
/* this does not stop when file/block are too big */
if (!match_bsr_block(jcr->bsr, block)) {
if (try_repositioning(jcr, rec, dev)) {
* VolSessionId and VolSessionTime
*/
bool found = false;
- for (rec=(DEV_RECORD *)recs->first(); rec; rec=(DEV_RECORD *)recs->next(rec)) {
+ foreach_dlist(rec, recs) {
if (rec->VolSessionId == block->VolSessionId &&
rec->VolSessionTime == block->VolSessionTime) {
found = true;
// Dmsg2(100, "Position=(file:block) %d:%d\n", dev->file, dev->block_num);
/* Walk down list and free all remaining allocated recs */
- for (rec=(DEV_RECORD *)recs->first(); rec; ) {
- DEV_RECORD *nrec = (DEV_RECORD *)recs->next(rec);
+ while (!recs->empty()) {
+ rec = (DEV_RECORD *)recs->first();
recs->remove(rec);
free_record(rec);
- rec = nrec;
}
delete recs;
print_block_read_errors(jcr, block);
return 1;
}
if (bsr) {
- if (verbose > 1) {
+ if (verbose) {
Jmsg(jcr, M_INFO, 0, "Reposition from (file:block) %d:%d to %d:%d\n",
dev->file, dev->block_num, bsr->volfile->sfile,
bsr->volblock->sblock);
static char buf[200];
buf[0] = 0;
if (rec->state & REC_NO_HEADER) {
- strcat(buf, "Nohdr,");
+ bstrncat(buf, "Nohdr,", sizeof(buf));
}
if (is_partial_record(rec)) {
- strcat(buf, "partial,");
+ bstrncat(buf, "partial,", sizeof(buf));
}
if (rec->state & REC_BLOCK_EMPTY) {
- strcat(buf, "empty,");
+ bstrncat(buf, "empty,", sizeof(buf));
}
if (rec->state & REC_NO_MATCH) {
- strcat(buf, "Nomatch,");
+ bstrncat(buf, "Nomatch,", sizeof(buf));
}
if (rec->state & REC_CONTINUATION) {
- strcat(buf, "cont,");
+ bstrncat(buf, "cont,", sizeof(buf));
}
if (buf[0]) {
buf[strlen(buf)-1] = 0;