[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] Fatal crash on xen4.2 HVM + qemu-xen dm + NFS



Konrad,

--On 23 January 2013 16:29:20 +0000 Stefano Stabellini <stefano.stabellini@xxxxxxxxxxxxx> 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 <alex@xxxxxxxxxxx>
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 {



_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.