]> git.proxmox.com Git - pve-container.git/commitdiff
fix #1851: check 'replicate' flag for non-volume mountpoints
authorDominik Csapak <d.csapak@proxmox.com>
Tue, 31 Jul 2018 11:44:40 +0000 (13:44 +0200)
committerWolfgang Bumiller <w.bumiller@proxmox.com>
Tue, 31 Jul 2018 11:51:26 +0000 (13:51 +0200)
setting replicate=0 for a bind mount only makes sense if we
really skip it for replication

also cleanup for them is not necessary, as bind mounts
could not have ever been replicated, thus there should
not be anything to clean up

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
src/PVE/LXC/Config.pm

index e7548ffff842774e364dcc006c416319b5374698..486706f6b42599d034332abb61db09ecbf8252bf 100644 (file)
@@ -1320,11 +1320,18 @@ sub get_replicatable_volumes {
     my $test_volid = sub {
        my ($volid, $mountpoint) = @_;
 
+       my $replicate = $mountpoint->{replicate} // 1;
+
        return if !$volid;
 
        my $mptype = $mountpoint->{type};
-       die "unable to replicate mountpoint type '$mptype'\n"
-           if $mptype ne 'volume';
+
+       if ($mptype ne 'volume') {
+           # skip bindmounts if replicate = 0 even for cleanup,
+           # since bind mounts could not have been replicated ever
+           return if !$replicate;
+           die "unable to replicate mountpoint type '$mptype'\n";
+       }
 
        my ($storeid, $volname) = PVE::Storage::parse_volume_id($volid, $noerr);
        return if !$storeid;
@@ -1337,7 +1344,7 @@ sub get_replicatable_volumes {
 
        die "unable to replicate volume '$volid', type '$vtype'\n" if $vtype ne 'images';
 
-       return if !$cleanup && defined($mountpoint->{replicate}) && !$mountpoint->{replicate};
+       return if !$cleanup && !$replicate;
 
        if (!PVE::Storage::volume_has_feature($storecfg, 'replicate', $volid)) {
            return if $cleanup || $noerr;