From: Anand Jain <anand.jain@oracle.com>
To: Nikolay Borisov <nborisov@suse.com>, dsterba@suse.com
Cc: l@damenly.su, linux-btrfs@vger.kernel.org
Subject: Re: [PATCH RFC V5 2/2] btrfs: consolidate device_list_mutex in prepare_sprout to its parent
Date: Fri, 3 Sep 2021 11:08:19 +0800 [thread overview]
Message-ID: <4f4e36cc-d377-abde-2df3-759f85867482@oracle.com> (raw)
In-Reply-To: <ca0f8867-74ff-9130-f69f-0f7972540be0@suse.com>
On 31/08/2021 21:03, Nikolay Borisov wrote:
>
>
> On 31.08.21 г. 4:21, Anand Jain wrote:
>> btrfs_prepare_sprout() moves seed devices into its own struct fs_devices,
>> so that its parent function btrfs_init_new_device() can add the new sprout
>> device to fs_info->fs_devices.
>>
>> Both btrfs_prepare_sprout() and btrfs_init_new_device() needs
>> device_list_mutex. But they are holding it sequentially, thus creates a
>> small window to an opportunity to race. Close this opportunity and hold
>> device_list_mutex common to both btrfs_init_new_device() and
>> btrfs_prepare_sprout().
>>
>> Signed-off-by: Anand Jain <anand.jain@oracle.com>
>
> That's a moot point, what's important is that btrfs_prepare_sprout
> leaves the fs_devices in a consistent state and btrfs_init_new_device
> also takes the lock when it's about to modify the devices list, so
> that's fine as well. While the patch itself won't do any harm I think
> it's irrelevant.
This patch is for the cleanup of the device_list_mutex.
Thanks, Anand
next prev parent reply other threads:[~2021-09-03 3:08 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-08-31 1:21 [PATCH V5 0/2] btrfs: device_list_mutex fix lockdep warn and cleanup Anand Jain
2021-08-31 1:21 ` [PATCH V5 1/2] btrfs: fix lockdep warning while mounting sprout fs Anand Jain
2021-08-31 8:18 ` Nikolay Borisov
2021-09-02 23:51 ` Anand Jain
2021-08-31 12:37 ` Nikolay Borisov
2021-09-01 0:49 ` Su Yue
2021-09-02 15:28 ` David Sterba
2021-08-31 1:21 ` [PATCH RFC V5 2/2] btrfs: consolidate device_list_mutex in prepare_sprout to its parent Anand Jain
2021-08-31 13:03 ` Nikolay Borisov
2021-09-03 3:08 ` Anand Jain [this message]
2021-09-17 15:37 ` David Sterba
2021-09-18 0:10 ` 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=4f4e36cc-d377-abde-2df3-759f85867482@oracle.com \
--to=anand.jain@oracle.com \
--cc=dsterba@suse.com \
--cc=l@damenly.su \
--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).