From patchwork Wed Dec 22 10:47:17 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Miao Xie X-Patchwork-Id: 426591 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 oBMAjsPf004456 for ; Wed, 22 Dec 2010 10:45:54 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751985Ab0LVKpV (ORCPT ); Wed, 22 Dec 2010 05:45:21 -0500 Received: from cn.fujitsu.com ([222.73.24.84]:61466 "EHLO song.cn.fujitsu.com" rhost-flags-OK-FAIL-OK-OK) by vger.kernel.org with ESMTP id S1751980Ab0LVKpU (ORCPT ); Wed, 22 Dec 2010 05:45:20 -0500 Received: from tang.cn.fujitsu.com (tang.cn.fujitsu.com [10.167.250.3]) by song.cn.fujitsu.com (Postfix) with ESMTP id A4786170B42; Wed, 22 Dec 2010 18:45:18 +0800 (CST) Received: from mailserver.fnst.cn.fujitus.com (tang.cn.fujitsu.com [127.0.0.1]) by tang.cn.fujitsu.com (8.14.3/8.13.1) with ESMTP id oBMAeOb2006174; Wed, 22 Dec 2010 18:40:24 +0800 Received: from [10.167.225.64] ([10.167.225.64]) by mailserver.fnst.cn.fujitus.com (Lotus Domino Release 8.5.1FP4) with ESMTP id 2010122218451158-28689 ; Wed, 22 Dec 2010 18:45:11 +0800 Message-ID: <4D11D735.9060206@cn.fujitsu.com> Date: Wed, 22 Dec 2010 18:47:17 +0800 From: Miao Xie Reply-To: miaox@cn.fujitsu.com User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.9) Gecko/20100413 Fedora/3.0.4-2.fc13 Thunderbird/3.0.4 MIME-Version: 1.0 To: Chris Mason , Josef Bacik CC: Linux Btrfs Subject: [PATCH 1/6] btrfs: fix wrong data space statistics X-MIMETrack: Itemize by SMTP Server on mailserver/fnst(Release 8.5.1FP4|July 25, 2010) at 2010-12-22 18:45:11, Serialize by Router on mailserver/fnst(Release 8.5.1FP4|July 25, 2010) at 2010-12-22 18:45:11, Serialize complete at 2010-12-22 18:45:11 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.3 (demeter1.kernel.org [140.211.167.41]); Wed, 22 Dec 2010 10:45:54 +0000 (UTC) diff --git a/fs/btrfs/super.c b/fs/btrfs/super.c index 61bd79a..1d21208 100644 --- a/fs/btrfs/super.c +++ b/fs/btrfs/super.c @@ -768,11 +768,10 @@ static int btrfs_statfs(struct dentry *dentry, struct kstatfs *buf) rcu_read_lock(); list_for_each_entry_rcu(found, head, list) { - if (found->flags & (BTRFS_BLOCK_GROUP_METADATA | - BTRFS_BLOCK_GROUP_SYSTEM)) - total_used_data += found->disk_total; - else + if (found->flags & BTRFS_BLOCK_GROUP_DATA) total_used_data += found->disk_used; + else + total_used_data += found->disk_total; total_used += found->disk_used; } rcu_read_unlock();