#ifndef __BLOCK_H
#define __BLOCK_H 1
-#define MAX_BLOCK_LENGTH 20000000 /* this is a sort of sanity check */
+#define MAX_BLOCK_SIZE 20000000 /* this is a sort of sanity check */
#define DEFAULT_BLOCK_SIZE (512 * 126) /* 64,512 N.B. do not use 65,636 here */
#define MIN_DEDUP_BLOCK_SIZE (512 * 2) /* Minimum block (bucket) size */
}
/* Sanity check */
- if (block_len > MAX_BLOCK_LENGTH) {
+ if (block_len > MAX_BLOCK_SIZE) {
dev->dev_errno = EIO;
Mmsg3(dev->errmsg, _("Volume data error at %u:%u! Block length %u is insane (too large), probably due to a bad archive.\n"),
dev->file, dev->block_num, block_len);
Jmsg(jcr, M_ERROR_TERM, 0, _("[SA0005] Min block size > max on device %s\n"),
dev->print_name());
}
- if (dev->max_block_size > 4096000) {
+ if (dev->max_block_size > MAX_BLOCK_SIZE) {
Jmsg3(jcr, M_ERROR, 0, _("[SA0006] Block size %u on device %s is too large, using default %u\n"),
dev->max_block_size, dev->print_name(), DEFAULT_BLOCK_SIZE);
- dev->max_block_size = 0;
+ dev->max_block_size = DEFAULT_BLOCK_SIZE ;
}
if (dev->max_block_size % TAPE_BSIZE != 0) {
Jmsg3(jcr, M_WARNING, 0, _("[SW0007] Max block size %u not multiple of device %s block size=%d.\n"),
}
/* Sanity check */
- if (rec->data_bytes >= MAX_BLOCK_LENGTH) {
+ if (rec->data_bytes >= MAX_BLOCK_SIZE) {
Dmsg0(dbgep, "=== rpath 11b maxlen too big\n");
/*
* Something is wrong, force read of next block, abort
rec->state_bits |= (REC_NO_HEADER | REC_BLOCK_EMPTY);
empty_block(block);
Jmsg2(dcr->jcr, M_WARNING, 0, _("Sanity check failed. maxlen=%d datalen=%d. Block discarded.\n"),
- MAX_BLOCK_LENGTH, rec->data_bytes);
+ MAX_BLOCK_SIZE, rec->data_bytes);
return false;
}
/*
- * Store Maximum Block Size, and check it is not greater than MAX_BLOCK_LENGTH
+ * Store Maximum Block Size, and check it is not greater than MAX_BLOCK_SIZE
*
*/
void store_maxblocksize(LEX *lc, RES_ITEM *item, int index, int pass)
{
store_size32(lc, item, index, pass);
- if (*(uint32_t *)(item->value) > MAX_BLOCK_LENGTH) {
+ if (*(uint32_t *)(item->value) > MAX_BLOCK_SIZE) {
scan_err2(lc, _("Maximum Block Size configured value %u is greater than allowed maximum: %u"),
- *(uint32_t *)(item->value), MAX_BLOCK_LENGTH );
+ *(uint32_t *)(item->value), MAX_BLOCK_SIZE );
}
}