Received: by 2002:ad5:4acb:0:0:0:0:0 with SMTP id n11csp4623481imw; Tue, 19 Jul 2022 10:00:49 -0700 (PDT) X-Google-Smtp-Source: AGRyM1tzCQsflNO/9g3R9X94cEfeGP7dXm/tWdDKP1cczKVF+4ujQEZwiIGjl5/Hk7b/bJFPmwxb X-Received: by 2002:a17:906:7308:b0:72f:3294:8002 with SMTP id di8-20020a170906730800b0072f32948002mr10304107ejc.311.1658250046440; Tue, 19 Jul 2022 10:00:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1658250046; cv=none; d=google.com; s=arc-20160816; b=ZTDrvPZcd9ykXkLGoClQi+T9izbo1B1NTeGEq7uj8a7PwolWAbNod1xay3JFAkZi1u 0GnvF3l2TBYKJSuNYC9hsUkfV9wctWuAOtsCmjwgUPdxS3Zdgb5iXDL1+t7/suITXfKK JmDX1pFSC4PXs+Xpcx307o7Ldlqhn7QGMVJBWUZbr/9NpBbUcK8Q4FM7aJnc93qiv2VI wwlZRli8MJF89o1VLe7YdNwunUyys2iv9tF6/18WpsG8etQqhMeefXIx4BNY25jVKLtk dH0f21SZU3PtkQkREenfOqq3O0xeUbmREndeYwG79tvQOQ9flzuv58IuBqG++V/U+SWx wwWw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=aFIgJi5+jkc3q0JJRrnYboNDpqhbBEgYlw+UMUfYC6A=; b=fKNk6SxdLgrRbUxjCQK3EYODOKTmuqt/xrxuE9RrYCr2bn7wbgxbK4I4Al7VWZVvoW HdppW/yElHv1cDXTkPYmWuuEpqX5jBQmqjxJUsA2n0At2zNRAeSuOSwbhO6bDJvn90PB N/4IQIUe+Kz6+YtFQ1vfRD4LL5YLzpCHL7KGR0iTV5Sv8X2x7j4R0N6EBaqnXBRJL6ST Qz85OVPcebnYItMzwlPX0EgLPrQPmmL3QEkqyO7sON8zKVaGsszA3HnQ2c55XeuaLDG+ pAbHWBYbKNPyHaFYr0GxEFm7ndP9jT85hM8ZDrgw3JvXkjTx1h/DRBEJYb7Vbfefvo9e Bdaw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmx.net header.s=badeba3b8450 header.b="c/U99IiT"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=gmx.de Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id f12-20020a0564021e8c00b0043795656e7dsi22278623edf.463.2022.07.19.10.00.19; Tue, 19 Jul 2022 10:00:46 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@gmx.net header.s=badeba3b8450 header.b="c/U99IiT"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=gmx.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234440AbiGSQcT (ORCPT + 99 others); Tue, 19 Jul 2022 12:32:19 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35524 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229754AbiGSQcR (ORCPT ); Tue, 19 Jul 2022 12:32:17 -0400 Received: from mout.gmx.net (mout.gmx.net [212.227.17.21]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AD5E0140C2; Tue, 19 Jul 2022 09:32:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1658248330; bh=08NO4ajYTq7L6Yz0UzsFvyYhOxLXwbgVf0lxHpS+jts=; h=X-UI-Sender-Class:Date:Subject:To:Cc:References:From:In-Reply-To; b=c/U99IiTp9+rB2ylrMqjNdVUE/RPi6Cgih4/L2MK0cE89TrB1IEFVp1nZlkBuB2nN 4b2dp+11yUqJBfmL7+PbVjgU0Rj9yQVq7pZkrjO8AHOjMUQeJ8vbC5sKifMQFo8uy5 yC5xLVQ1n2MPS2Z2f6QaESY1vmTCO4109jCXT8cU= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Received: from [192.168.20.60] ([92.116.145.26]) by mail.gmx.net (mrgmx105 [212.227.17.168]) with ESMTPSA (Nemesis) id 1MYeMt-1o0JmE3eWh-00VeJ4; Tue, 19 Jul 2022 18:32:09 +0200 Message-ID: <0aa365ca-a9f0-8d15-b515-adb8823f5d28@gmx.de> Date: Tue, 19 Jul 2022 18:32:04 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.11.0 Subject: Re: WARNING: CPU: 1 PID: 14735 at fs/dcache.c:365 dentry_free+0x100/0x128 Content-Language: en-US To: Hillf Danton Cc: linux-kernel@vger.kernel.org, linux-parisc@vger.kernel.org References: <20220709090756.2384-1-hdanton@sina.com> <20220715133300.1297-1-hdanton@sina.com> <20220717113634.1552-1-hdanton@sina.com> From: Helge Deller In-Reply-To: <20220717113634.1552-1-hdanton@sina.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Provags-ID: V03:K1:tVlPD/7xMU6x1n8XIiXM1z5w1B4tgHndptPO3FVJYI2wIcetCIx hU81JmqQ41EvYUhZHCWccMh5hAlSeLQ9h3NaAF2uWJ12miKk1o0q7XPV4ELpEfyb9Z1nt8y cgaKTMZtWQIY4WHY+KjiHY7UMcXDKnO/F8qCeEQ1PijCSPVyq21jxC/tN7tZIAQ0GGIHtwP /npN7a4y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O+eXLggW9oad4BeE3NpPgsPawtt0Lj3rmC0huw5 c3jViqsxnxAOLK7PjXjoudI6Li17M8Wl/xPZCb4tzO7VVcOKt55eDvwtCWz6AjpMagyynMp2Z EFvfECDdY34Eq3IaDC3/PLAsiX2e8g1KjXqvhPF+Ewv/oRbew2U+yrl9A== X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,FREEMAIL_FROM,NICE_REPLY_A,RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hello Hillf, On 7/17/22 13:36, Hillf Danton wrote: > On Sun, 17 Jul 2022 11:42:48 +0200 >> I used WARN_ON() instead of BUG_ON(). >> With that, both triggered, first the first one, then the second one. >> Full log is here: >> http://dellerweb.de/testcases/minicom.dcache.crash.6-warn > > Given the first BUG_ON triggered, and dentry at the moment is supposed t= o > not be alias, see if it is still in lookup with d_lock held. That is the > step before de-unioning d_alias with d_in_lookup_hash. > > On the other hand if only the second one triggered, we should track > DCACHE_DENTRY_KILLED instead in assumption that killed dentry was > used again after releasing d_lock surrounding the firt one. The machine has now been up for 2 days without any issues, while it had pr= etty much the same load as when it was crashing earlier. So, in summary I'd assume that your patch below fixes the issue. I'm now rebooting the machine with a new kernel, where I just changed if (unlikely(d_in_lookup(dentry))) to if (WARN_ON_ONCE(d_in_lookup(dentry))) in order to see if this really triggered. Anyway, I think your patch is good so far. Would that be the final patch, or should I test some others? Thanks! Helge > > --- a/fs/dcache.c > +++ b/fs/dcache.c > @@ -605,8 +605,12 @@ static void __dentry_kill(struct dentry > spin_unlock(&parent->d_lock); > if (dentry->d_inode) > dentry_unlink_inode(dentry); > - else > + else { > + if (unlikely(d_in_lookup(dentry))) { > + __d_lookup_done(dentry); > + } > spin_unlock(&dentry->d_lock); > + } > this_cpu_dec(nr_dentry); > if (dentry->d_op && dentry->d_op->d_release) > dentry->d_op->d_release(dentry);