From patchwork Fri Apr 5 10:31:45 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [PATCHv2, 2/2] Xen PV backend: Disable use of O_DIRECT by default as it results in crashes. X-Patchwork-Submitter: Alex Bligh X-Patchwork-Id: 234103 Message-Id: <1365157905-22987-2-git-send-email-alex@alex.org.uk> To: Stefano Stabellini Cc: Ian Campbell , George Dunlap , Ian Jackson , qemu-devel@nongnu.org, xen-devel , Alex Bligh , Anthony Liguori , Paolo Bonzini Date: Fri, 5 Apr 2013 11:31:45 +0100 From: Alex Bligh List-Id: 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. This brings PV devices in line with emulated devices. Removing O_DIRECT is safe as barrier operations are now correctly passed through. 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 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/xen_disk.c b/hw/xen_disk.c index dd5a711..195dbb2 100644 --- a/hw/xen_disk.c +++ b/hw/xen_disk.c @@ -783,7 +783,7 @@ static int blk_connect(struct XenDevice *xendev) int pers, index, qflags; /* 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; }