All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Holger Hoffstätte" <holger.hoffstaette@googlemail.com>
To: linux-btrfs@vger.kernel.org
Subject: Re: [PATCH] Btrfs: fix race when reusing stale extent buffers that leads to BUG_ON
Date: Thu, 23 Apr 2015 13:53:22 +0000 (UTC)	[thread overview]
Message-ID: <pan.2015.04.23.13.53.22@googlemail.com> (raw)
In-Reply-To: 5538F70C.5040004@suse.com

On Thu, 23 Apr 2015 14:43:40 +0100, Filipe Manana wrote:

> I don't think a lock followed by unlock without nothing in between (be
> it a spinlock, mutex, or any other kind of lock) will be seen by the
> compiler as a nop. Pretty sure I've seen this pattern being done in the

No, I didn't say they would - that would be wrong. I just found it odd,
that's all.

> kernel and in many other places as mechanism to wait for something.

I also completely forgot that spinlocks disable preemption, since
otherwise nothing would really work. That's the real reason why
any of this works. Well, that and the refcount==2 thing.

Cool! Thanks!
Holger


  reply	other threads:[~2015-04-23 13:53 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 [this message]
2015-04-24 16:08           ` Filipe Manana
2015-05-12 13:04   ` David Sterba
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=pan.2015.04.23.13.53.22@googlemail.com \
    --to=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 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.