Received: by 2002:a05:7412:a9a2:b0:e2:908c:2ebd with SMTP id o34csp1913318rdh; Sat, 28 Oct 2023 12:18:07 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFXsIsVQwrMYzyN8orPBSx9jXGzeoeBscoqbZkD3Jd8H0QDwZh0ZVem/fRv7dqbUo4JyX1C X-Received: by 2002:a05:6a20:8e05:b0:17d:f676:40b3 with SMTP id y5-20020a056a208e0500b0017df67640b3mr7491534pzj.19.1698520686975; Sat, 28 Oct 2023 12:18:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698520686; cv=none; d=google.com; s=arc-20160816; b=ZAK04tla+c/yT3PRKTsRdwUtaW+kyprJ2XprVreuRhjrXfJxWSeeYUiUo9Zgecea/A WGxjpblI9La/jWsg3Hx41c6aO8wMTmIB8Dw0jxcUiInSO28VRZWFnuvhM1/dG1115/QS q37g/LkqEHfOXvkBcQlzgIgNRYVoycEo4yglVnRXt8JuOAOnyC8HFIbAR+Zf1APr6dC9 6/LP8SZ1Ec/gUTsll58zX04leTXkEHxJeCKciS+U3L4hmzFbErpeokVpw/y/vLXXUYig L3wzO5lhrp7SOmYyHUcH7nwaukUWk9+2aWho7x9s6V1D5Zod6/a+YVUmXAH/YCcI8Zk3 bgcQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date; bh=C+tpvQHe7jefksw5qzG1xP6ij6ZPOhX/Ys1X+Xy/P18=; fh=iNZZRcVgl6EqKm2KzMnc3rea11Wpsm942eUDW6BmWzU=; b=k6oDHMcmxfrw+xL0pqu4w+ViCtl5pDhul0XthbzP5zYlbxQss/NJERjIFv7a/EsYj8 RW6G1jmonmdiUrYRNPxTiYoT8sj9VEBdvVsaoLGw8Sm7cTGyiDN2FNRSxXpKFOmAU1o+ OABMsmvf+96HzqCpiFh40wGOISUz1vPBTn3ko3/D3d4MNBfFkUNyNM8uy86BJzP5tF9Y OBpg3kTCavdiKglTFVFtlcJT0LuN4B+UKmYij9pWcz8t+9Q5QenyT7jAPAYBB9jcccxc dpPow0FiiCMK9/GZPmBIiQQZAVg7JcJkUCti5BkmiJFy2YPa4vBGMklrB3Gvr8+I3rQE HQ4A== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from snail.vger.email (snail.vger.email. [23.128.96.37]) by mx.google.com with ESMTPS id jb19-20020a170903259300b001cc2aac0ac9si1872970plb.442.2023.10.28.12.18.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 28 Oct 2023 12:18:06 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) client-ip=23.128.96.37; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id 8E566804E7B1; Sat, 28 Oct 2023 12:18:05 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229550AbjJ1TSC (ORCPT + 99 others); Sat, 28 Oct 2023 15:18:02 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42254 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229446AbjJ1TSA (ORCPT ); Sat, 28 Oct 2023 15:18:00 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7FCCCEB; Sat, 28 Oct 2023 12:17:58 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id D21AAC433C8; Sat, 28 Oct 2023 19:17:55 +0000 (UTC) Date: Sat, 28 Oct 2023 15:17:53 -0400 From: Steven Rostedt To: "Arnd Bergmann" Cc: "Naresh Kamboju" , "open list:KERNEL SELFTEST FRAMEWORK" , linux-trace-kernel@vger.kernel.org, "open list" , linux-mm , lkft-triage@lists.linaro.org, "Masami Hiramatsu" , "Mark Rutland" , "Andrew Morton" , "Oleg Nesterov" , "Dave Jones" , "Greg Kroah-Hartman" , "Paul McKenney" , "Alan Stern" , "Sasha Levin" , "Peter Zijlstra" , "Ingo Molnar" , "Dan Carpenter" , "Ajay Kaher" , Beau Belgrave Subject: Re: selftests: ftrace: RIP: 0010:__lock_acquire (kernel/locking/lockdep.c:5005) Message-ID: <20231028151753.1df27654@rorschach.local.home> In-Reply-To: <8f86f22a-e182-4ddf-b533-b4ae8b088dd4@app.fastmail.com> References: <8f86f22a-e182-4ddf-b533-b4ae8b088dd4@app.fastmail.com> X-Mailer: Claws Mail 3.17.8 (GTK+ 2.24.33; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-4.0 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,RCVD_IN_DNSWL_MED,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 X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Sat, 28 Oct 2023 12:18:05 -0700 (PDT) On Fri, 27 Oct 2023 14:55:14 +0200 "Arnd Bergmann" wrote: > This lock is part of the dentry passed to d_invalidate() > > > [ 1402.609170] ? lock_release (kernel/locking/lockdep.c:5429 > > kernel/locking/lockdep.c:5773) > > [ 1402.612923] ? create_dir_dentry.part.0 (fs/tracefs/event_inode.c:387) > > [ 1402.617803] _raw_spin_lock (include/linux/spinlock_api_smp.h:134 > > kernel/locking/spinlock.c:154) > > [ 1402.621467] ? d_invalidate (fs/dcache.c:1725 (discriminator 1)) > > [ 1402.625126] d_invalidate (fs/dcache.c:1725 (discriminator 1)) > > [ 1402.628619] create_dir_dentry.part.0 (fs/tracefs/event_inode.c:390) > > Which is called by create_dir_dentry(). I don't see a bug > in that function, but maybe Steve has an idea. > > I see a bug ;-) Can you test this patch? Thanks! -- Steve diff --git a/fs/tracefs/event_inode.c b/fs/tracefs/event_inode.c index 4d2da7480e5f..ef003149e4d3 100644 --- a/fs/tracefs/event_inode.c +++ b/fs/tracefs/event_inode.c @@ -234,6 +234,10 @@ create_file_dentry(struct eventfs_inode *ei, struct dentry **e_dentry, bool invalidate = false; mutex_lock(&eventfs_mutex); + if (ei->is_freed) { + mutex_unlock(&eventfs_mutex); + return NULL; + } /* If the e_dentry already has a dentry, use it */ if (*e_dentry) { /* lookup does not need to up the ref count */ @@ -333,6 +337,10 @@ create_dir_dentry(struct eventfs_inode *ei, struct dentry *parent, bool lookup) struct dentry *dentry = NULL; mutex_lock(&eventfs_mutex); + if (ei->is_freed) { + mutex_unlock(&eventfs_mutex); + return NULL; + } if (ei->dentry) { /* If the dentry already has a dentry, use it */ dentry = ei->dentry; -- 2.42.0