From patchwork Wed Aug 29 04:13:02 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Miao Xie X-Patchwork-Id: 1383541 Return-Path: X-Original-To: patchwork-linux-btrfs@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork1.kernel.org (Postfix) with ESMTP id 14CD23FDF5 for ; Wed, 29 Aug 2012 04:13:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751327Ab2H2EN1 (ORCPT ); Wed, 29 Aug 2012 00:13:27 -0400 Received: from cn.fujitsu.com ([222.73.24.84]:13670 "EHLO song.cn.fujitsu.com" rhost-flags-OK-FAIL-OK-OK) by vger.kernel.org with ESMTP id S1751135Ab2H2EN0 (ORCPT ); Wed, 29 Aug 2012 00:13:26 -0400 X-IronPort-AV: E=Sophos;i="4.80,332,1344182400"; d="scan'208";a="5743600" Received: from unknown (HELO tang.cn.fujitsu.com) ([10.167.250.3]) by song.cn.fujitsu.com with ESMTP; 29 Aug 2012 12:12:16 +0800 Received: from fnstmail02.fnst.cn.fujitsu.com (tang.cn.fujitsu.com [127.0.0.1]) by tang.cn.fujitsu.com (8.14.3/8.13.1) with ESMTP id q7T4DOh2031849; Wed, 29 Aug 2012 12:13:25 +0800 Received: from [10.167.225.199] ([10.167.225.199]) by fnstmail02.fnst.cn.fujitsu.com (Lotus Domino Release 8.5.3) with ESMTP id 2012082912131391-537260 ; Wed, 29 Aug 2012 12:13:13 +0800 Message-ID: <503D96CE.4030903@cn.fujitsu.com> Date: Wed, 29 Aug 2012 12:13:02 +0800 From: Miao Xie Reply-To: miaox@cn.fujitsu.com User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:13.0) Gecko/20120605 Thunderbird/13.0 MIME-Version: 1.0 To: Linux Btrfs CC: Josef Bacik Subject: [PATCH 5/7] Btrfs: fix wrong orphan count of the fs/file tree X-MIMETrack: Itemize by SMTP Server on mailserver/fnst(Release 8.5.3|September 15, 2011) at 2012/08/29 12:13:13, Serialize by Router on mailserver/fnst(Release 8.5.3|September 15, 2011) at 2012/08/29 12:13:14, Serialize complete at 2012/08/29 12:13:14 Sender: linux-btrfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@vger.kernel.org If we add a new orphan item, we should increase the atomic counter, not decrease it. Fix it. Signed-off-by: Miao Xie --- fs/btrfs/inode.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c index 7131fac..cae4c32 100644 --- a/fs/btrfs/inode.c +++ b/fs/btrfs/inode.c @@ -2222,7 +2222,7 @@ int btrfs_orphan_add(struct btrfs_trans_handle *trans, struct inode *inode) insert = 1; #endif insert = 1; - atomic_dec(&root->orphan_inodes); + atomic_inc(&root->orphan_inodes); } if (!test_and_set_bit(BTRFS_INODE_ORPHAN_META_RESERVED,