From mboxrd@z Thu Jan 1 00:00:00 1970 From: Alex Bligh Subject: [PATCHv2] QEMU(upstream): Disable xen's use of O_DIRECT by default as it results in crashes. Date: Fri, 8 Mar 2013 09:25:56 +0000 Message-ID: <1362734756-23330-1-git-send-email-alex@alex.org.uk> References: Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: xen-devel , Stefano Stabellini Cc: Jan Beulich , Ian Jackson , Ian Campbell , Alex Bligh , Konrad Rzeszutek Wilk List-Id: xen-devel@lists.xenproject.org Due to what is almost certainly a kernel bug, writes with O_DIRECT may continue to reference the page after the write has been marked as completed, particularly in the case of TCP retransmit. In other scenarios, this "merely" risks data corruption on the write, but with Xen pages from domU are only transiently mapped into dom0's memory, resulting in kernel panics when they are subsequently accessed. See: http://lists.xen.org/archives/html/xen-devel/2012-12/msg01154.html for more details. Signed-off-by: Alex Bligh --- hw/xen_disk.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/hw/xen_disk.c b/hw/xen_disk.c index a402ac8..14f8723 100644 --- a/hw/xen_disk.c +++ b/hw/xen_disk.c @@ -603,7 +603,7 @@ static int blk_init(struct XenDevice *xendev) } /* read-only ? */ - qflags = BDRV_O_NOCACHE | BDRV_O_CACHE_WB | BDRV_O_NATIVE_AIO; + qflags = BDRV_O_CACHE_WB | BDRV_O_NATIVE_AIO; if (strcmp(blkdev->mode, "w") == 0) { qflags |= BDRV_O_RDWR; } else { -- 1.7.4.1