All of lore.kernel.org
 help / color / mirror / Atom feed
From: David Sterba <dsterba@suse.cz>
To: Josef Bacik <josef@toxicpanda.com>
Cc: linux-btrfs@vger.kernel.org, kernel-team@fb.com
Subject: Re: [PATCH 2/3] btrfs: protect the fs_info->caching_block_groups differently
Date: Wed, 21 Oct 2020 17:51:59 +0200	[thread overview]
Message-ID: <20201021155159.GF6756@twin.jikos.cz> (raw)
In-Reply-To: <64816a7abd985112ddd7c44998753f72b5775a1a.1603137558.git.josef@toxicpanda.com>

On Mon, Oct 19, 2020 at 04:02:30PM -0400, Josef Bacik wrote:
> while testing another lockdep fix.  This happens because we're using the
> commit_root_sem to protect fs_info->caching_block_groups, which creates
> a dependency on the groups_sem -> commit_root_sem, which is problematic
> because we will allocate blocks while holding tree roots.  Fix this by
> making the list itself protected by the fs_info->block_group_cache_lock.

That's lacking explanation why this is supposed to be correct. Replacing
semaphore by a spin lock has implications and given that he commit root
sem does not protect a single structure or is sometimes used for context
exclusion, this requires more in the changelog and updated perhaps
comments for the locks.

  parent reply	other threads:[~2020-10-21 15:53 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-19 20:02 [PATCH 0/3] Lockdep fixes for misc-next Josef Bacik
2020-10-19 20:02 ` [PATCH 1/3] btrfs: drop the path before adding qgroup items when enabling qgroups Josef Bacik
2020-10-20  9:31   ` Filipe Manana
2020-10-21 15:19   ` David Sterba
2020-10-19 20:02 ` [PATCH 2/3] btrfs: protect the fs_info->caching_block_groups differently Josef Bacik
2020-10-20 10:10   ` Filipe Manana
2020-10-21 14:05     ` Josef Bacik
2020-10-21 16:36       ` Filipe Manana
2020-10-21 18:44         ` Josef Bacik
2020-10-21 15:51   ` David Sterba [this message]
2020-10-19 20:02 ` [PATCH 3/3] btrfs: add a helper to read the tree_root commit root for backref lookup Josef Bacik
2020-10-20 11:06   ` Filipe Manana
2020-10-21 16:13 ` [PATCH 0/3] Lockdep fixes for misc-next 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=20201021155159.GF6756@twin.jikos.cz \
    --to=dsterba@suse.cz \
    --cc=josef@toxicpanda.com \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.