From: Dominik Csapak <d.csapak@proxmox.com>
To: pbs-devel@lists.proxmox.com
Subject: [pbs-devel] [PATCH proxmox-backup 1/3] tape: inventory: don't skip unassigned tapes completely
Date: Thu, 23 Feb 2023 12:59:00 +0100 [thread overview]
Message-ID: <20230223115902.1180695-1-d.csapak@proxmox.com> (raw)
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
next reply other threads:[~2023-02-23 11:59 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-02-23 11:59 Dominik Csapak [this message]
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20230223115902.1180695-1-d.csapak@proxmox.com \
--to=d.csapak@proxmox.com \
--cc=pbs-devel@lists.proxmox.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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