From: Anand Jain <anand.jain@oracle.com>
To: Nikolay Borisov <nborisov@suse.com>
Cc: linux-btrfs@vger.kernel.org, dsterba@suse.com
Subject: Re: [PATCH v6 2/3] btrfs: remove unused device_list_mutex for seed fs_devices
Date: Wed, 22 Sep 2021 19:29:23 +0800 [thread overview]
Message-ID: <55a8c670-3865-e45a-593c-d9b318ba505c@oracle.com> (raw)
In-Reply-To: <1c79bfe9-20b9-6ec8-285d-0e653215a94a@suse.com>
On 21/09/2021 14:44, Nikolay Borisov wrote:
>
>
> On 21.09.21 г. 7:33, Anand Jain wrote:
>> The btrfs_fs_devices::seed_list is of type btrfs_fs_devices as well and,
>
> seed_list is in fact a list_head which points to btrfs_fs_devices, so
> that sentence is somewhat misleading.
>
>> it is a pointer to the seed btrfs_fs_device in a btrfs created from a
>> seed devices.
>> In this struct, when it points to seed, the device_list_mutex is not
>> used. So drop its initialize.
>
> Even if the device_list_mutex is not used in the seed_devices it will
> have whatever is the state from the original fs_devices so
> re-initializing it to a sane state is the right thing to do.
>
> We don't need this.
I agree. Maybe at some point, we should have a separate new struct for
the seed's fs_devices, as few members in it aren't in use.
We can drop this patch.
Thanks, Anand
>
>>
>> Signed-off-by: Anand Jain <anand.jain@oracle.com>
>> ---
>> v6: new
>> fs/btrfs/volumes.c | 1 -
>> 1 file changed, 1 deletion(-)
>>
>> diff --git a/fs/btrfs/volumes.c b/fs/btrfs/volumes.c
>> index c4bc49e58b69..e4079e25db70 100644
>> --- a/fs/btrfs/volumes.c
>> +++ b/fs/btrfs/volumes.c
>> @@ -2418,7 +2418,6 @@ static int btrfs_prepare_sprout(struct btrfs_fs_info *fs_info)
>> seed_devices->opened = 1;
>> INIT_LIST_HEAD(&seed_devices->devices);
>> INIT_LIST_HEAD(&seed_devices->alloc_list);
>> - mutex_init(&seed_devices->device_list_mutex);
>>
>> mutex_lock(&fs_devices->device_list_mutex);
>> list_splice_init_rcu(&fs_devices->devices, &seed_devices->devices,
>>
next prev parent reply other threads:[~2021-09-22 12:29 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-09-21 4:33 [PATCH v6 0/3] btrfs: cleanup prepare_sprout Anand Jain
2021-09-21 4:33 ` [PATCH v6 1/3] btrfs: declare seeding_dev in init_new_device as bool Anand Jain
2021-09-21 11:01 ` Nikolay Borisov
2021-10-13 8:00 ` Anand Jain
2021-10-28 4:39 ` Anand Jain
2021-11-08 20:06 ` David Sterba
2021-09-21 4:33 ` [PATCH v6 2/3] btrfs: remove unused device_list_mutex for seed fs_devices Anand Jain
2021-09-21 6:44 ` Nikolay Borisov
2021-09-22 11:29 ` Anand Jain [this message]
2021-09-21 4:33 ` [PATCH v6 3/3] btrfs: consolidate device_list_mutex in prepare_sprout to its parent Anand Jain
2021-09-21 11:01 ` Nikolay Borisov
2021-09-22 11:41 ` Anand Jain
2021-09-23 6:52 ` Nikolay Borisov
2021-09-23 11:55 ` Anand Jain
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=55a8c670-3865-e45a-593c-d9b318ba505c@oracle.com \
--to=anand.jain@oracle.com \
--cc=dsterba@suse.com \
--cc=linux-btrfs@vger.kernel.org \
--cc=nborisov@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;
as well as URLs for NNTP newsgroup(s).