Skip to content

Commit

Permalink
stored: fix unintended decrement of block_num
Browse files Browse the repository at this point in the history
When bsr() is called to initiare a re-read on a tape, it will decrement
ths block_num. As during the re-read the block_num was not incremented,
it shouldn't be decremented.
  • Loading branch information
arogge committed Jun 28, 2023
1 parent d8f765c commit ab01b56
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion core/src/stored/block.cc
Expand Up @@ -1060,7 +1060,9 @@ DeviceControlRecord::ReadStatus DeviceControlRecord::ReadBlockFromDev(bool)
// Attempt to Reposition to re-read the block
if (dev->IsTape()) {
Dmsg0(250, "BootStrapRecord for reread; block too big for buffer.\n");
if (!dev->bsr(1)) {
if (dev->bsr(1)) {
dev->block_num++; // reincrement what bsr() decremented
} else {
Mmsg(dev->errmsg, "%s", dev->bstrerror());
Jmsg(jcr, M_ERROR, 0, "%s", dev->errmsg);
block->read_len = 0;
Expand Down

0 comments on commit ab01b56

Please sign in to comment.