linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: David Sterba <dsterba@suse.cz>
To: fdmanana@kernel.org
Cc: linux-btrfs@vger.kernel.org
Subject: Re: [PATCH] Btrfs: fix deadlock when using free space tree due to block group creation
Date: Tue, 8 Jan 2019 17:14:09 +0100	[thread overview]
Message-ID: <20190108161409.GL23615@twin.jikos.cz> (raw)
In-Reply-To: <20190108114441.5573-1-fdmanana@kernel.org>

On Tue, Jan 08, 2019 at 11:44:41AM +0000, fdmanana@kernel.org wrote:
> From: Filipe Manana <fdmanana@suse.com>
> 
> When modifying the free space tree we can end up COWing one of its extent
> buffers which in turn might result in allocating a new chunk, which in
> turn can result in flushing (finish creation) of pending block groups. If
> that happens we can deadlock because creating a pending block group needs
> to update the free space tree, and if any of the updates tries to modify
> the same extent buffer that we are COWing, we end up in a deadlock since
> we try to write lock twice the same extent buffer.
> 
> So fix this by skipping pending block group creation if we are COWing an
> extent buffer from the free space tree. This is a case missed by commit
> 5ce555578e091 ("Btrfs: fix deadlock when writing out free space caches").
> 
> Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=202173
> Fixes: 5ce555578e091 ("Btrfs: fix deadlock when writing out free space caches
> Signed-off-by: Filipe Manana <fdmanana@suse.com>

Lighweight Reviewed-by, as the bug is in 4.19.x I'm going to push the
fix to 5.0. Thanks.

  reply	other threads:[~2019-01-08 16:14 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-01-08 11:44 [PATCH] Btrfs: fix deadlock when using free space tree due to block group creation fdmanana
2019-01-08 16:14 ` David Sterba [this message]
2019-01-08 16:17   ` Filipe Manana

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=20190108161409.GL23615@twin.jikos.cz \
    --to=dsterba@suse.cz \
    --cc=fdmanana@kernel.org \
    --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).