- when labeling if an error occurs, the fd stays open, and other attempt
to label another volume will reuse the same fd (instead of opening
a new one) making the label and the filename mismatched.
- this is appening when auto labeling is enable and when the
keymanager is failing
- this could appends for other situation, maybe uncomment
the commented line could help
Dmsg1(150, "Label type=%d\n", dev->label_type);
if (!load_encryption_key(dcr, "LABEL", VolName, &VolHdr.EncCypherKeySize, VolHdr.EncCypherKey, &VolHdr.MasterKeyIdSize, VolHdr.MasterKeyId)) {
+ close(dcr);
goto bail_out;
}
if (!write_volume_label_to_dev(dcr, VolName, PoolName, relabel, no_prelabel)) {
+ /* close(dcr); uncomment if you get mismatched label like in #10453 */
goto bail_out;
}