From patchwork Sat Dec 2 10:49:37 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johannes Berg X-Patchwork-Id: 172804 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:bcd1:0:b0:403:3b70:6f57 with SMTP id r17csp1693002vqy; Sat, 2 Dec 2023 02:49:59 -0800 (PST) X-Google-Smtp-Source: AGHT+IHALSpSZ5aCVQJGovx6FH2s2wEV112RLCaVisu1/yPzeNDDguHGekMm6hPcu3LGYKVIzsm2 X-Received: by 2002:a05:6870:818f:b0:1fa:fd1e:75ce with SMTP id k15-20020a056870818f00b001fafd1e75cemr1228514oae.6.1701514199628; Sat, 02 Dec 2023 02:49:59 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701514199; cv=none; d=google.com; s=arc-20160816; b=EC67j9RkbCFau5boYXYQEiEyzD9Lmxm4o5lwDocVDpIyHl0UIfNot1f/f22CuXk3NH Fa+STacW3IoY7hE6oWVHDVR562/8Aw8RjjPVc6DKX9zsB/GiXbDz3XfXOUdDVMqBDKW8 GAoSK8StDdgn428DEjzkjxGQRQ8JCmxFXYliOXRmio3y46PdT9wWzwxNghrp8hRjs5Cy Ldip5EQNFH9g/t3IEOXqLyPbsQeVxj/WU58ouKWMQxIi3BUcq8sk/tEd/QEAFH47eK+/ m2jS42zOLu++npd1XZOOltuQvPxA3x1Pm45X0zwSiirtdP7Z695qBNN+3CQ6ZN2ivaGR FKxw== 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 :message-id:date:subject:cc:to:from:dkim-signature; bh=F8PhHlQpw1agE8e4gUoZBwCoedJwGCZUllve+ZMs9lU=; fh=uju8FYhVIPiDs73f9+hPBXNle1EEmobgLwzjO1aLIEk=; b=DUCNN0ILBzwH/mtVmjAgDdlFkRs8mKlgOJ6WqADgIf4bLTqEx2qWuX0qE4AWT+kPIs bn6V7Amzq8x8822D1QuE5vslL7mtPaMvwT1h2ZYCX4Ymjkqje3Jvkk/XlyJjbW1MbuAI X+kZ3fo9wnwkWQN5rsTuCwEcW7adJbp1O3HR9emQSEGgkKDHJgcUFvwKO4skigptMldc xurOyTpmHRZUs0bWUX9ZceU5Lhj1yW4qfIriWSHzeqc8A6KVRlVBaui8nqtBCOQ/ebKi EnhISXf5ZxtNF3YGekHCbT5KismKAxRb9MxPGt3F5/p5Ihn4UOs9THOfTNf0yj/03bBI eN8g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@sipsolutions.net header.s=mail header.b=FEcmzQh0; 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 howler.vger.email (howler.vger.email. [2620:137:e000::3:4]) by mx.google.com with ESMTPS id x10-20020a17090a8a8a00b00285923a2797si6862427pjn.106.2023.12.02.02.49.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 02 Dec 2023 02:49:59 -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=FEcmzQh0; 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 141388055AFA; Sat, 2 Dec 2023 02:49:57 -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 S232186AbjLBKti (ORCPT + 99 others); Sat, 2 Dec 2023 05:49:38 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49502 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229451AbjLBKti (ORCPT ); Sat, 2 Dec 2023 05:49:38 -0500 Received: from sipsolutions.net (s3.sipsolutions.net [IPv6:2a01:4f8:242:246e::2]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A9D81124; Sat, 2 Dec 2023 02:49:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sipsolutions.net; s=mail; h=Content-Transfer-Encoding:MIME-Version: Message-ID:Date:Subject:Cc:To:From:Content-Type:Sender:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-To:Resent-Cc: Resent-Message-ID:In-Reply-To:References; bh=F8PhHlQpw1agE8e4gUoZBwCoedJwGCZUllve+ZMs9lU=; t=1701514184; x=1702723784; b=FEcmzQh0bsIjqk6r5t6yevD+khvz0zRxqI/Z8MWgdf23sUSCiyk43o3BM9PqKEyalOwcHEaIfyy DNZqH03AVZbpgEk4oCoBqxwRY2mNAAxwTw16oCn72GLqUUSAXhPbWi3/3VqqAwEHwu1/RQvFryYBs ufe1zCpDMIve+8rsG6ZlGl1hLz8wLrUmHMB+qzi48aIisx7DEF6p66nVf/gi0N+aMHsoxuhtWEW2F dh9SEIR/hNoPEqpYmm6isFSsDvFaUCCVLarxGQocf26lQBR91jv7djvLD0e7wG6MIjLzOXrZ4omev eTAXFa37SnH+v2NgaSEiisljkw/WWrkNh1fQ==; Received: by sipsolutions.net with esmtpsa (TLS1.3:ECDHE_X25519__RSA_PSS_RSAE_SHA256__AES_256_GCM:256) (Exim 4.97) (envelope-from ) id 1r9NZ7-0000000CR3d-3PqU; Sat, 02 Dec 2023 11:49:42 +0100 From: Johannes Berg To: linux-kernel@vger.kernel.org Cc: linux-wireless@vger.kernel.org, linux-fsdevel@vger.kernel.org, Greg Kroah-Hartman , Sergey Senozhatsky , Johannes Berg Subject: [PATCH] Revert "debugfs: annotate debugfs handlers vs. removal with lockdep" Date: Sat, 2 Dec 2023 11:49:37 +0100 Message-ID: <20231202114936.fd55431ab160.I911aa53abeeca138126f690d383a89b13eb05667@changeid> X-Mailer: git-send-email 2.43.0 MIME-Version: 1.0 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]); Sat, 02 Dec 2023 02:49:57 -0800 (PST) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1784166953465585648 X-GMAIL-MSGID: 1784166953465585648 From: Johannes Berg This reverts commit f4acfcd4deb1 ("debugfs: annotate debugfs handlers vs. removal with lockdep"), it appears to have false positives and really shouldn't have been in the -rc series with the fixes anyway. Signed-off-by: Johannes Berg Acked-by: Greg Kroah-Hartman --- fs/debugfs/file.c | 10 ---------- fs/debugfs/inode.c | 7 ------- fs/debugfs/internal.h | 6 ------ 3 files changed, 23 deletions(-) diff --git a/fs/debugfs/file.c b/fs/debugfs/file.c index a5ade8c16375..5063434be0fc 100644 --- a/fs/debugfs/file.c +++ b/fs/debugfs/file.c @@ -108,12 +108,6 @@ int debugfs_file_get(struct dentry *dentry) kfree(fsd); fsd = READ_ONCE(dentry->d_fsdata); } -#ifdef CONFIG_LOCKDEP - fsd->lock_name = kasprintf(GFP_KERNEL, "debugfs:%pd", dentry); - lockdep_register_key(&fsd->key); - lockdep_init_map(&fsd->lockdep_map, fsd->lock_name ?: "debugfs", - &fsd->key, 0); -#endif INIT_LIST_HEAD(&fsd->cancellations); mutex_init(&fsd->cancellations_mtx); } @@ -132,8 +126,6 @@ int debugfs_file_get(struct dentry *dentry) if (!refcount_inc_not_zero(&fsd->active_users)) return -EIO; - lock_map_acquire_read(&fsd->lockdep_map); - return 0; } EXPORT_SYMBOL_GPL(debugfs_file_get); @@ -151,8 +143,6 @@ void debugfs_file_put(struct dentry *dentry) { struct debugfs_fsdata *fsd = READ_ONCE(dentry->d_fsdata); - lock_map_release(&fsd->lockdep_map); - if (refcount_dec_and_test(&fsd->active_users)) complete(&fsd->active_users_drained); } diff --git a/fs/debugfs/inode.c b/fs/debugfs/inode.c index e4e7fe1bd9fb..034a617cb1a5 100644 --- a/fs/debugfs/inode.c +++ b/fs/debugfs/inode.c @@ -243,10 +243,6 @@ static void debugfs_release_dentry(struct dentry *dentry) /* check it wasn't a dir (no fsdata) or automount (no real_fops) */ if (fsd && fsd->real_fops) { -#ifdef CONFIG_LOCKDEP - lockdep_unregister_key(&fsd->key); - kfree(fsd->lock_name); -#endif WARN_ON(!list_empty(&fsd->cancellations)); mutex_destroy(&fsd->cancellations_mtx); } @@ -755,9 +751,6 @@ static void __debugfs_file_removed(struct dentry *dentry) if ((unsigned long)fsd & DEBUGFS_FSDATA_IS_REAL_FOPS_BIT) return; - lock_map_acquire(&fsd->lockdep_map); - lock_map_release(&fsd->lockdep_map); - /* if we hit zero, just wait for all to finish */ if (!refcount_dec_and_test(&fsd->active_users)) { wait_for_completion(&fsd->active_users_drained); diff --git a/fs/debugfs/internal.h b/fs/debugfs/internal.h index 0c4c68cf161f..dae80c2a469e 100644 --- a/fs/debugfs/internal.h +++ b/fs/debugfs/internal.h @@ -7,7 +7,6 @@ #ifndef _DEBUGFS_INTERNAL_H_ #define _DEBUGFS_INTERNAL_H_ -#include #include struct file_operations; @@ -25,11 +24,6 @@ struct debugfs_fsdata { struct { refcount_t active_users; struct completion active_users_drained; -#ifdef CONFIG_LOCKDEP - struct lockdep_map lockdep_map; - struct lock_class_key key; - char *lock_name; -#endif /* protect cancellations */ struct mutex cancellations_mtx;