All of lore.kernel.org
 help / color / mirror / Atom feed
From: Li Zefan <lizf@cn.fujitsu.com>
To: "Yan, Zheng " <yanzheng@21cn.com>
Cc: Chris Mason <chris.mason@oracle.com>,
	Tsutomu Itoh <t-itoh@jp.fujitsu.com>,
	liubo <liubo2009@cn.fujitsu.com>,
	Linux Btrfs <linux-btrfs@vger.kernel.org>,
	Josef Bacik <josef@redhat.com>
Subject: Re: bug caused by removal of trans_mutex? (Was: Re: kernel BUG at fs/btrfs/extent-tree.c:6164!)
Date: Tue, 14 Jun 2011 13:44:45 +0800	[thread overview]
Message-ID: <4DF6F54D.3050603@cn.fujitsu.com> (raw)
In-Reply-To: <BANLkTik9NcRhK9MS6G8aVxY9xvgXfpR=hA@mail.gmail.com>

Yan, Zheng wrote:
> On Tue, Jun 14, 2011 at 3:55 AM, Chris Mason <chris.mason@oracle.com> wrote:
>> Excerpts from Yan, Zheng's message of 2011-06-13 10:58:35 -0400:
>>> The usage of trans_mutex in relocation code is subtle. It controls
>>> interaction of relocation
>>> with transaction start, transaction commit and snapshot creation.
>>> Simple replacing
>>> trans_mutex with trans_lock is wrong.
>>
>> So, I've got a mutex around the reloc_root here and that was almost but
>> not quite enough.  It looks like the biggest problem is that we need to
>> wait in btrfs_record_root_in_trans for anyone inside merge_reloc_roots.
>>
>> I'm surviving much longer with a patch in place that synchronizes
>> btrfs_record_root_in_trans better.
>>
>> Zheng if you have other comments on the locking please let me know.
>>
> 
> following untested patch may help.

I've tested this patch, and the bug was triggered in minutes as usual.

Also I've tested a patch in an offline email from Chris, which survived
the test.

  reply	other threads:[~2011-06-14  5:44 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-06-06  8:33 kernel BUG at fs/btrfs/extent-tree.c:6164! Tsutomu Itoh
2011-06-07  5:31 ` liubo
2011-06-07  5:59   ` Tsutomu Itoh
2011-06-07  6:17     ` Tsutomu Itoh
2011-06-07  8:24       ` Tsutomu Itoh
2011-06-07  8:36         ` liubo
2011-06-07 15:46           ` Chris Mason
2011-06-08  5:12             ` Tsutomu Itoh
2011-06-13  7:13               ` bug caused by removal of trans_mutex? (Was: Re: kernel BUG at fs/btrfs/extent-tree.c:6164!) Li Zefan
2011-06-13  7:49                 ` Yan, Zheng 
2011-06-13  8:26                   ` Li Zefan
2011-06-13 13:12                 ` Chris Mason
2011-06-13 15:18                   ` Chris Mason
2011-06-13 14:58                 ` Yan, Zheng 
2011-06-13 15:09                   ` Chris Mason
2011-06-13 19:55                   ` Chris Mason
2011-06-14  3:24                     ` Yan, Zheng 
2011-06-14  5:44                       ` Li Zefan [this message]
2011-06-14  6:53                 ` Yan, Zheng 

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=4DF6F54D.3050603@cn.fujitsu.com \
    --to=lizf@cn.fujitsu.com \
    --cc=chris.mason@oracle.com \
    --cc=josef@redhat.com \
    --cc=linux-btrfs@vger.kernel.org \
    --cc=liubo2009@cn.fujitsu.com \
    --cc=t-itoh@jp.fujitsu.com \
    --cc=yanzheng@21cn.com \
    /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.