From: Christian Ebner <c.ebner@proxmox.com>
To: pbs-devel@lists.proxmox.com
Subject: [pbs-devel] [PATCH proxmox-backup 2/2] fix #6358: remove group note file if present on group destroy
Date: Wed, 7 May 2025 17:38:34 +0200 [thread overview]
Message-ID: <20250507153834.758840-3-c.ebner@proxmox.com> (raw)
In-Reply-To: <20250507153834.758840-1-c.ebner@proxmox.com>
Removing the group directory when forgetting a backup group or
removing the final backup snapshot of a group did not take into
consideration a potentially present group note file, leading for it
to fail.
Further, since the owner file is removed before trying to remove the
(not empty) group directory, the group will not be usable anymore as
the owner check will fail as well.
To fix this, remove the backup group's note file first, if present
and only after that try to cleanup the rest.
Fixes: https://bugzilla.proxmox.com/show_bug.cgi?id=6358
Signed-off-by: Christian Ebner <c.ebner@proxmox.com>
---
pbs-datastore/src/backup_info.rs | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/pbs-datastore/src/backup_info.rs b/pbs-datastore/src/backup_info.rs
index d4732fdd9..22b4eddf3 100644
--- a/pbs-datastore/src/backup_info.rs
+++ b/pbs-datastore/src/backup_info.rs
@@ -244,6 +244,13 @@ impl BackupGroup {
/// Helper function, assumes that no more snapshots are present in the group.
fn remove_group_dir(&self) -> Result<(), Error> {
+ let note_path = self.store.group_notes_path(&self.ns, &self.group);
+ if let Err(err) = std::fs::remove_file(¬e_path) {
+ if err.kind() != std::io::ErrorKind::NotFound {
+ bail!("removing the note file '{note_path:?}' failed - {err}")
+ }
+ }
+
let owner_path = self.store.owner_path(&self.ns, &self.group);
std::fs::remove_file(&owner_path).map_err(|err| {
--
2.39.5
_______________________________________________
pbs-devel mailing list
pbs-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pbs-devel
next prev parent reply other threads:[~2025-05-07 15:38 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-05-07 15:38 [pbs-devel] [PATCH proxmox-backup 0/2] fix #6358: group removal fails if group notes exist Christian Ebner
2025-05-07 15:38 ` [pbs-devel] [PATCH proxmox-backup 1/2] api: datastore: make group notes path helper a DataStore method Christian Ebner
2025-05-07 15:38 ` Christian Ebner [this message]
2025-06-04 11:31 ` [pbs-devel] applied-series: [PATCH proxmox-backup 0/2] fix #6358: group removal fails if group notes exist Fabian Grünbichler
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=20250507153834.758840-3-c.ebner@proxmox.com \
--to=c.ebner@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