From patchwork Wed Jan 13 20:13:18 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Josef Bacik X-Patchwork-Id: 72692 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter.kernel.org (8.14.3/8.14.2) with ESMTP id o0DJxP7R022996 for ; Wed, 13 Jan 2010 19:59:25 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754943Ab0AMT67 (ORCPT ); Wed, 13 Jan 2010 14:58:59 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1755413Ab0AMT66 (ORCPT ); Wed, 13 Jan 2010 14:58:58 -0500 Received: from mx1.redhat.com ([209.132.183.28]:61349 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754625Ab0AMT64 (ORCPT ); Wed, 13 Jan 2010 14:58:56 -0500 Received: from int-mx02.intmail.prod.int.phx2.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id o0DJwsRA010067 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Wed, 13 Jan 2010 14:58:54 -0500 Received: from dhcp231-156.rdu.redhat.com (dhcp231-156.rdu.redhat.com [10.11.231.156]) by int-mx02.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id o0DJwrq7028452; Wed, 13 Jan 2010 14:58:54 -0500 Date: Wed, 13 Jan 2010 15:13:18 -0500 From: Josef Bacik To: Tomas Carnecky Cc: linux-btrfs@vger.kernel.org Subject: Re: Bug in btrfs_rename (kernel BUG at fs/btrfs/inode.c:5595!) Message-ID: <20100113201317.GC2774@dhcp231-156.rdu.redhat.com> References: <4B4E1A5D.1070203@gmail.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <4B4E1A5D.1070203@gmail.com> User-Agent: Mutt/1.5.19 (2009-01-05) X-Scanned-By: MIMEDefang 2.67 on 10.5.11.12 Sender: linux-btrfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@vger.kernel.org diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c index 5440bab..68fc2e0 100644 --- a/fs/btrfs/inode.c +++ b/fs/btrfs/inode.c @@ -2096,6 +2096,13 @@ int btrfs_orphan_add(struct btrfs_trans_handle *trans, struct inode *inode) */ ret = btrfs_insert_orphan_item(trans, root, inode->i_ino); + printk(KERN_ERR "Btrfs: orphan add %llu\n", (unsigned long long)inode->i_ino); + dump_stack(); + if (ret) { + printk(KERN_ERR "OH NO, ORPHAN ENTRY ALREADY EXISTS FOR %llu\n", + (unsigned long long)inode->i_ino); + } + return ret; } @@ -5592,7 +5599,7 @@ static int btrfs_rename(struct inode *old_dir, struct dentry *old_dentry, BUG_ON(ret); if (new_inode->i_nlink == 0) { ret = btrfs_orphan_add(trans, new_dentry->d_inode); - BUG_ON(ret); + BUG_ON(ret && ret != -EEXIST); } }