[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [Bug 1368815] Re: qemu-img convert intermittently corrupts
From: |
Matt Riedemann |
Subject: |
[Qemu-devel] [Bug 1368815] Re: qemu-img convert intermittently corrupts output images |
Date: |
Mon, 15 Sep 2014 15:16:25 -0000 |
Marking as High since duplicate bug 1350766 was marked High.
** Changed in: nova
Importance: Medium => High
--
You received this bug notification because you are a member of qemu-
devel-ml, which is subscribed to QEMU.
https://bugs.launchpad.net/bugs/1368815
Title:
qemu-img convert intermittently corrupts output images
Status in OpenStack Compute (Nova):
Triaged
Status in QEMU:
New
Bug description:
-- Found in releases qemu-2.0.0, qemu-2.0.2, qemu-2.1.0. Tested on
Ubuntu 14.04 using Ext4 filesystems.
The command
qemu-img convert -O raw inputimage.qcow2 outputimage.raw
intermittently creates corrupted output images, when the input image
is not yet fully synchronized to disk. While the issue has actually
been discovered in operation of of OpenStack nova, it can be
reproduced "easily" on command line using
cat $SRC_PATH > $TMP_PATH && $QEMU_IMG_PATH convert -O raw $TMP_PATH
$DST_PATH && cksum $DST_PATH
on filesystems exposing this behavior. (The difficult part of this
exercise is to prepare a filesystem to reliably trigger this race. On
my test machine some filesystems are affected while other aren't, and
unfortunately I haven't found the relevant difference between them,
yet. Possible it's timing issues completely out of userspace control
...)
The root cause, however, is the same as in
http://lists.gnu.org/archive/html/coreutils/2011-04/msg00069.html
and it can be solved the same way as suggested in
http://lists.gnu.org/archive/html/coreutils/2011-04/msg00102.html
In qemu, file block/raw-posix.c use the FIEMAP_FLAG_SYNC, i.e change
f.fm.fm_flags = 0;
to
f.fm.fm_flags = FIEMAP_FLAG_SYNC;
As discussed in the thread mentioned above, retrieving a page cache
coherent map of file extents is possible only after fsync on that
file.
See also
https://bugs.launchpad.net/nova/+bug/1350766
In that bug report filed against nova, fsync had been suggested to be
performed by the framework invoking qemu-img. However, as the choice
of fiemap -- implying this otherwise unneeded fsync of a temporary
file -- is not made by the caller but by qemu-img, I agree with the
nova bug reviewer's objection to put it into nova. The fsync should
instead be triggered by qemu-img utilizing the FIEMAP_FLAG_SYNC,
specifically intended for that purpose.
To manage notifications about this bug go to:
https://bugs.launchpad.net/nova/+bug/1368815/+subscriptions
- [Qemu-devel] [PATCH v2 00/14] TCG ppc speedups, Paolo Bonzini, 2014/09/15
- [Qemu-devel] [PATCH 04/14] ppc: introduce ppc_get_cr and ppc_set_cr, Paolo Bonzini, 2014/09/15
- [Qemu-devel] [PATCH 01/14] ppc: do not look at the MMU index to detect PR/HV mode, Paolo Bonzini, 2014/09/15
- [Qemu-devel] [PATCH 02/14] softmmu: support up to 12 MMU modes, Paolo Bonzini, 2014/09/15
- [Qemu-devel] [PATCH 05/14] ppc: use CRF_* in fpu_helper.c, Paolo Bonzini, 2014/09/15
- [Qemu-devel] [PATCH 03/14] target-ppc: use separate indices for various translation modes, Paolo Bonzini, 2014/09/15
- [Qemu-devel] [PATCH 06/14] ppc: introduce helpers for mfocrf/mtocrf, Paolo Bonzini, 2014/09/15
- [Qemu-devel] [PATCH 07/14] ppc: reorganize gen_compute_fprf, Paolo Bonzini, 2014/09/15
- [Qemu-devel] [PATCH 08/14] ppc: introduce gen_op_mfcr/gen_op_mtcr, Paolo Bonzini, 2014/09/15
- [Qemu-devel] [PATCH 09/14] ppc: introduce ppc_get_crf and ppc_set_crf, Paolo Bonzini, 2014/09/15
- [Qemu-devel] [PATCH 10/14] ppc: use movcond for isel, Paolo Bonzini, 2014/09/15