Go to file
Rusty Bird f3ffcfe9ba
qfile-unpacker: syncfs() to avoid qvm-move-to-vm data loss
Commit https://github.com/QubesOS/qubes-linux-utils/commit/c1d42f1 --
"qfile-unpacker: do not call fdatasync() at each file" fixing
QubesOS/qubes-issues#1257 -- increased the chance of data loss with
qvm-move-to-vm: Say it nominally succeeds, and *deletes* the files from
the source VM. Soon after, the destination VM or the system could crash,
or an external drive hosting ~/QubesIncoming/srcVM could get unplugged
by accident, all before the data had really been persisted to disk.

But reverting the commit (ignoring the performance issue) wouldn't
completely solve this:

  "Calling fsync() does not necessarily ensure that the entry in the
   directory containing the file has also reached disk. For that an
   explicit fsync() on a file descriptor for the directory is also
   needed."  - fsync(2)

It gets even worse for "slow symlinks" (whose target is too long to be
stored directly in the inode metadata), apparently they can't be synced
at all individually.

So instead, just call syncfs() once after everything has been unpacked:

  + Should prevent all data loss (if fs and disk are well behaved)
  + Allows caching and reordering -> no slowdown with many small files
  - Blocks until any unrelated writes on the filesystem finish :\

(cherry picked from commit 4f59b3df6f)
2015-12-11 21:08:02 +01:00
archlinux archlinux: ensure /usr/sbin is not use to follow archlinux packaging guidelines 2015-07-08 14:33:48 +02:00
core imgconverter: ensure that connection to the VM is properly closed 2015-08-08 04:22:05 +02:00
debian debian: prevent upgrades without new enough qubes-core-agent 2015-12-11 19:30:37 +01:00
dracut dracut: load ext4 module manually in minimalistic dracut module 2015-03-25 23:25:33 +01:00
kernel-modules Compile u2mfn module only when not already present 2015-03-25 23:25:33 +01:00
pkgs archlinux: created build scripts 2013-04-17 01:48:28 +02:00
qmemman Report Xen balloon current size instead of Linux total memory 2015-10-11 02:51:00 +02:00
qrexec-lib qfile-unpacker: syncfs() to avoid qvm-move-to-vm data loss 2015-12-11 21:08:02 +01:00
rpm_spec rpm: disable debuginfo subpackage in qubes-kernel-vm-support 2015-11-13 06:06:59 +01:00
udev udev: do not use a separate lock for udev block scripts 2015-06-28 21:59:39 +02:00
.gitignore gitignore 2014-07-26 03:36:31 +02:00
Makefile archlinux: update to match new dependancies and archlinux /usr/lib guidelines 2015-07-08 11:08:47 +02:00
Makefile.builder Add VM kernel related files as qubes-core-vm-kernel-support package 2015-03-25 23:25:33 +01:00
version version 3.0.13 2015-11-13 23:20:22 +01:00