mirror of
https://git.proxmox.com/git/proxmox-backup
synced 2025-06-15 12:11:09 +00:00
tape: inventory: skip unassigned tapes
tapes that are labeled into a pool but are not in a media-set yet, belong to the special 'all zero' media-set. these will never have a catalog on them, so skip them fixes the issue, that an inventory with 'catalog restore' aborted on such a tape Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
This commit is contained in:
parent
52517f7b9e
commit
139acf37a2
@ -952,17 +952,17 @@ pub fn update_inventory(
|
||||
media_id.label.uuid
|
||||
);
|
||||
|
||||
if let Some(MediaSetLabel {
|
||||
ref pool, ref uuid, ..
|
||||
}) = media_id.media_set_label
|
||||
{
|
||||
let _pool_lock = lock_media_pool(TAPE_STATUS_DIR, pool)?;
|
||||
let _lock = lock_media_set(TAPE_STATUS_DIR, uuid, None)?;
|
||||
if let Some(ref set) = media_id.media_set_label {
|
||||
if set.unassigned() {
|
||||
continue;
|
||||
}
|
||||
let _pool_lock = lock_media_pool(TAPE_STATUS_DIR, &set.pool)?;
|
||||
let _lock = lock_media_set(TAPE_STATUS_DIR, &set.uuid, None)?;
|
||||
MediaCatalog::destroy_unrelated_catalog(TAPE_STATUS_DIR, &media_id)?;
|
||||
inventory.store(media_id.clone(), false)?;
|
||||
|
||||
if catalog {
|
||||
let media_set = inventory.compute_media_set_members(uuid)?;
|
||||
let media_set = inventory.compute_media_set_members(&set.uuid)?;
|
||||
if let Err(err) = fast_catalog_restore(
|
||||
&worker,
|
||||
&mut drive,
|
||||
|
Loading…
Reference in New Issue
Block a user