From: David Sterba <dsterba@suse.cz>
To: Qu Wenruo <quwenruo.btrfs@gmx.com>
Cc: Anand Jain <anand.jain@oracle.com>, Qu Wenruo <wqu@suse.com>,
dsterba@suse.cz,
"linux-btrfs@vger.kernel.org" <linux-btrfs@vger.kernel.org>,
Omar Sandoval <osandov@osandov.com>
Subject: Re: Seed device is broken, again.
Date: Mon, 28 Feb 2022 19:40:50 +0100 [thread overview]
Message-ID: <20220228184050.GJ12643@twin.jikos.cz> (raw)
In-Reply-To: <4661c891-b15e-3a8f-6b98-f298e104262e@gmx.com>
On Mon, Feb 28, 2022 at 11:27:16AM +0800, Qu Wenruo wrote:
> > Ah. That's fine, IMO. It is a matter of understanding the nature of the
> > seed device. No?
> > The RO mount used to turn into an RW mount after the device-add a long
> > ago. It got changed without a trace.
>
> Think twice about this, have you every seen another fs allowing a RO
> mount to be converted to RW without even remounting?
There's no other filesystem with a remotely close feature so we can't
follow an established pattern.
The ro->rw transition can be done from inside the filesystem too and
btrfs sort of does that in btrfs_mount, calling kern_mount.
> Still think this doesn't provide any surprise to end users?
The RO status means the filesystem does not support any write operations
from the user perspective that go through VFS. Adding the device in the
seed mode modifies the filesystem structures, ie. changes the block
device, but does not change the VFS status regarding writability. The
read-write remount is mandatory to actually make use of the writable
device. This is documented and I don't find it confusing from the end
user perspective.
If you're concerned that there's a write to the block device then yes,
it's a bug that the mnt_set_write should be done just before we start
any change operation.
There was a discussion some time ago if the log replay should happen on
a read-only mount, or any potential repair action that could happen
regardless of the ro/rw mount status. The conclusion was that it could
happen, and guaranteeing no writes to the block device should be done
externally eg. by blockdev --setro. But I think we opted not to do any
writes anyway for btrfs.
next prev parent reply other threads:[~2022-02-28 18:45 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-02-25 10:08 Seed device is broken, again Qu Wenruo
2022-02-25 11:39 ` Filipe Manana
2022-02-25 11:47 ` David Sterba
2022-02-25 13:36 ` Qu Wenruo
2022-02-25 19:18 ` Omar Sandoval
2022-02-27 23:56 ` Qu Wenruo
2022-02-28 2:01 ` Anand Jain
2022-02-28 2:35 ` Qu Wenruo
2022-02-28 3:24 ` Anand Jain
2022-02-28 3:27 ` Qu Wenruo
2022-02-28 18:40 ` David Sterba [this message]
2022-03-01 0:13 ` Qu Wenruo
2022-03-01 1:49 ` Chris Murphy
2022-03-01 17:09 ` David Sterba
2022-03-02 0:00 ` Qu Wenruo
2022-03-01 1:44 ` Chris Murphy
2022-03-02 10:09 ` Neal Gompa
2022-02-25 12:00 ` Nikolay Borisov
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=20220228184050.GJ12643@twin.jikos.cz \
--to=dsterba@suse.cz \
--cc=anand.jain@oracle.com \
--cc=linux-btrfs@vger.kernel.org \
--cc=osandov@osandov.com \
--cc=quwenruo.btrfs@gmx.com \
--cc=wqu@suse.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox