From patchwork Wed Jan 5 10:07:15 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Miao Xie X-Patchwork-Id: 453071 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 p05A8FE3015975 for ; Wed, 5 Jan 2011 10:08:16 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751675Ab1AEKIN (ORCPT ); Wed, 5 Jan 2011 05:08:13 -0500 Received: from cn.fujitsu.com ([222.73.24.84]:52839 "EHLO song.cn.fujitsu.com" rhost-flags-OK-FAIL-OK-OK) by vger.kernel.org with ESMTP id S1751616Ab1AEKIL (ORCPT ); Wed, 5 Jan 2011 05:08:11 -0500 Received: from tang.cn.fujitsu.com (tang.cn.fujitsu.com [10.167.250.3]) by song.cn.fujitsu.com (Postfix) with ESMTP id 6A233170CBC; Wed, 5 Jan 2011 18:08:10 +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 p05A35AH014091; Wed, 5 Jan 2011 18:03:05 +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 2011010518075170-99496 ; Wed, 5 Jan 2011 18:07:51 +0800 Message-ID: <4D2442D3.6050906@cn.fujitsu.com> Date: Wed, 05 Jan 2011 18:07:15 +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.2.13) Gecko/20101209 Fedora/3.1.7-0.35.b3pre.fc13 Thunderbird/3.1.7 MIME-Version: 1.0 To: Josef Bacik , Chris Mason , Mitch Harder CC: Linux Btrfs Subject: [PATCH V3 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 2011-01-05 18:07:51, Serialize by Router on mailserver/fnst(Release 8.5.1FP4|July 25, 2010) at 2011-01-05 18:07:52, Serialize complete at 2011-01-05 18:07:52 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, 05 Jan 2011 10:08:17 +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();