void mark_volume_in_error();
void mark_volume_read_only();
void mark_volume_not_inchanger();
+ void volume_is_unavailable();
int try_autolabel(bool opened);
bool find_a_volume();
bool is_suitable_volume_mounted();
}
}
+ if (!load_encryption_key(dcr, "READ", VolHdr.VolumeName, &VolHdr.EncCypherKeySize, VolHdr.EncCypherKey, &VolHdr.MasterKeyIdSize, VolHdr.MasterKeyId)) {
+ stat = VOL_ENC_ERROR;
+ goto bail_out; /* a message is already loaded into jcr->errmsg */
+ }
+
Dmsg1(100, "Call reserve_volume=%s\n", VolHdr.VolumeName);
if (reserve_volume(dcr, VolHdr.VolumeName) == NULL) {
if (!jcr->errmsg[0]) {
goto bail_out;
}
- if (!load_encryption_key(dcr, "READ", VolHdr.VolumeName, &VolHdr.EncCypherKeySize, VolHdr.EncCypherKey, &VolHdr.MasterKeyIdSize, VolHdr.MasterKeyId)) {
- stat = VOL_LABEL_ERROR;
- goto bail_out; /* a message is already loaded into jcr->errmsg */
- }
-
if (dcr->is_writing()) {
empty_block(dcr->block);
}
break;
}
/* NOTE! Fall-through wanted. */
+ case VOL_ENC_ERROR:
+ volume_is_unavailable();
+ goto check_next_volume;
+ break;
case VOL_NO_MEDIA:
default:
Dmsg0(200, "VOL_NO_MEDIA or default.\n");
return check_next_vol;
check_bail_out:
+ volume_unused(this);
Leave(200);
return check_error;
return try_default;
}
+/*
+ * The volume is unavailable (temporarily?) don't used it this time
+ */
+void DCR::volume_is_unavailable()
+{
+ Jmsg(jcr, M_INFO, 0, _("The Volume \"%s\" in unavailable now.\n"),
+ VolumeName);
+ volume_unused(this);
+ Dmsg0(50, "set_unload\n");
+ dev->set_unload(); /* must get a new volume */
+}
/*
* Mark volume in error in catalog
VOL_VERSION_ERROR = 7, /* Bacula version error */
VOL_LABEL_ERROR = 8, /* Bad label type */
VOL_NO_MEDIA = 9, /* Hard error -- no media present */
- VOL_TYPE_ERROR = 10 /* Volume type (aligned/non-aligned) error */
+ VOL_TYPE_ERROR = 10, /* Volume type (aligned/non-aligned) error */
+ VOL_ENC_ERROR = 11 /* something wrong with the encryption key */
};
enum rec_state {