]> git.proxmox.com Git - pve-storage.git/commit
activate storage: ensure content directories are created before checking them
authorThomas Lamprecht <t.lamprecht@proxmox.com>
Fri, 9 Jun 2023 11:26:06 +0000 (13:26 +0200)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Fri, 9 Jun 2023 11:32:11 +0000 (13:32 +0200)
commit8e623a2930f7aee4b3309b1f297613a250ee4698
tree2d9c77086757bcf3dd7ee023ba636533f83ba479
parentdcc761c628824f240f24ca100fde31887d0ac0dc
activate storage: ensure content directories are created before checking them

checking the content dirs for clashes via abs_path must be done after
the logic for creating them ran, as abs_path is working on actual
filesystem level, so it will return undf if the directory does not
exist, in which case we then set a hash entry for "undef", and the
next for loop round then resolved again to "undef", resulting in a
false-positive of the check.

Avoid the dangerous "return if" stanzas and reverse them to an actual
if block, which is much safer to adapt. Then move the check for
duplicate content-dir usage after that.

best viewed with white space change ignored: git show -w

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
src/PVE/Storage/Plugin.pm