From patchwork Mon Nov 19 15:27:53 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Liu Bo X-Patchwork-Id: 1765411 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 191CB3FCDE for ; Mon, 19 Nov 2012 15:28:16 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753173Ab2KSP2N (ORCPT ); Mon, 19 Nov 2012 10:28:13 -0500 Received: from userp1040.oracle.com ([156.151.31.81]:23250 "EHLO userp1040.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753119Ab2KSP2M (ORCPT ); Mon, 19 Nov 2012 10:28:12 -0500 Received: from ucsinet21.oracle.com (ucsinet21.oracle.com [156.151.31.93]) by userp1040.oracle.com (Sentrion-MTA-4.2.2/Sentrion-MTA-4.2.2) with ESMTP id qAJFS8IN028149 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Mon, 19 Nov 2012 15:28:09 GMT Received: from acsmt357.oracle.com (acsmt357.oracle.com [141.146.40.157]) by ucsinet21.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id qAJFS8fO002011 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Mon, 19 Nov 2012 15:28:08 GMT Received: from abhmt107.oracle.com (abhmt107.oracle.com [141.146.116.59]) by acsmt357.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id qAJFS7rd001664; Mon, 19 Nov 2012 09:28:07 -0600 Received: from gmail.com (/202.100.57.12) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Mon, 19 Nov 2012 07:28:07 -0800 Date: Mon, 19 Nov 2012 23:27:53 +0800 From: Liu Bo To: Gustavo Padovan Cc: chris.mason@fusionio.com, linux-btrfs@vger.kernel.org Subject: Re: btrfs crash - Null dereference - 3.7.0-rc5-00068-gc5e35d6 Message-ID: <20121119152751.GB8810@gmail.com> Reply-To: bo.li.liu@oracle.com References: <20121119025540.GA3858@joana> <20121119103221.GA8810@gmail.com> <20121119130752.GA3457@joana> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20121119130752.GA3457@joana> User-Agent: Mutt/1.5.21 (2010-09-15) X-Source-IP: ucsinet21.oracle.com [156.151.31.93] Sender: linux-btrfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@vger.kernel.org On Mon, Nov 19, 2012 at 11:07:52AM -0200, Gustavo Padovan wrote: > > can you please run > > 'gdb fs/btrfs/btrfs.ko' and 'list *block_rsv_release_bytes+0x21' to > > check which one is NULL pointer? > > > (gdb) list *block_rsv_release_bytes+0x21 > 0xffffffff811a83c1 is in block_rsv_release_bytes > (fs/btrfs/extent-tree.c:4065). > 4060 > 4061 static void block_rsv_release_bytes(struct btrfs_fs_info *fs_info, > 4062 struct btrfs_block_rsv *block_rsv, > 4063 struct btrfs_block_rsv *dest, u64 > num_bytes) > 4064 { > 4065 struct btrfs_space_info *space_info = block_rsv->space_info; > 4066 > 4067 spin_lock(&block_rsv->lock); > 4068 if (num_bytes == (u64)-1) > 4069 num_bytes = block_rsv->size; > (gdb) > > Seems block_rsv is NULL here and looking to btrfs_block_rsv_release() it can > only be NULL at this point if global_rsv->full is true otherwise the crash > would happen there. I didn't go any further than this. > > Gustavo Can you check if the following commit is in your tree? commit 321f0e70225abc792d74902a2bc4a60164265fd4 Author: Miao Xie Btrfs: fix wrong orphan count of the fs/file tree thanks, liubo --- To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c index 878116d..a6824bd 100644 --- a/fs/btrfs/inode.c +++ b/fs/btrfs/inode.c @@ -2228,7 +2228,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,