public inbox for pbs-devel@lists.proxmox.com
 help / color / mirror / Atom feed
* [pbs-devel] [PATCH proxmox-backup v2 1/3] tape: inventory: don't skip unassigned tapes completely
@ 2023-02-28 13:17 Dominik Csapak
  2023-02-28 13:17 ` [pbs-devel] [PATCH proxmox-backup v2 2/3] fix #4412: tape: initial WORM support Dominik Csapak
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Dominik Csapak @ 2023-02-28 13:17 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-03-01  7:24 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-02-28 13:17 [pbs-devel] [PATCH proxmox-backup v2 1/3] tape: inventory: don't skip unassigned tapes completely Dominik Csapak
2023-02-28 13:17 ` [pbs-devel] [PATCH proxmox-backup v2 2/3] fix #4412: tape: initial WORM support Dominik Csapak
2023-02-28 13:17 ` [pbs-devel] [PATCH proxmox-backup v2 3/3] docs: add WORM tape documentation Dominik Csapak
2023-03-01  7:24 ` [pbs-devel] applied [PATCH proxmox-backup v2 1/3] tape: inventory: don't skip unassigned tapes completely Dietmar Maurer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal