From patchwork Wed Aug 12 16:18:45 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Josef Bacik X-Patchwork-Id: 7003001 Return-Path: X-Original-To: patchwork-linux-btrfs@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 8D00EC05AC for ; Wed, 12 Aug 2015 16:19:14 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 72B6C204D8 for ; Wed, 12 Aug 2015 16:19:13 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 24AB7204D6 for ; Wed, 12 Aug 2015 16:19:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932191AbbHLQTD (ORCPT ); Wed, 12 Aug 2015 12:19:03 -0400 Received: from mx0b-00082601.pphosted.com ([67.231.153.30]:9630 "EHLO mx0b-00082601.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752850AbbHLQTB (ORCPT ); Wed, 12 Aug 2015 12:19:01 -0400 Received: from pps.filterd (m0004060 [127.0.0.1]) by mx0b-00082601.pphosted.com (8.14.5/8.14.5) with SMTP id t7CGH1q0021904; Wed, 12 Aug 2015 09:18:49 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=fb.com; h=message-id : date : from : mime-version : to : cc : subject : references : in-reply-to : content-type : content-transfer-encoding; s=facebook; bh=5K6pFXCemxhMPa29r1d4KhI2Ly+UmciO7BeYd5Z5KHA=; b=q6cqOCRCo2JRsrB5ZB4f5y4jImLDT2p1mgaMYlI0jT+ChjPrxpwPMiA99MiMqFczlcm1 SDwYouheG6+bVGlIjoWEhkg5/OAXpj5MpF5jyMBQ7WtT2E0ISpq6LtjSEFriZi7CBtX3 nCygy7kNbpFjycJU36N6UCm1OpgogqnvRBE= Received: from mail.thefacebook.com ([199.201.64.23]) by mx0b-00082601.pphosted.com with ESMTP id 1w88xpg6db-1 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NOT); Wed, 12 Aug 2015 09:18:49 -0700 Received: from localhost.localdomain (192.168.52.123) by mail.thefacebook.com (192.168.16.23) with Microsoft SMTP Server (TLS) id 14.3.195.1; Wed, 12 Aug 2015 09:18:47 -0700 Message-ID: <55CB71E5.1070302@fb.com> Date: Wed, 12 Aug 2015 12:18:45 -0400 From: Josef Bacik User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.7.0 MIME-Version: 1.0 To: Marc MERLIN CC: , , Subject: Re: kernel BUG at fs/btrfs/extent-tree.c:8113! (4.1.3 kernel) References: <20150706212156.GY17274@merlins.org> <20150710134348.GB15535@suse.cz> <20150712010229.GA5284@merlins.org> <20150723115558.GQ6306@suse.cz> <20150724162446.GH30815@merlins.org> <20150803035130.GL24824@merlins.org> <20150811050758.GF29259@merlins.org> <55CA177D.1050004@fb.com> <20150812144749.GY24824@merlins.org> <55CB631B.2080404@fb.com> <20150812160936.GK29259@merlins.org> In-Reply-To: <20150812160936.GK29259@merlins.org> X-Originating-IP: [192.168.52.123] X-Proofpoint-Spam-Reason: safe X-FB-Internal: Safe X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:5.14.151, 1.0.33, 0.0.0000 definitions=2015-08-12_09:2015-08-12, 2015-08-12, 1970-01-01 signatures=0 Sender: linux-btrfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@vger.kernel.org X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,RP_MATCHES_RCVD,T_DKIM_INVALID,UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP On 08/12/2015 12:09 PM, Marc MERLIN wrote: > On Wed, Aug 12, 2015 at 11:15:39AM -0400, Josef Bacik wrote: >> On 08/12/2015 10:47 AM, Marc MERLIN wrote: >>> On Tue, Aug 11, 2015 at 11:40:45AM -0400, Josef Bacik wrote: >>>> From a48cf7a9ae44a17d927df5542c8b0be287aee9ed Mon Sep 17 00:00:00 2001 >>>> From: Josef Bacik >>>> Date: Tue, 11 Aug 2015 11:39:37 -0400 >>>> Subject: [PATCH] Btrfs: kill BUG_ON() in btrfs_lookup_extent_info() >>>> >>>> Replace it with an ASSERT(0) for the developers and an error for not the >>>> developers. >>> >>> Thanks. We knocked one down and now another BUG has been triggered :) >>> >>> if (unlikely(wc->refs[level - 1] == 0)) { >>> btrfs_err(root->fs_info, "Missing references."); >>> BUG(); >>> } >>> >> >> This is why you got your own branch, it's never just one. Here's >> the next bit > > Yes, I figured there might be a few more :) > Thanks for this patch, it definitely made things better: > > [ 165.656408] BTRFS info (device dm-0): disk space caching is enabled > [ 205.528199] BTRFS error (device dm-0): Missing references. > [ 205.528216] BTRFS: error (device dm-0) in btrfs_drop_snapshot:8652: errno=-5 IO failure > [ 205.528225] BTRFS info (device dm-0): forced readonly > > That's perfect, thanks much for that. > > Now, back to check --repair, does it make sense to fix it too so that it doesn't crash either? > > myth:~# btrfs check --repair /dev/mapper/crypt_sdd1 > enabling repair mode > Checking filesystem on /dev/mapper/crypt_sdd1 > UUID: 024ba4d0-dacb-438d-9f1b-eeb34083fe49 > checking extents > cmds-check.c:4486: add_data_backref: Assertion `back->bytes != max_size` failed. > btrfs[0x8066a73] > btrfs[0x8066aa4] > btrfs[0x8067991] > btrfs[0x806b4ab] > btrfs[0x806b9a3] > btrfs[0x806c5b2] > btrfs(cmd_check+0x1088)[0x806eddf] > btrfs(main+0x153)[0x80557c6] > /lib/i386-linux-gnu/libc.so.6(__libc_start_main+0xf3)[0xb75784d3] > btrfs[0x80557ec] > Going to need more info to figure this one out From d77cd13f94fae6d995f753f3de3728c4ef4f8e75 Mon Sep 17 00:00:00 2001 From: Josef Bacik Date: Wed, 12 Aug 2015 12:18:01 -0400 Subject: [PATCH] some debugging --- cmds-check.c | 2 ++ 1 file changed, 2 insertions(+) back->found_ref += 1; diff --git a/cmds-check.c b/cmds-check.c index dd2fce3..8f668d7 100644 --- a/cmds-check.c +++ b/cmds-check.c @@ -4524,6 +4524,8 @@ static int add_data_backref(struct cache_tree *extent_cache, u64 bytenr, if (found_ref) { BUG_ON(num_refs != 1); if (back->node.found_ref) + if (back->bytes != max_size) + fprintf(stderr, "wtf, parent %llu\n", (unsigned long long)parent); BUG_ON(back->bytes != max_size); back->node.found_ref = 1;