From: Christoph Hellwig <hch@lst.de>
To: Naphtali Sprei <nsprei@redhat.com>
Cc: Christoph Hellwig <hch@lst.de>, qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH v2 0/4] Modifications to the drives' readonly attribute
Date: Thu, 21 Jan 2010 14:37:30 +0100 [thread overview]
Message-ID: <20100121133730.GA12072@lst.de> (raw)
In-Reply-To: <4B585460.4070901@redhat.com>
On Thu, Jan 21, 2010 at 03:19:28PM +0200, Naphtali Sprei wrote:
>
> >
> > - we now normally set the read_only flag from bdrv_open2 when we do
> > not have the O_RDWR flag set
> > - but the block drivers also mess with it:
> > o raw-posix superflously sets it when BDRV_O_RDWR is not in the
> > open flags
>
> Not sure where exactly is the issue. Can you please point the line ?
It's really just a now superflous place in the image driver that sets
the read_only flag. Currently it's not clear who is supposed to set
the flag, we do it both from block.c and the image driver.
> > o bochs, cloop, dmg and parallels set it unconditionally given
> > that they do not support writing at all. But they do not
> > bother to reject opens without BDRV_O_RDWR
>
> I just changed bochs and parallels not to ask for read-write.
> Should all of them test the flags for RDWR and returns failure ?
That would be most logical, but might cause regressions for existing
setups that did not bother to specify the read-only option on the
command line. Another options might be to allow the driver to return
EROFS and the retry a read-only open for the block layer for these.
> > o vvfat as usual is a complete mess setting and clearing it in
> > various places
>
> Fixed one occurance. More places ?
I mean the ->read_only flag setting and clearing. As you've pulled
up the main place for setting it to the block layer the drivers
shouldn't mess with it anymore.
> > - in addition to that bdrv_open2 also sets it after calling itself for
> > the backing hd which seems superflous
>
> Is this a problem ? I thought it's safer to mark it read-only, in case a write operation requested somehow.
It's superflous, bdrv_open2 always does it based on the argument, so
no need to do it a second time for the snapshot.
prev parent reply other threads:[~2010-01-21 13:37 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-01-17 14:48 [Qemu-devel] [PATCH v2 0/4] Modifications to the drives' readonly attribute Naphtali Sprei
2010-01-17 14:48 ` [Qemu-devel] [PATCH v2 1/4] Make CDROM a read-only drive Naphtali Sprei
2010-01-17 14:48 ` [Qemu-devel] [PATCH v2 2/4] Clean-up a little bit the RW related bits of BDRV_O_FLAGS. BDRV_O_RDONLY gone (and so is BDRV_O_ACCESS). Default value for bdrv_flags (0/zero) is READ-ONLY. Need to explicitly request READ-WRITE Naphtali Sprei
2010-01-17 14:48 ` [Qemu-devel] [PATCH v2 3/4] Added drives' readonly option Naphtali Sprei
2010-01-17 14:48 ` [Qemu-devel] [PATCH v2 4/4] Disable fall-back to read-only when cannot open drive's file for read-write Naphtali Sprei
2010-01-17 14:59 ` [Qemu-devel] " Michael S. Tsirkin
2010-01-18 11:45 ` Naphtali Sprei
2010-01-17 15:32 ` [Qemu-devel] Re: [PATCH v2 2/4] Clean-up a little bit the RW related bits of BDRV_O_FLAGS. BDRV_O_RDONLY gone (and so is BDRV_O_ACCESS). Default value for bdrv_flags (0/zero) is READ-ONLY. Need to explicitly request READ-WRITE Michael S. Tsirkin
2010-01-18 10:34 ` Markus Armbruster
2010-01-18 10:48 ` Michael S. Tsirkin
2010-01-18 12:47 ` Markus Armbruster
2010-01-20 2:05 ` Jamie Lokier
2010-01-20 7:26 ` Markus Armbruster
2010-01-20 10:32 ` Michael S. Tsirkin
2010-01-20 12:09 ` Markus Armbruster
2010-01-20 12:25 ` Michael S. Tsirkin
2010-01-20 13:05 ` Markus Armbruster
2010-01-20 13:37 ` Jamie Lokier
2010-01-18 11:32 ` Naphtali Sprei
2010-01-20 2:06 ` [Qemu-devel] [PATCH v2 1/4] Make CDROM a read-only drive Jamie Lokier
2010-01-20 14:55 ` Anthony Liguori
2010-01-20 17:05 ` [Qemu-devel] [PATCH v2 0/4] Modifications to the drives' readonly attribute Christoph Hellwig
2010-01-21 13:19 ` Naphtali Sprei
2010-01-21 13:37 ` 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=20100121133730.GA12072@lst.de \
--to=hch@lst.de \
--cc=nsprei@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 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.