From: David Sterba <dsterba@suse.cz>
To: "Holger Hoffstätte" <holger.hoffstaette@googlemail.com>
Cc: linux-btrfs@vger.kernel.org
Subject: Re: [PATCH] Btrfs: fix race when reusing stale extent buffers that leads to BUG_ON
Date: Tue, 12 May 2015 15:04:04 +0200 [thread overview]
Message-ID: <20150512130404.GY23255@twin.jikos.cz> (raw)
In-Reply-To: <pan.2015.04.23.12.16.21@googlemail.com>
On Thu, Apr 23, 2015 at 12:16:21PM +0000, Holger Hoffstätte wrote:
> After staring at this (and the Lovecraftian horrors of free_extent_buffer())
> for over an hour and trying to understand how and why this could even remotely
> work, I cannot help but think that this fix would shift the race to the much
> smaller window between the test_bit and the first spin_lock.
Btw, I had exactly the same concerns, as this is close to the classical
example of a shared resource check outside of the critical section. But
the extent buffers are protected by more than just the spinlock and if
the race mentioned above happens, the lifted reference counts will
prevent to drop the last one.
next prev parent reply other threads:[~2015-05-12 13:04 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-04-23 10:28 [PATCH] Btrfs: fix race when reusing stale extent buffers that leads to BUG_ON Filipe Manana
2015-04-23 12:16 ` Holger Hoffstätte
2015-04-23 12:34 ` Filipe Manana
2015-04-23 13:22 ` Holger Hoffstätte
2015-04-23 13:43 ` Filipe Manana
2015-04-23 13:53 ` Holger Hoffstätte
2015-04-24 16:08 ` Filipe Manana
2015-05-12 13:04 ` David Sterba [this message]
2015-05-07 16:19 ` David Sterba
2015-05-07 19:30 ` Chris Mason
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=20150512130404.GY23255@twin.jikos.cz \
--to=dsterba@suse.cz \
--cc=holger.hoffstaette@googlemail.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).