Received: by 2002:a05:7412:b10a:b0:f3:1519:9f41 with SMTP id az10csp2974062rdb; Mon, 4 Dec 2023 12:46:19 -0800 (PST) X-Google-Smtp-Source: AGHT+IHhpBEiGIN85Tup7amGZaz9tiUfACWj6wcDCErmKZlS+GFkQFj00TYGLdMNFREmeE8DqA7u X-Received: by 2002:a05:6a20:2447:b0:18c:23b0:3b0e with SMTP id t7-20020a056a20244700b0018c23b03b0emr28884629pzc.21.1701722779672; Mon, 04 Dec 2023 12:46:19 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701722779; cv=none; d=google.com; s=arc-20160816; b=oZP90SX8qVyRlUqpazy7/wSHZ5jj5LgUqx33VjZBpKjjwYh1UTkXQtzSA70SiR8v91 3dCO9969ZXG6huqCa9pYGXV/mmJFjwc1+ufcdZ8+2UqogjdlGDjc2fxu2tKAkpEFs37D VF8zaBTkKrltm/GKlykLNmUP8cpBPc3sbIEGyc5+GtGwLTieIdJc7lsKFVQ8ZBZ2v/NB OWZtIoMxkpnt9NuDoVpO9hCIqbp/6fVgejit/NjTswAYdqXp3xcVjxhBBcamaYlkzddR NdrLBJqz3GQ6Q1i0+FZtYshre9yZgYj2n67a0IxUYzYNV7E7pfJSn0yPrUGWY/wpz7Bw oo4A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:user-agent :content-transfer-encoding:references:in-reply-to:date:cc:to:from :subject:message-id:dkim-signature; bh=IzuQejDpRVhj/RMqVK3vOEQVqngyGrm2sTvalLaOwLg=; fh=aDmhD3D3wWEmLfuNkQNydpKXL3baWyFbrMU+minFLPc=; b=mBANX8363uPlrg8YEJcZKK5W4pg4ibBXFvukg+dHT25k0HqpT4rp9nlrnIkXuhRIJl ttc1DVynsKkGmRoOmRSdfden0us/MH6bQC0TgvRGQB6wHSsKUCldF0EBBKaapqo+hQjT M0iAs0SMSo3gPZzqQXTktagpcaUomitL7E9F0YolkVhI8fDl/JwT2p92+6pyR2dJII66 E1XMkYZd4giOq3/Yw2Khhn3fHhgquwaHl0p8+NdSGKwmR9QVqBd0bv/Vg/k0sItrR87x j300D88+FcLWl3hIklhLsCjIV5kConht+Fo8dcWi33p0q1tQOQNCh9nw48LMiC8vBeR2 IKVw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@sipsolutions.net header.s=mail header.b="H/WMcxmV"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=REJECT dis=NONE) header.from=sipsolutions.net Return-Path: Received: from howler.vger.email (howler.vger.email. [2620:137:e000::3:4]) by mx.google.com with ESMTPS id bi3-20020a056a02024300b005b57aa8517bsi9109686pgb.91.2023.12.04.12.46.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 04 Dec 2023 12:46:19 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) client-ip=2620:137:e000::3:4; Authentication-Results: mx.google.com; dkim=pass header.i=@sipsolutions.net header.s=mail header.b="H/WMcxmV"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=REJECT dis=NONE) header.from=sipsolutions.net Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by howler.vger.email (Postfix) with ESMTP id 54FE18067B63; Mon, 4 Dec 2023 12:46:11 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at howler.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233973AbjLDUpz (ORCPT + 99 others); Mon, 4 Dec 2023 15:45:55 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53540 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231451AbjLDUpw (ORCPT ); Mon, 4 Dec 2023 15:45:52 -0500 Received: from sipsolutions.net (s3.sipsolutions.net [IPv6:2a01:4f8:242:246e::2]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F23F1AA; Mon, 4 Dec 2023 12:45:58 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sipsolutions.net; s=mail; h=MIME-Version:Content-Transfer-Encoding: Content-Type:References:In-Reply-To:Date:Cc:To:From:Subject:Message-ID:Sender :Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From:Resent-To: Resent-Cc:Resent-Message-ID; bh=IzuQejDpRVhj/RMqVK3vOEQVqngyGrm2sTvalLaOwLg=; t=1701722759; x=1702932359; b=H/WMcxmV0wxRurMtewK+gpNJ/8Evke2GSY/JzvBZXuAB3+k v7s6xENb+LIx4zVJ4QnBTH+DkSd2MSOaJSpSgto22gS+wVb3ebOwE4Wg1MeFhCLWElq2SA35UedNt Cn4h6RIIwi/EhXVdqmjZoN43yvd+Xu1UgGHqIbjbSQT8dKbWc8KMORFOGwKFSH9C3jUx8LC2Ufboe VMZmlXuPkxqKrZiI/4TkOLhlQCX9Uc4hG7qWABRmNaiIHR2/m8MK960em7hBcwe7/fVWFEIyztOpk JbnPaY+FUkz7nPsNdPdjQfyv6QO32nR9n+6vD0i8UaMBITexKH/uhhzNd9UvuCAw==; Received: by sipsolutions.net with esmtpsa (TLS1.3:ECDHE_X25519__RSA_PSS_RSAE_SHA256__AES_256_GCM:256) (Exim 4.97) (envelope-from ) id 1rAFpE-0000000FFfd-2z3a; Mon, 04 Dec 2023 21:45:57 +0100 Message-ID: <1a7a8caa3fe9b4e3271239b86ebd24a41464b79f.camel@sipsolutions.net> Subject: Re: [PATCH AUTOSEL 6.6 15/32] debugfs: annotate debugfs handlers vs. removal with lockdep From: Johannes Berg To: Sasha Levin , "linux-kernel@vger.kernel.org" , "stable@vger.kernel.org" Cc: Greg Kroah-Hartman Date: Mon, 04 Dec 2023 21:45:55 +0100 In-Reply-To: <20231204203317.2092321-15-sashal@kernel.org> References: <20231204203317.2092321-1-sashal@kernel.org> <20231204203317.2092321-15-sashal@kernel.org> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.50.1 (3.50.1-1.fc39) MIME-Version: 1.0 X-malware-bazaar: not-scanned X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on howler.vger.email 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 (howler.vger.email [0.0.0.0]); Mon, 04 Dec 2023 12:46:11 -0800 (PST) On Mon, 2023-12-04 at 20:32 +0000, Sasha Levin wrote: > From: Johannes Berg >=20 > [ Upstream commit f4acfcd4deb158b96595250cc332901b282d15b0 ] >=20 > When you take a lock in a debugfs handler but also try > to remove the debugfs file under that lock, things can > deadlock since the removal has to wait for all users > to finish. >=20 > Add lockdep annotations in debugfs_file_get()/_put() > to catch such issues. >=20 This (and the previous patch) probably got picked up as dependencies for the locking things, but ... we reverted this. For 6.6, _maybe_ it's worth backporting this including the revert, but then I'd do that only when the revert landed to have them together. But then you should apply all the six patches listed below _and_ the revert, the set as here doesn't do anything useful. However ... given that debugfs is root-only, and you have to be reading/writing a file _while_ disconnecting and the file is removed, perhaps the whole thing isn't worth backporting at all. For 6.1 and earlier, I believe it's not needed at all, so please drop from there all of these: - debugfs: fix automount d_fsdata usage - debugfs: annotate debugfs handlers vs. removal with lockdep - debugfs: add API to allow debugfs operations cancellation - wifi: cfg80211: add locked debugfs wrappers - wifi: mac80211: use wiphy locked debugfs helpers for agg_status - wifi: mac80211: use wiphy locked debugfs for sdata/link I'd kind of think just dropping all of these completely makes more sense. johannes