all lists on lists.proxmox.com
 help / color / mirror / Atom feed
* [pbs-devel] [PATCH proxmox-backup 1/3] tape: inventory: don't skip unassigned tapes completely
@ 2023-02-23 11:59 Dominik Csapak
  2023-02-23 11:59 ` [pbs-devel] [PATCH proxmox-backup 2/3] tape: initial WORM support Dominik Csapak
  2023-02-23 11:59 ` [pbs-devel] [PATCH proxmox-backup 3/3] docs: add WORM tape documentation Dominik Csapak
  0 siblings, 2 replies; 4+ messages in thread
From: Dominik Csapak @ 2023-02-23 11:59 UTC (permalink / raw)
  To: pbs-devel

since commit 139acf37 ("tape: inventory: skip unassigned tapes")
we skip unassigned tapes (special all-zero media-set uuid) when we look
for a catalog. We accidentally skipped storing it in the inventory
completely, which means we never inventoried completely empty tapes.

to fix that, simply move the check below the inserting in the inventory

Fixes: 139acf37 ("tape: inventory: skip unassigned tapes")

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
---
 src/api2/tape/drive.rs | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/src/api2/tape/drive.rs b/src/api2/tape/drive.rs
index 16ea5f98..a66c999c 100644
--- a/src/api2/tape/drive.rs
+++ b/src/api2/tape/drive.rs
@@ -953,14 +953,15 @@ pub fn update_inventory(
                         );
 
                         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 set.unassigned() {
+                                continue;
+                            }
+
                             if catalog {
                                 let media_set = inventory.compute_media_set_members(&set.uuid)?;
                                 if let Err(err) = fast_catalog_restore(
-- 
2.30.2





^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2023-02-28  9:56 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-02-23 11:59 [pbs-devel] [PATCH proxmox-backup 1/3] tape: inventory: don't skip unassigned tapes completely Dominik Csapak
2023-02-23 11:59 ` [pbs-devel] [PATCH proxmox-backup 2/3] tape: initial WORM support Dominik Csapak
2023-02-28  9:56   ` Dietmar Maurer
2023-02-23 11:59 ` [pbs-devel] [PATCH proxmox-backup 3/3] docs: add WORM tape documentation Dominik Csapak

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal