[pve-devel] [PATCH common/container] fix syncfs usage for snapshot backup

Stoiko Ivanov s.ivanov at proxmox.com
Thu Sep 17 21:16:59 CEST 2020


while investigating #2991 (and probably related #1911) I straced pvedaemon
noticing that the syncfs-calls all failed (errno EBADF).

This happens because we open the mountpoint path with O_PATH (open(2)), which
causes syncfs to fail.

Since I expect syncfs failing to be a potential cause for the inconstent
state of containers on ceph-storages while backing up in snapshot mode this
patchset hopefully mitigates the reported issues.

(if this is not the solution, I was also investigating calling
ioctl(fd, FIFREEZE) on the mountpoint before creating the snapshot)

The patch to pve-container is maybe not necessary, but should save us a few
syscalls, which don't help.

Would be grateful for review from more experienced eyes - I ran limted tests
with the patches applied - creating snapshot backups on a container with
lvmthin backed rootfs and on one with ceph backed rootfs.

pve-common
Stoiko Ivanov (1):
  sync_mountpoint: open path so that sync works

 src/PVE/Tools.pm | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

pve-container:
Stoiko Ivanov (1):
  sync_container_namespace: skip virtual filesystems

 src/PVE/LXC.pm | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

-- 
2.20.1






More information about the pve-devel mailing list