--- /dev/null
+
+ This patch fixes bug #954.
+ WEOF on non-appendable error when trying to label a tape with ANSI labels turned on.
+
+ Apply it to version 2.2.4 (possibly earlier versions with):
+
+ cd <bacula-source>
+ patch -p0 <2.2.4-verify.patch
+ ./configure (your options)
+ make
+ ...
+ make install
+
+Index: src/stored/label.c
+===================================================================
+--- src/stored/label.c (revision 5602)
++++ src/stored/label.c (working copy)
+@@ -344,6 +344,9 @@
+ }
+ }
+
++ /* Temporarily mark in append state to enable writing */
++ dev->set_append();
++
+ /* Create PRE_LABEL or VOL_LABEL if DVD */
+ create_volume_label(dev, VolName, PoolName, dvdnow);
+
+@@ -364,8 +367,6 @@
+ create_volume_label_record(dcr, dcr->rec);
+ dcr->rec->Stream = 0;
+
+- /* Temporarily mark in append state to enable writing */
+- dev->set_append();
+ if (!write_record_to_block(dcr->block, dcr->rec)) {
+ Dmsg2(130, "Bad Label write on %s: ERR=%s\n", dev->print_name(), dev->print_errmsg());
+ goto bail_out;
int errstat;
DCR *dcr = NULL;
DEVICE *dev;
+ uint32_t max_bs;
/* If no device type specified, try to guess */
}
}
- if (dev->max_block_size > 1000000) {
+ /* Sanity check */
+ if (dev->max_block_size == 0) {
+ max_bs = DEFAULT_BLOCK_SIZE;
+ } else {
+ max_bs = dev->max_block_size;
+ }
+ if (dev->min_block_size > max_bs) {
+ Jmsg(jcr, M_ERROR_TERM, 0, _("Min block size > max on device %s\n"),
+ dev->print_name());
+ }
+ if (dev->max_block_size > 4096000) {
Jmsg3(jcr, M_ERROR, 0, _("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;
}
}
+ /* Temporarily mark in append state to enable writing */
+ dev->set_append();
+
/* Create PRE_LABEL or VOL_LABEL if DVD */
create_volume_label(dev, VolName, PoolName, dvdnow);
create_volume_label_record(dcr, dcr->rec);
dcr->rec->Stream = 0;
- /* Temporarily mark in append state to enable writing */
- dev->set_append();
if (!write_record_to_block(dcr->block, dcr->rec)) {
Dmsg2(130, "Bad Label write on %s: ERR=%s\n", dev->print_name(), dev->print_errmsg());
goto bail_out;
General:
20Sep07
+kes Fix ANSI tape labeling. This fixes bug #954.
+kes Increase the max block size to 4MB fixes bug #957.
kes Apply 2.2.4-poll-mount fix, that resolves bug #908 where a tape
is not properly mounted (recognized) during a poll.
kes Apply 2.2.4-verify patch that resolves bug #958. A Verify catalog