Fix vzctl destroy

vzctl tries to perform async removal of VE private area, by first (1) moving it
to a directory under $MNT/tmp (where $MNT is the mount point of the partition
holding VE private area, usually $MNT is /vz or /var/lib/vz), and when
spawning an async process what removes that directory.

The problem is if $MNT/tmp is not on the same device (it could be tmpfs
or a symlink to other tmp dir), such move as in (1) fails with EXDEV error.

We address the problem twofold:

1. Use less common "vztmp" name instead of "tmp", which reduces the
possibility of $MNT/vztmp being a different device.

2. When rename() returns EXDEV, do a synchronous removal, i.e. just run rm -rf

Signed-off-by: Kir Kolyshkin <kir@openvz.org>
1 file changed