[pve-devel] [PATCH pve-storage v1 2/3] plugin: remove needless inequality check when creating content subdirs
Fiona Ebner
f.ebner at proxmox.com
Mon Jan 19 11:58:05 CET 2026
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 at 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;
> }
> }
> }
More information about the pve-devel
mailing list