X-Git-Url: https://git.proxmox.com/?a=blobdiff_plain;ds=sidebyside;f=PVE%2FStorage%2FBTRFSPlugin.pm;h=5360dca7184e3e7070c2a5568bc604bdb5778e30;hb=f449cddc799699bfa0b37f9cdf2b40f5392fb280;hp=dc5894a28d96b3b4edd901e8f67bad8a8b879be1;hpb=f6abd82a6da82283c7597068553eee8241a0f09e;p=pve-storage.git diff --git a/PVE/Storage/BTRFSPlugin.pm b/PVE/Storage/BTRFSPlugin.pm index dc5894a..5360dca 100644 --- a/PVE/Storage/BTRFSPlugin.pm +++ b/PVE/Storage/BTRFSPlugin.pm @@ -112,8 +112,21 @@ my sub assert_btrfs($) { sub activate_storage { my ($class, $storeid, $scfg, $cache) = @_; - PVE::Storage::DirPlugin::activate_storage($class, $storeid, $scfg, $cache); - assert_btrfs($scfg->{path}); + + my $path = $scfg->{path}; + if (!defined($scfg->{mkdir}) || $scfg->{mkdir}) { + mkpath $path; + } + + my $mp = PVE::Storage::DirPlugin::parse_is_mountpoint($scfg); + if (defined($mp) && !path_is_mounted($mp, $cache->{mountdata})) { + die "unable to activate storage '$storeid' - directory is expected to be a mount point but" + ." is not mounted: '$mp'\n"; + } + + assert_btrfs($path); # only assert this stuff now, ensures $path is there and better UX + + $class->SUPER::activate_storage($storeid, $scfg, $cache); } sub status {