From patchwork Fri Feb 25 12:16:06 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Li Dongyang X-Patchwork-Id: 589921 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id p1PCGSYn031714 for ; Fri, 25 Feb 2011 12:16:28 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755387Ab1BYMQW (ORCPT ); Fri, 25 Feb 2011 07:16:22 -0500 Received: from mail-pz0-f46.google.com ([209.85.210.46]:55477 "EHLO mail-pz0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753158Ab1BYMQW (ORCPT ); Fri, 25 Feb 2011 07:16:22 -0500 Received: by pzk35 with SMTP id 35so242504pzk.19 for ; Fri, 25 Feb 2011 04:16:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:date:from:to:subject:message-id:mime-version :content-type:content-disposition:user-agent; bh=6j7U8LMGfsBNG03ICm4HLdWThYTWr15CgjYDjhqLYC0=; b=Y6WBdOsMQE1+cfz+zHtuwEquQSfeMhvzScAFPeQazedxLj67+b6eJ6P9+6mXZQLak2 pPhnOEvYWKkFAHdq6whuneZ/0XzHYvB0ZK5E4i/EUOtsVDZlmkftMUNFrTmDHaRS3UgC x9B8NodNPlgslpmn8i1mZlDlOfEtPw5XvTyA8= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=date:from:to:subject:message-id:mime-version:content-type :content-disposition:user-agent; b=YDJhfvsyUTbVeR9xeUgrq4twunb8jaT7sf9WRIDEee1eCdRHbn0+vmFOPTSyScXUO0 xXg6trfvvAqXjtcZimvL3gaBBYuz+kh6LM9hOCuQMYWatz+BIm5qEVYJ5nD4wt+yPsSH P0byRKCUTLCQL3RTSSbwpujbYGi1VOj8Si6VU= Received: by 10.142.43.16 with SMTP id q16mr1640153wfq.78.1298636181943; Fri, 25 Feb 2011 04:16:21 -0800 (PST) Received: from Archlinux ([117.79.232.170]) by mx.google.com with ESMTPS id w19sm885971wfd.20.2011.02.25.04.16.16 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 25 Feb 2011 04:16:19 -0800 (PST) Date: Fri, 25 Feb 2011 20:16:06 +0800 From: Li Dongyang To: linux-btrfs@vger.kernel.org Subject: [PATCH] Btrfs: make sure we call recalculate_thresholds() in btrfs_remove_free_space() Message-ID: <20110225121606.GA4248@Archlinux> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-btrfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter1.kernel.org [140.211.167.41]); Fri, 25 Feb 2011 12:16:28 +0000 (UTC) diff --git a/fs/btrfs/free-space-cache.c b/fs/btrfs/free-space-cache.c index a039065..f631817 100644 --- a/fs/btrfs/free-space-cache.c +++ b/fs/btrfs/free-space-cache.c @@ -1515,12 +1515,12 @@ again: } if (info->bytes == bytes) { - unlink_free_space(block_group, info); - if (info->bitmap) { - kfree(info->bitmap); - block_group->total_bitmaps--; + if (info->bitmap) + free_bitmap(block_group, info); + else { + unlink_free_space(block_group, info); + kfree(info); } - kfree(info); goto out_lock; }