From: Christoph Hellwig <hch@lst.de>
To: Glauber Costa <glommer@redhat.com>
Cc: Christoph Hellwig <hch@lst.de>, qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH 2/4] raw-posix: add a raw_open_common helper
Date: Thu, 11 Jun 2009 18:00:30 +0200 [thread overview]
Message-ID: <20090611160030.GA3099@lst.de> (raw)
In-Reply-To: <20090609195449.GE19375@poweredge.glommer>
On Tue, Jun 09, 2009 at 04:54:49PM -0300, Glauber Costa wrote:
> > -
> > + s->fd = -1;
> > fd = open(filename, s->open_flags, 0644);
> > if (fd < 0) {
> > ret = -errno;
> it is not equivalent to the current code, while you claim it is.
> this one will return EROFS to the external world, while old code
> would return EACCES. If there is any user relying on that return value,
> we're screwed. And as a matter of fact, it appears to be (bdrv_open2)
The code to turn -EROFS into -EACCES is also present in raw_open (and
thus the new raw_open_common), it just didn't make it into the visible
patch hunk.
> > - s->open_flags |= O_BINARY;
> > - if ((flags & BDRV_O_ACCESS) == O_RDWR) {
> > - s->open_flags |= O_RDWR;
> > - } else {
> > - s->open_flags |= O_RDONLY;
> > - bs->read_only = 1;
> > - }
> > - /* Use O_DSYNC for write-through caching, no flags for write-back caching,
> > - * and O_DIRECT for no caching. */
> > - if ((flags & BDRV_O_NOCACHE))
> > - s->open_flags |= O_DIRECT;
> > - else if (!(flags & BDRV_O_CACHE_WB))
> > - s->open_flags |= O_DSYNC;
> >
> What happened to those flags? Are you just throwing them away?
raw_open_common deals with those, we just consolidated those to one
single site.
prev parent reply other threads:[~2009-06-11 16:00 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-05-25 7:59 [Qemu-devel] [PATCH 2/4] raw-posix: add a raw_open_common helper Christoph Hellwig
2009-06-09 19:54 ` Glauber Costa
2009-06-11 16:00 ` Christoph Hellwig [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=20090611160030.GA3099@lst.de \
--to=hch@lst.de \
--cc=glommer@redhat.com \
--cc=qemu-devel@nongnu.org \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).