[pve-devel] [PATCH storage 1/2] fix #3873: btrfs: check for correct subvolume taking snapshot

Maximiliano Sandoval m.sandoval at proxmox.com
Fri Sep 13 15:43:20 CEST 2024


Maximiliano Sandoval <m.sandoval at proxmox.com> writes:

> Suppose we are doing a snapshot of disk 0 for VM 100. The
> dir_glob_foreach runs over $path=/subvolume/images/100, lists all
> snapshot names and appends their names to the path of the disk, e.g.
> /subvolume/images/vm-100-disk-0 at SNAP_NAME, but the original directory
> $path might contain a second disk `vm-100-disk-1` which is also listed
> by the dir_glib_foreach.
>
> The patch skips images which reference other disks.
>
> Signed-off-by: Maximiliano Sandoval <m.sandoval at proxmox.com>

For the sake of documenting this, one can reproduce the error via:

- Create a 2-node cluster
- Add a BTRFS storage named "test" on both nodes
- Create a new VM on node 1
- Add a new disk using "test" as a storage
- take a snapshot
- Add a new disk using "test" as a storage
- take a snapshot
- migrate to node 2

This will throw a warning without this patch.

-- 
Maximiliano




More information about the pve-devel mailing list