[pve-devel] [PATCH pve-storage v1 2/3] plugin: remove needless inequality check when creating content subdirs
Max R. Carrara
m.carrara at proxmox.com
Fri Dec 5 16:43:55 CET 2025
`$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`.
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;
}
}
}
--
2.47.3
More information about the pve-devel
mailing list