From patchwork Tue Aug 11 15:40: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: 6992871 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 F18CCC05AC for ; Tue, 11 Aug 2015 15:41:07 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 0CE56205D4 for ; Tue, 11 Aug 2015 15:41:07 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 24AFC202F2 for ; Tue, 11 Aug 2015 15:41:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S965216AbbHKPlA (ORCPT ); Tue, 11 Aug 2015 11:41:00 -0400 Received: from mx0a-00082601.pphosted.com ([67.231.145.42]:7129 "EHLO mx0a-00082601.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S965062AbbHKPk7 (ORCPT ); Tue, 11 Aug 2015 11:40:59 -0400 Received: from pps.filterd (m0044012 [127.0.0.1]) by mx0a-00082601.pphosted.com (8.14.5/8.14.5) with SMTP id t7BFb647004299; Tue, 11 Aug 2015 08:40:48 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=fb.com; h=message-id : date : from : mime-version : to : subject : references : in-reply-to : content-type : content-transfer-encoding; s=facebook; bh=/+Uuuw95Oj2WrBvKtEWW5XqexdPfyfakZh4lmbJOlR4=; b=YaE0a2oaONAJuFiU31AFtDi2BkD9/LYXHB7az/hc8aQInFkOId+vXKQX/cyriYZqdv2w FkwSgh+8z5odjXwdzh0+FJv1yrUPFyP75ZzPtR09ZeprSgARINBeDPwqmT+H3gHU/FI5 N2HjfTx1SgRzNx+8wju7PIMArRHDyp/JsFk= Received: from mail.thefacebook.com ([199.201.64.23]) by mx0a-00082601.pphosted.com with ESMTP id 1w75vy9mxq-13 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NOT); Tue, 11 Aug 2015 08:40:48 -0700 Received: from localhost.localdomain (192.168.52.123) by mail.thefacebook.com (192.168.16.16) with Microsoft SMTP Server (TLS) id 14.3.195.1; Tue, 11 Aug 2015 08:40:47 -0700 Message-ID: <55CA177D.1050004@fb.com> Date: Tue, 11 Aug 2015 11:40: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 , , , 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> In-Reply-To: <20150811050758.GF29259@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-11_07:2015-08-11, 2015-08-11, 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=-7.0 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/11/2015 01:07 AM, Marc MERLIN wrote: > On Sun, Aug 02, 2015 at 08:51:30PM -0700, Marc MERLIN wrote: >> On Fri, Jul 24, 2015 at 09:24:46AM -0700, Marc MERLIN wrote: >>>>>> Screenshot: https://urldefense.proofpoint.com/v1/url?u=http://marc.merlins.org/tmp/btrfs_crash.jpg&k=ZVNjlDMF0FElm4dQtryO4A%3D%3D%0A&r=cKCbChRKsMpTX8ybrSkonQ%3D%3D%0A&m=BIMTuuT5G3PNqsD7rUX5Uzfyd1xL9vQIECC7sPpJh5U%3D%0A&s=5a4e737cf6e23a884121a0bd2c935edb9e7011394b6b59b109c11716a562000b >>>> >>>> So it's 32bit system, 3.19.8, crashing during snapshot deletion and >>>> backref walking. EIP is in do_walk_down+0x142. I've tried to match it to >>>> the sources on a local 32bit build, but it does not point to the >>>> expected crash site: >>> >>> Thanks for looking. >>> Unfortunately it's a mythtv where if I put a 64bit kernel, other things >>> go wrong with the 32bit userland/64bit kernel split. >>> But I'll put a newer 64bit kernel on it to see what happens and report >>> back. >> >> I got home, built the last kernel and got netconsole working. >> 4.1.3/64bit and 32bit crash the same way. > > So, it's been several weeks that I can't use this filesystem. > Is anyone interested in fixing the kernel bug before I wipe it? > (as in, even if the FS is corrupted, it should not crash the kernel) > 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. Signed-off-by: Josef Bacik --- fs/btrfs/extent-tree.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/fs/btrfs/extent-tree.c b/fs/btrfs/extent-tree.c index 5411f0a..f7fb120 100644 --- a/fs/btrfs/extent-tree.c +++ b/fs/btrfs/extent-tree.c @@ -818,7 +818,11 @@ search_again: BUG(); #endif } - BUG_ON(num_refs == 0); + if (num_refs == 0) { + ASSERT(0); + ret = -EIO; + goto out_free; + } } else { num_refs = 0; extent_flags = 0; @@ -859,7 +863,6 @@ search_again: } spin_unlock(&delayed_refs->lock); out: - WARN_ON(num_refs == 0); if (refs) *refs = num_refs; if (flags)