]> git.proxmox.com Git - pve-container.git/commit
Prevent race conditions in snapshot mode backup
authorFabian Grünbichler <f.gruenbichler@proxmox.com>
Fri, 11 Mar 2016 10:44:47 +0000 (11:44 +0100)
committerDietmar Maurer <dietmar@proxmox.com>
Mon, 14 Mar 2016 07:50:57 +0000 (08:50 +0100)
commit91458f714d1ba619107194c051d57e1cfbca1fa9
tree49641e6262d3a1ac05f1717009b01bb2b0bb35dc
parentad408fe1f332fea5cffb36fe874a3864a4e40f5f
Prevent race conditions in snapshot mode backup

Instead of dropping the 'backup' lock early on when doing
snapshot backups, drop it temporarily for snapshot
operations that set their own 'snapshot' lock, and protect
the "unlock_vm, snapshot_XX, lock_vm" sequence by holding an
flock for the config file.

Before this change it was possible to interfere with the
backup job by setting a different lock with another
operation inbetween the call to unlock_vm and
snapshot_create (or snapshot_delete).

The final lock_vm is re-introduced in order to be more
consistent with the other backup modes and to prevent
changes to the configuration file before assemble()
reloads the configuration that is included in the backup.
src/PVE/VZDump/LXC.pm