]> git.proxmox.com Git - proxmox-backup.git/commit
fuse_loop: handle unmap on crashed instance
authorStefan Reiter <s.reiter@proxmox.com>
Wed, 7 Oct 2020 11:53:08 +0000 (13:53 +0200)
committerDietmar Maurer <dietmar@proxmox.com>
Thu, 8 Oct 2020 06:38:25 +0000 (08:38 +0200)
commit735ee5206ac4f6dbf12105925f47cdd4f958a520
treed9f85e652db54269214516556c3093f3c7d43289
parenta86bf52390e80c14a2a5f7e8158c79170fa23c62
fuse_loop: handle unmap on crashed instance

If a fuse_loop instance dies suddenly (e.g. SIGKILL), the FUSE mount and
loop device assignment are left behind. We can determine this scenario
on specific unmap, when the PID file is either missing or contains a PID
of a non-running process, but the backing file and potentially loop
device are still there.

If that's the case, do an "emergency cleanup", by unassigning the
loopdev, calling 'fusermount -u' and then cleaning any leftover files
manually.

With this in place, pretty much any situation is now recoverable via
only the 'proxmox-backup-client' binary, by either calling 'unmap' with
or without parameters.

Signed-off-by: Stefan Reiter <s.reiter@proxmox.com>
src/tools/fuse_loop.rs