[pve-devel] [PATCH storage 2/3] btrfs: volume import: fix check for presence of base snapshot

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


For a 'raw' volume, the path includes the '/disk.raw' suffix, but the
check expects the containing subvolume directory.

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

diff --git a/src/PVE/Storage/BTRFSPlugin.pm b/src/PVE/Storage/BTRFSPlugin.pm
index cadd9d1..b0f732b 100644
--- a/src/PVE/Storage/BTRFSPlugin.pm
+++ b/src/PVE/Storage/BTRFSPlugin.pm
@@ -822,6 +822,7 @@ sub volume_import {
 
     if (defined($base_snapshot)) {
 	my $path = $class->path($scfg, $volname, $storeid, $base_snapshot);
+	$path = raw_file_to_subvol($path) if $volume_format eq 'raw';
 	die "base snapshot '$base_snapshot' not found - no such directory '$path'\n"
 	    if !path_is_subvolume($path);
     }
-- 
2.39.5





More information about the pve-devel mailing list