public inbox for pve-devel@lists.proxmox.com
 help / color / mirror / Atom feed
From: Fiona Ebner <f.ebner@proxmox.com>
To: Proxmox VE development discussion <pve-devel@lists.proxmox.com>,
	"Max R. Carrara" <m.carrara@proxmox.com>
Subject: Re: [pve-devel] [PATCH pve-storage v1 2/3] plugin: remove needless inequality check when creating content subdirs
Date: Mon, 19 Jan 2026 11:58:05 +0100	[thread overview]
Message-ID: <60139202-64a0-4111-9773-a571ffde0389@proxmox.com> (raw)
In-Reply-To: <20251205154404.446338-3-m.carrara@proxmox.com>

Am 05.12.25 um 4:44 PM schrieb Max R. Carrara:
> `$subdir` is a subdirectory of `$path`, so the variables are never
> equal. Even if they were equal for some reason, calling `mkpath` here
> wouldn't fail or be otherwise dangerous.
> 
> Note that even if the user happened to configure an empty path for a
> given content subdirectory, `get_subdir` would still return "$path/",
> which is obviously not equal to `$path`.

Note that a third-party plugin might return the very same value, so the
commit message is inaccurate. I do agree the check can be removed.

> 
> Therefore, remove this check.
> 
> Signed-off-by: Max R. Carrara <m.carrara@proxmox.com>
> ---
>  src/PVE/Storage/Plugin.pm | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/src/PVE/Storage/Plugin.pm b/src/PVE/Storage/Plugin.pm
> index 65f2551..617b0f8 100644
> --- a/src/PVE/Storage/Plugin.pm
> +++ b/src/PVE/Storage/Plugin.pm
> @@ -1919,7 +1919,7 @@ sub activate_storage {
>                  || ($vtype eq 'backup' && defined($scfg->{content}->{'rootdir'}))
>              ) {
>                  my $subdir = $class->get_subdir($scfg, $vtype);
> -                mkpath $subdir if $subdir ne $path;
> +                mkpath $subdir;
>              }
>          }
>      }



_______________________________________________
pve-devel mailing list
pve-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel


  reply	other threads:[~2026-01-19 10:58 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-12-05 15:43 [pve-devel] [PATCH pve-storage v1 0/3] Improve mkpath Error Message in activate_storage Max R. Carrara
2025-12-05 15:43 ` [pve-devel] [PATCH pve-storage v1 1/3] plugin: use guard clause to reduce nesting Max R. Carrara
2025-12-05 15:43 ` [pve-devel] [PATCH pve-storage v1 2/3] plugin: remove needless inequality check when creating content subdirs Max R. Carrara
2026-01-19 10:58   ` Fiona Ebner [this message]
2025-12-05 15:43 ` [pve-devel] [PATCH pve-storage v1 3/3] plugin: improve error handling when creating a content subdir fails Max R. Carrara
2026-01-15 14:33   ` 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=60139202-64a0-4111-9773-a571ffde0389@proxmox.com \
    --to=f.ebner@proxmox.com \
    --cc=m.carrara@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