linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Josef Bacik <josef@toxicpanda.com>
To: dsterba@suse.cz, linux-btrfs@vger.kernel.org, kernel-team@fb.com
Subject: Re: [PATCH 4/4] btrfs: do not create raid sysfs entries under any locks
Date: Tue, 8 Sep 2020 08:52:19 -0400	[thread overview]
Message-ID: <ed683b7e-bd67-1f27-58ac-a979d8c97f90@toxicpanda.com> (raw)
In-Reply-To: <20200908124003.GE28318@twin.jikos.cz>

On 9/8/20 8:40 AM, David Sterba wrote:
> On Tue, Sep 01, 2020 at 05:40:38PM -0400, Josef Bacik wrote:
>>   	}
>>   
>>   	list_for_each_entry(space_info, &info->space_info, list) {
>> +		int i;
>> +
>> +		for (i = 0; i < BTRFS_NR_RAID_TYPES; i++) {
>> +			if (list_empty(&space_info->block_groups[i]))
>> +				continue;
>> +			cache = list_first_entry(&space_info->block_groups[i],
>> +						 struct btrfs_block_group,
>> +						 list);
>> +			btrfs_sysfs_add_block_group_type(cache);
>> +		}
>> +
> 
> I had the previous version of the patch pass fstests, with no lockdep
> warnings and then realized it's not the v2 that depends on the 3rd patch
> removing RCU from this list traversal.
> 
> btrfs_sysfs_add_block_group_type does not seem to be conflicting RCU in
> this loop so now I'm undecided if v1 is ok or if we really need v2, sice
> the patch 3 removing RCU seems suspicious.
> 

It conflicts with RCU here because we could sleep, that's why I had to remove it.

Alternatively we could just loop a second time through the space_info's outside 
of the RCU to do the btrfs_sysfs_add_block_group_type(), and I can drop the RCU 
removal patch altogether.  It's up to you, but we still need v2 because the 
problem still exists without it.  Thanks,

Josef

  reply	other threads:[~2020-09-08 17:35 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-01 21:40 [PATCH 0/4][v2] Lockdep fixes Josef Bacik
2020-09-01 21:40 ` [PATCH 1/4] btrfs: fix lockdep splat in add_missing_dev Josef Bacik
2020-09-02  6:23   ` Anand Jain
2020-09-03 11:17   ` David Sterba
2020-09-01 21:40 ` [PATCH 2/4] btrfs: init sysfs for devices outside of the chunk_mutex Josef Bacik
2020-09-02  6:21   ` Anand Jain
2020-09-02 17:45     ` David Sterba
2020-09-03 11:41       ` Anand Jain
2020-09-03 11:42       ` Anand Jain
2020-09-03 11:18   ` David Sterba
2020-09-01 21:40 ` [PATCH 3/4] btrfs: kill the rcu protection for fs_info->space_info Josef Bacik
2020-09-02  8:04   ` Nikolay Borisov
2020-09-02 10:32   ` David Sterba
2020-09-01 21:40 ` [PATCH 4/4] btrfs: do not create raid sysfs entries under any locks Josef Bacik
2020-09-08 12:40   ` David Sterba
2020-09-08 12:52     ` Josef Bacik [this message]
2020-09-04 14:20 ` [PATCH 0/4][v2] Lockdep fixes David Sterba
2020-09-07 13:05   ` 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=ed683b7e-bd67-1f27-58ac-a979d8c97f90@toxicpanda.com \
    --to=josef@toxicpanda.com \
    --cc=dsterba@suse.cz \
    --cc=kernel-team@fb.com \
    --cc=linux-btrfs@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;
as well as URLs for NNTP newsgroup(s).