public inbox for pve-devel@lists.proxmox.com
 help / color / mirror / Atom feed
From: Fabian Ebner <f.ebner@proxmox.com>
To: pve-devel@lists.proxmox.com
Subject: Re: [pve-devel] [PATCH storage 1/2] plugin: subdir files: backup: don't match for vmid against the full path
Date: Fri, 9 Apr 2021 08:59:28 +0200	[thread overview]
Message-ID: <1b9dd2b2-2ccc-bcb1-6a5e-39df221a579b@proxmox.com> (raw)
In-Reply-To: <20210407102537.28046-1-f.ebner@proxmox.com>

Am 07.04.21 um 12:25 schrieb Fabian Ebner:
> Only match against the file name to avoid false positives with directory names
> containing "-$vmid-".
> 
> Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
> ---
> 
> Found while trying to debug/reproduce a forum thread[0], but the path there
> should not be affected by this...
> 

This was in fact the issue. The user used a pseudonym for the storage 
name/path, and the actual path is affected. So I suppose the link to the 
forum thread could go into the commit message for completeness.

> [0]: https://forum.proxmox.com/threads/vzdump-removing-too-many-backups.87072/
> 
>   PVE/Storage/Plugin.pm | 4 +++-
>   1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/PVE/Storage/Plugin.pm b/PVE/Storage/Plugin.pm
> index d2d8184..05f1701 100644
> --- a/PVE/Storage/Plugin.pm
> +++ b/PVE/Storage/Plugin.pm
> @@ -1034,11 +1034,13 @@ my $get_subdir_files = sub {
>   	    $info = { volid => "$sid:vztmpl/$1", format => "t$2" };
>   
>   	} elsif ($tt eq 'backup') {
> -	    next if defined($vmid) && $fn !~  m/\S+-$vmid-\S+/;
>   	    next if $fn !~ m!/([^/]+\.(tgz|(?:(?:tar|vma)(?:\.(${\COMPRESSOR_RE}))?)))$!;
>   	    my $original = $fn;
>   	    my $format = $2;
>   	    $fn = $1;
> +
> +	    next if defined($vmid) && $fn !~ m/\S+-$vmid-\S+/;
> +
>   	    $info = { volid => "$sid:backup/$fn", format => $format };
>   
>   	    my $archive_info = eval { PVE::Storage::archive_info($fn) } // {};
> 




  parent reply	other threads:[~2021-04-09  6:59 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-07 10:25 Fabian Ebner
2021-04-07 10:25 ` [pve-devel] [PATCH storage 2/2] prune backups: make vmid filtering more robust Fabian Ebner
2021-04-09 10:51   ` [pve-devel] applied: " Thomas Lamprecht
2021-04-09  6:59 ` Fabian Ebner [this message]
2021-04-09 10:51 ` [pve-devel] applied: [PATCH storage 1/2] plugin: subdir files: backup: don't match for vmid against the full path Thomas Lamprecht
2021-04-09 12:52   ` Fabian Ebner

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=1b9dd2b2-2ccc-bcb1-6a5e-39df221a579b@proxmox.com \
    --to=f.ebner@proxmox.com \
    --cc=pve-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 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