From: NeilBrown <neilb@suse.de>
To: Tejun Heo <tj@kernel.org>
Cc: Milan Broz <mbroz@redhat.com>, Tao Ma <tm@tao.ma>,
linux-kernel@vger.kernel.org, Jens Axboe <axboe@kernel.dk>,
device-mapper development <dm-devel@redhat.com>
Subject: Re: [PATCH][RFC] dm: Do not open log and cow device read-write for read-only mappings
Date: Tue, 15 Feb 2011 10:15:06 +1100 [thread overview]
Message-ID: <20110215101506.43d41ca8@notabene.brown> (raw)
In-Reply-To: <20110214154430.GR18742@htj.dyndns.org>
On Mon, 14 Feb 2011 16:44:30 +0100 Tejun Heo <tj@kernel.org> wrote:
> Hello,
>
> On Mon, Feb 14, 2011 at 03:23:20PM +0100, Milan Broz wrote:
> > >> I am not sure if this is complete fix... note that:
> > >> - what happens during mirror resync and read-only log?
> > >> - for COW, it there situation we need to update header in read-oly mode? (invalidated snap?)
> > >
> > > But if the underlying device is marked ro, dm shouldn't update it at
> > > all. The device should be opened ro and ro policy should be enforced.
> >
> > Sure. So we need to check these situations I described.
>
> Yeap, it seems dm folks are gonna take care of dm part.
>
> > Btw the same pattern is in MD code in lock_rdev() ...
>
> Indeed, cc'ing Neil. Hi, the whole thread can be read from the
> following URL.
>
> http://thread.gmane.org/gmane.linux.kernel/1099399/focus=1099735
>
> blkdev_get() now rejects rw open of devices which are marked
> read-only. I think the right thing to do would be opening the member
> devices ro if the array is assembled for ro access (similar to Milan's
> patch for dm). How does that sound?
>
> Thanks.
>
Sounds sensible ... though it is not all that easy to assemble an
array as 'read-only'.... it is possible though.
When the array is switched to read-write, do I have to call blkdev_get again
asking for rw access, then close the old blkdev, or can I 'upgrade'?
If a device has multiple opens: some read-only and some read-write, can I
find out when the last read-write close is gone? That would be really useful,
especially if a filesystem down-graded its open to read-only when it is
remounted read-only..
[[And if filesystems could be convinced to open the device read-only when the
fs is mounted read-only (and just do journal replay to internal data
structures) that would be really awesome!!]]
NeilBrown
next prev parent reply other threads:[~2011-02-14 23:15 UTC|newest]
Thread overview: 30+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-02-13 2:02 block device read-only handling regression in 2.6.38-rc4 (bisected) Milan Broz
2011-02-13 10:58 ` [PATCH] loop: clear read-only flag in loop_clr_fd Tao Ma
2011-02-13 14:11 ` Milan Broz
2011-02-13 15:05 ` Tao Ma
2011-02-13 16:44 ` Milan Broz
2011-02-14 10:30 ` Tejun Heo
2011-02-14 11:47 ` Milan Broz
2011-02-14 13:14 ` [PATCH][RFC] dm: Do not open log and cow device read-write for read-only mappings Milan Broz
2011-02-14 14:09 ` Tejun Heo
2011-02-14 14:23 ` Milan Broz
2011-02-14 15:44 ` Tejun Heo
2011-02-14 23:15 ` NeilBrown [this message]
2011-02-15 2:03 ` [dm-devel] " Alasdair G Kergon
2011-02-15 12:17 ` Milan Broz
2011-02-15 12:46 ` Alasdair G Kergon
2011-02-15 15:20 ` Tejun Heo
2011-02-15 15:46 ` Alasdair G Kergon
2011-02-15 15:50 ` Tejun Heo
2011-02-15 16:05 ` Milan Broz
2011-02-15 16:12 ` Tejun Heo
2011-02-15 16:36 ` Milan Broz
2011-02-15 16:41 ` Tejun Heo
2011-02-15 16:56 ` Alasdair G Kergon
2011-02-16 8:46 ` Tejun Heo
2011-02-16 8:46 ` Tejun Heo
2011-02-15 16:58 ` Milan Broz
2011-02-16 8:39 ` Tejun Heo
2011-02-15 15:16 ` [PATCH] Return EROFS if read-only detected on block device Milan Broz
2011-02-14 14:39 ` [dm-devel] [PATCH][RFC] dm: Do not open log and cow device read-write for read-only mappings Alasdair G Kergon
2011-02-14 14:07 ` [PATCH] loop: clear read-only flag in loop_clr_fd Tejun Heo
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=20110215101506.43d41ca8@notabene.brown \
--to=neilb@suse.de \
--cc=axboe@kernel.dk \
--cc=dm-devel@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mbroz@redhat.com \
--cc=tj@kernel.org \
--cc=tm@tao.ma \
/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.