[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <4C731771.1060904@cn.fujitsu.com>
Date: Tue, 24 Aug 2010 08:50:57 +0800
From: Li Zefan <lizf@...fujitsu.com>
To: Josef Bacik <josef@...hat.com>
CC: Chris Mason <chris.mason@...cle.com>, linux-btrfs@...r.kernel.org,
LKML <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH 4/6] btrfs: update stats when allocating from a cluster
>> 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.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists