From: David Sterba <dsterba@suse.cz>
To: Boris Burkov <boris@bur.io>
Cc: David Sterba <dsterba@suse.com>,
linux-btrfs@vger.kernel.org, stable@vger.kernel.org
Subject: Re: [PATCH] btrfs: always scan a single device when mounted
Date: Wed, 7 Feb 2024 10:28:37 +0100 [thread overview]
Message-ID: <20240207092837.GT355@twin.jikos.cz> (raw)
In-Reply-To: <ZcLM+2mtKFaVUFsF@devvm12410.ftw0.facebook.com>
On Tue, Feb 06, 2024 at 04:21:15PM -0800, Boris Burkov wrote:
> On Mon, Feb 05, 2024 at 06:43:39PM +0100, David Sterba wrote:
> > --- a/fs/btrfs/volumes.c
> > +++ b/fs/btrfs/volumes.c
> > @@ -738,6 +738,7 @@ static noinline struct btrfs_device *device_list_add(const char *path,
> > bool same_fsid_diff_dev = false;
> > bool has_metadata_uuid = (btrfs_super_incompat_flags(disk_super) &
> > BTRFS_FEATURE_INCOMPAT_METADATA_UUID);
> > + bool can_create_new = *new_device_added;
>
> It took me quite a while to figure out all the intended logic with the
> now in/out parameter. I think it's probably too cute? Why not just add
> another parameter "can_create_new_device"? I think it feels kind of
> weird on the caller side too, to set "new_device_added" to true, but
> then still rely on it to actually get set to true.
>
> Once I got past this, the logic made sense, so definitely don't block
> yourself on this nit.
I had the separate parameter for the debugging version and removed for
the final but I agree that it makes things less clear. Also there's
something wrong with the device matching so the meaning of the parameter
will be unchanged.
next prev parent reply other threads:[~2024-02-07 9:29 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-02-05 17:43 [PATCH] btrfs: always scan a single device when mounted David Sterba
2024-02-07 0:21 ` Boris Burkov
2024-02-07 9:28 ` David Sterba [this message]
2024-02-07 5:14 ` Anand Jain
2024-02-07 9:24 ` David Sterba
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=20240207092837.GT355@twin.jikos.cz \
--to=dsterba@suse.cz \
--cc=boris@bur.io \
--cc=dsterba@suse.com \
--cc=linux-btrfs@vger.kernel.org \
--cc=stable@vger.kernel.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