linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Josef Bacik <jbacik@fb.com>
To: ylet ylet <levin.front@gmail.com>,
	linux-btrfs <linux-btrfs@vger.kernel.org>
Cc: <clm@fb.com>
Subject: Re: Is this a race bug when releasing eb?
Date: Mon, 7 Apr 2014 11:50:28 -0400	[thread overview]
Message-ID: <5342C944.2020000@fb.com> (raw)
In-Reply-To: <CAAcaxmWqrLUwbvmsyE+3zLLP1jSVZXGASRvN-D-BLaJp4WnpLQ@mail.gmail.com>

On 04/07/2014 11:45 AM, ylet ylet wrote:
> Assuming thread 1 (may be VFS want to release the page) wants to
> release a CLEAN page and thus the eb attaching the page.
> and thread 2 wants to access the eb and cow the eb.
>
> Thread 1
>                 Thread 2
>
> btree_releasepage
>
> try_release_extent_buffer
>
> release_extent_buffer
> ->if (atomic_dec_and_test(&eb->refs)) {
> ->spin_unlock(&eb->refs_lock);
>   -------switch to thread 2 here------
>
>                 read_block_for_search
>
>                  btrfs_find_tree_block
>
>       radix_tree_lookup && atomic_inc_not_zero
>

atomic_inc_not_zero would return 0 here because we've dropped the last 
buffer for this, that is how we protect against this problem.  How 
reliably are you able to reproduce this bug?  Cause I'd love to find it 
if you can reproduce reliably.  Thanks,

Josef

  reply	other threads:[~2014-04-07 15:50 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-04-07 15:45 Is this a race bug when releasing eb? ylet ylet
2014-04-07 15:50 ` Josef Bacik [this message]
     [not found]   ` <CAAcaxmWEDa+jS8n4LZKdE_ZXFVAoOgACDseQs0_fViYdfRHShg@mail.gmail.com>
2014-04-07 16:01     ` Fwd: " ylet ylet
2014-04-07 16:03       ` Josef Bacik
2014-04-07 16:12       ` ylet ylet
2014-04-07 16:16         ` Josef Bacik

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=5342C944.2020000@fb.com \
    --to=jbacik@fb.com \
    --cc=clm@fb.com \
    --cc=levin.front@gmail.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).