linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Josef Bacik <josef@redhat.com>
To: Li Zefan <lizf@cn.fujitsu.com>
Cc: Josef Bacik <josef@redhat.com>,
	Chris Mason <chris.mason@oracle.com>,
	linux-btrfs@vger.kernel.org, LKML <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 4/6] btrfs: update stats when allocating from a cluster
Date: Mon, 23 Aug 2010 22:50:24 -0400	[thread overview]
Message-ID: <20100824025023.GA2638@dhcp231-156.rdu.redhat.com> (raw)
In-Reply-To: <4C731771.1060904@cn.fujitsu.com>

On Tue, Aug 24, 2010 at 08:50:57AM +0800, Li Zefan wrote:
> >>  	spin_unlock(&cluster->lock);
> >>  
> >> +	if (!ret)
> >> +		return 0;
> >> +
> >> +	spin_lock(&block_group->tree_lock);
> >> +
> >> +	block_group->free_space -= bytes;
> >> +	if (entry->bytes == 0) {
> >> +		block_group->free_extents--;
> >> +		kfree(entry);
> >> +	}
> >> +
> >> +	spin_unlock(&block_group->tree_lock);
> >> +
> > 
> > Move this part up so we don't drop the spinlock and then re-grab it.  Thanks,
> > 
> 
> But they are 2 different locks. ;)
> 
> And we can't grab block_group->tree_lock when holding cluster->lock.

Ugh Jesus sorry, ignore me.

Reviewed-by: Josef Bacik <josef@redhat.com>

Thanks,

Josef

  reply	other threads:[~2010-08-24  2:50 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-08-23  1:22 [PATCH 0/6] btrfs: some bug fixes for free space cache Li Zefan
2010-08-23  1:22 ` [PATCH 1/6] btrfs: fix threshold calculation for block groups smaller than 1GB Li Zefan
2010-08-23 13:02   ` Josef Bacik
2010-08-23  1:23 ` [PATCH 2/6] btrfs: add helper function free_bitmap() Li Zefan
2010-08-23 13:03   ` Josef Bacik
2010-08-23  1:23 ` [PATCH 3/6] btrfs: free fully occupied bitmap in cluster Li Zefan
2010-08-23 13:04   ` Josef Bacik
2010-08-23  1:23 ` [PATCH 4/6] btrfs: update stats when allocating from a cluster Li Zefan
2010-08-23 13:09   ` Josef Bacik
2010-08-24  0:50     ` Li Zefan
2010-08-24  2:50       ` Josef Bacik [this message]
2010-08-23  1:23 ` [PATCH 5/6] btrfs: add a helper try_merge_free_space() Li Zefan
2010-08-23 13:15   ` Josef Bacik
2010-08-23  1:24 ` [PATCH 6/6] btrfs: check mergeable free space when removing a cluster Li Zefan
2010-08-23 13:15   ` Josef Bacik
2010-08-24  1:04     ` Li Zefan
2010-08-24  2:58       ` 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=20100824025023.GA2638@dhcp231-156.rdu.redhat.com \
    --to=josef@redhat.com \
    --cc=chris.mason@oracle.com \
    --cc=linux-btrfs@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lizf@cn.fujitsu.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 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).