WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

Re: [Xen-devel] Tapdisk O_DIRECT breaks read-only-ness

To: Christopher Head <chead@xxxxxxxxx>
Subject: Re: [Xen-devel] Tapdisk O_DIRECT breaks read-only-ness
From: Samuel Thibault <samuel.thibault@xxxxxxxxxxxxx>
Date: Fri, 11 Jul 2008 11:23:27 +0100
Cc: xen-devel@xxxxxxxxxxxxxxxxxxx
Delivery-date: Fri, 11 Jul 2008 03:23:47 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <4876DB3E.2060707@xxxxxxxxx>
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Mail-followup-to: Samuel Thibault <samuel.thibault@xxxxxxxxxxxxx>, Christopher Head <chead@xxxxxxxxx>, xen-devel@xxxxxxxxxxxxxxxxxxx
References: <4876DB3E.2060707@xxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Mutt/1.5.12-2006-07-14
Christopher Head, le Thu 10 Jul 2008 21:02:06 -0700, a écrit :
> However, on line 141 of tools/blktap/drivers/block-sync.c, at least as
> of revision 16947:f66bb3b80661 of Xen 3.2, it looks like there's a
> slight logic error: this line is where the open() system call is
> repeated without O_DIRECT (in case O_DIRECT fails), but instead of
> passing in o_flags as the second parameter, O_RDWR|O_LARGEFILE is passed
> directly.



tapdisk: in case O_DIRECT fails, retry again with o_flags but O_DIRECT,
instead of fixed value O_RD_WR | O_LARGEFILE

Signed-off-by: Samuel Thibault <samuel.thibault@xxxxxxxxxxxxx>

diff -r 06d80308aa2e tools/blktap/drivers/block-sync.c
--- a/tools/blktap/drivers/block-sync.c Thu Jul 10 19:23:55 2008 +0100
+++ b/tools/blktap/drivers/block-sync.c Fri Jul 11 11:21:58 2008 +0100
@@ -129,7 +129,7 @@
 
                 /* Maybe O_DIRECT isn't supported. */
                o_flags &= ~O_DIRECT;
-                fd = open(name, O_RDWR | O_LARGEFILE);
+                fd = open(name, o_flags);
                 if (fd != -1) DPRINTF("WARNING: Accessing image without"
                                      "O_DIRECT! (%s)\n", name);
 

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel

<Prev in Thread] Current Thread [Next in Thread>