[pve-devel] [PATCH storage 3/3] btrfs: volume export: fix command for incremental stream

Fiona Ebner f.ebner at proxmox.com
Fri Feb 21 16:41:11 CET 2025


The subvolume itself cannot be included if there is a base snapshot
or the command would fail with e.g.

> ERROR: subvolume /mnt/btrfs/images/400/vm-400-disk-0 is not read-only

Signed-off-by: Fiona Ebner <f.ebner at proxmox.com>
---
 src/PVE/Storage/BTRFSPlugin.pm | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/PVE/Storage/BTRFSPlugin.pm b/src/PVE/Storage/BTRFSPlugin.pm
index b0f732b..2e58f60 100644
--- a/src/PVE/Storage/BTRFSPlugin.pm
+++ b/src/PVE/Storage/BTRFSPlugin.pm
@@ -780,7 +780,8 @@ sub volume_export {
     }
     push @$cmd, '--';
     if (ref($with_snapshots) eq 'ARRAY') {
-	push @$cmd, (map { "$path\@$_" } ($with_snapshots // [])->@*), $path;
+	push @$cmd, (map { "$path\@$_" } ($with_snapshots // [])->@*);
+	push @$cmd, $path if !defined($base_snapshot);
     } else {
 	dir_glob_foreach(dirname($path), $BTRFS_VOL_REGEX, sub {
 	    push @$cmd, "$path\@$_[2]" if !(defined($snapshot) && $_[2] eq $snapshot);
-- 
2.39.5





More information about the pve-devel mailing list