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

Re: [Xen-devel] [PATCH] QEMU(upstream): Disable xen's use of O_DIRECT by default as it results in crashes.



On Thu, 7 Mar 2013, Alex Bligh wrote:
> 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 <alex@xxxxxxxxxxx>
> ---
>  hw/xen_disk.c |    4 +++-
>  1 files changed, 3 insertions(+), 1 deletions(-)
> 
> 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 {

I would just remove use_o_direct and BDRV_O_NOCACHE altogether

_______________________________________________
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®.