All of lore.kernel.org
 help / color / mirror / Atom feed
From: Samuel Thibault <samuel.thibault@eu.citrix.com>
To: Christopher Head <chead@cs.ubc.ca>
Cc: xen-devel@lists.xensource.com
Subject: Re: Tapdisk O_DIRECT breaks read-only-ness
Date: Fri, 11 Jul 2008 11:23:27 +0100	[thread overview]
Message-ID: <20080711102327.GB4506@implementation.uk.xensource.com> (raw)
In-Reply-To: <4876DB3E.2060707@cs.ubc.ca>

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@eu.citrix.com>

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);
 

      reply	other threads:[~2008-07-11 10:23 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-07-11  4:02 Tapdisk O_DIRECT breaks read-only-ness Christopher Head
2008-07-11 10:23 ` Samuel Thibault [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20080711102327.GB4506@implementation.uk.xensource.com \
    --to=samuel.thibault@eu.citrix.com \
    --cc=chead@cs.ubc.ca \
    --cc=xen-devel@lists.xensource.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.