From: Alex Bligh Subject: Re: Fatal crash on xen4.2 HVM + qemu-xen dm + NFS Date: Fri, 25 Jan 2013 11:28:31 +0000 Message-ID: <850CD247D67BBF77A4CF0417@nimrod.local> References: <5B4525F296F6ABEB38B0E614@nimrod.local> <50CEFDA602000078000B0B11@nat28.tlf.novell.com> <3B1D0701EAEA6532CEA91EA0@Ximines.local> <77822E2DDAEA8F94631B6A52@Ximines.local> <1358781790.3279.224.camel@zakaz.uk.xensource.com> <1358783420.3279.235.camel@zakaz.uk.xensource.com> <19EA31DDC3BEF4D66B42CBAC@Ximines.local> <4D54EE421529BA5E0A511E31@nimrod.local> Reply-To: Alex Bligh Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; Format="flowed" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: Content-Disposition: inline List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Stefano Stabellini , Konrad Wilk Cc: Alex Bligh , Xen Devel , Ian Campbell , Jan Beulich , Stefano Stabellini List-Id: xen-devel@lists.xenproject.org Konrad, --On 23 January 2013 16:29:20 +0000 Stefano Stabellini wrote: >> diff --git a/hw/xen_disk.c b/hw/xen_disk.c >> index a402ac8..1c3a6f5 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_NOCACHE | */ BDRV_O_CACHE_WB | BDRV_O_NATIVE_AIO; >> if (strcmp(blkdev->mode, "w") == 0) { >> qflags |= BDRV_O_RDWR; >> } else { > > Before going for something like that I would like a confirmation from > Konrad about blkfront behavior regarding barriers and > BLKIF_OP_FLUSH_DISKCACHE. I certainly don't want to risk data > corruptions. Any ideas? A slightly prettier patch would look like the one pasted below (not sent with git-sendemail so beware whitespace issues). -- Alex Bligh commit a7d7296aebc21af15074f3bf64c5c6795ca05f16 Author: Alex Bligh Date: Thu Jan 24 09:41:34 2013 +0000 Disable use of O_DIRECT by default as it results in crashes. See: http://lists.xen.org/archives/html/xen-devel/2012-12/msg01154.html for more details. diff --git a/hw/xen_disk.c b/hw/xen_disk.c index a402ac8..a618d8d 100644 --- a/hw/xen_disk.c +++ b/hw/xen_disk.c @@ -45,6 +45,8 @@ static int batch_maps = 0; static int max_requests = 32; +static int use_o_direct = 0; + /* ------------------------------------------------------------- */ #define BLOCK_SIZE 512 @@ -603,7 +605,7 @@ static int blk_init(struct XenDevice *xendev) } /* read-only ? */ - qflags = BDRV_O_NOCACHE | BDRV_O_CACHE_WB | BDRV_O_NATIVE_AIO; + qflags = (use_o_direct?BDRV_O_NOCACHE:0) | BDRV_O_CACHE_WB | BDRV_O_NATIVE_AIO; if (strcmp(blkdev->mode, "w") == 0) { qflags |= BDRV_O_RDWR; } else {