Skip to content

Commit

Permalink
Fix set_label_blocksize to set minimum_blocksize
Browse files Browse the repository at this point in the history
We now also set the minimum blocksize when writing labels
so that we are sure that the label really has 63k instead of
only 1k which it was without this fix.

We also remove an unneeded newline in debug output of the autochanger.
  • Loading branch information
pstorz authored and Marco van Wieringen committed May 31, 2014
1 parent 85076b5 commit f44b3cf
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 10 deletions.
2 changes: 1 addition & 1 deletion src/stored/autochanger.c
Expand Up @@ -623,7 +623,7 @@ bool autochanger_cmd(DCR *dcr, BSOCK *dir, const char *cmd)
*/
while (fgets(dir->msg, len, bpipe->rfd)) {
dir->msglen = strlen(dir->msg);
Dmsg1(100, "<stored: %s\n", dir->msg);
Dmsg1(100, "<stored: %s", dir->msg);
bnet_send(dir);
}
} else if (bstrcmp(cmd, "slots")) {
Expand Down
6 changes: 2 additions & 4 deletions src/stored/dev.c
Expand Up @@ -437,13 +437,11 @@ void DEVICE::set_blocksizes(DCR *dcr) {
void DEVICE::set_label_blocksize(DCR *dcr)
{
DEVICE *dev = this;

Dmsg3(100, "setting minblocksize to %u, "
"maxblocksize to label_block_size=%u, on device %s\n",
0, dev->device->label_block_size, dev->print_name());

dev->min_block_size = 0;
dev->device->label_block_size, dev->device->label_block_size, dev->print_name());

dev->min_block_size = dev->device->label_block_size;
dev->max_block_size = dev->device->label_block_size;
/*
* If blocklen is not dev->max_block_size create a new block with the right size
Expand Down
5 changes: 0 additions & 5 deletions src/stored/label.c
Expand Up @@ -424,11 +424,6 @@ bool write_new_volume_label_to_dev(DCR *dcr, const char *VolName,
dcr->rec->Stream = 0;
dcr->rec->maskedStream = 0;

/*
* Set the label blocksize to read the label
*/
dev->set_label_blocksize(dcr);

if (!write_record_to_block(dcr, dcr->rec)) {
Dmsg2(130, "Bad Label write on %s: ERR=%s\n", dev->print_name(), dev->print_errmsg());
goto bail_out;
Expand Down

0 comments on commit f44b3cf

Please sign in to comment.