]> git.proxmox.com Git - pve-container.git/commit
Fix #576: Fix dangling files for Move Disk
authorDominic Jäger <d.jaeger@proxmox.com>
Wed, 12 Jun 2019 10:04:57 +0000 (12:04 +0200)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Fri, 14 Jun 2019 08:34:21 +0000 (10:34 +0200)
commit75c2677fb5f26fce508a81528cc730f56fc9118c
treece066784e140829c9a32b9d6cff64a48b139d469
parent68300601d205649d702afec522d8bc575d772e62
Fix #576: Fix dangling files for Move Disk

When Move Disk is called for a container rsync starts copying it to a
new destination. This initial rsync process gets killed when the Stop
button gets pressed. At this moment the destination file is not fully
copied and useless as a consequence. Our code already tries to remove
it. However, rsync has forked and those forks are still accessing the
destination file for some time. Thus, the attempt to remove it fails.

With the patch we wait for other processes to release the destination
files. As we are in a mount namespace and protected by a config lock,
those other processes should be children of rsync only. The waiting
time was less than a second when I tried it. Afterwards, the existing
remove procedure is carried out.

Co-developed-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
Signed-off-by: Dominic Jäger <d.jaeger@proxmox.com>
src/PVE/LXC.pm