From: Qu Wenruo <quwenruo.btrfs@gmx.com>
To: dsterba@suse.cz, Anand Jain <anand.jain@oracle.com>,
Qu Wenruo <wqu@suse.com>,
"linux-btrfs@vger.kernel.org" <linux-btrfs@vger.kernel.org>,
Omar Sandoval <osandov@osandov.com>
Subject: Re: Seed device is broken, again.
Date: Tue, 1 Mar 2022 08:13:28 +0800 [thread overview]
Message-ID: <7feddd5a-856c-a525-a05c-fd682574aa49@gmx.com> (raw)
In-Reply-To: <20220228184050.GJ12643@twin.jikos.cz>
On 2022/3/1 02:40, David Sterba wrote:
> 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.
I'm not concerned with that at all.
>
> 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.
My main concern is still there, we change RO to RW without any remount.
It's weird from the beginning, but we just accept that.
If we have chance to rethink this, would we still take the same path?
Other than making seed device into user space tool like mkfs?
THanks,
Qu
next prev parent reply other threads:[~2022-03-01 0:13 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
2022-03-01 0:13 ` Qu Wenruo [this message]
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=7feddd5a-856c-a525-a05c-fd682574aa49@gmx.com \
--to=quwenruo.btrfs@gmx.com \
--cc=anand.jain@oracle.com \
--cc=dsterba@suse.cz \
--cc=linux-btrfs@vger.kernel.org \
--cc=osandov@osandov.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