Revert "debugfs: annotate debugfs handlers vs. removal with lockdep"

This reverts commit f4acfcd4de ("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 <johannes.berg@intel.com>
Link: https://lore.kernel.org/r/20231202114936.fd55431ab160.I911aa53abeeca138126f690d383a89b13eb05667@changeid
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
Johannes Berg 2023-12-02 11:49:37 +01:00 committed by Greg Kroah-Hartman
parent 4906f39a13
commit 88ac06a9f9
3 changed files with 0 additions and 23 deletions

View File

@ -108,12 +108,6 @@ int debugfs_file_get(struct dentry *dentry)
kfree(fsd); kfree(fsd);
fsd = READ_ONCE(dentry->d_fsdata); 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); INIT_LIST_HEAD(&fsd->cancellations);
mutex_init(&fsd->cancellations_mtx); mutex_init(&fsd->cancellations_mtx);
} }
@ -132,8 +126,6 @@ int debugfs_file_get(struct dentry *dentry)
if (!refcount_inc_not_zero(&fsd->active_users)) if (!refcount_inc_not_zero(&fsd->active_users))
return -EIO; return -EIO;
lock_map_acquire_read(&fsd->lockdep_map);
return 0; return 0;
} }
EXPORT_SYMBOL_GPL(debugfs_file_get); 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); struct debugfs_fsdata *fsd = READ_ONCE(dentry->d_fsdata);
lock_map_release(&fsd->lockdep_map);
if (refcount_dec_and_test(&fsd->active_users)) if (refcount_dec_and_test(&fsd->active_users))
complete(&fsd->active_users_drained); complete(&fsd->active_users_drained);
} }

View File

@ -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) */ /* check it wasn't a dir (no fsdata) or automount (no real_fops) */
if (fsd && fsd->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)); WARN_ON(!list_empty(&fsd->cancellations));
mutex_destroy(&fsd->cancellations_mtx); 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) if ((unsigned long)fsd & DEBUGFS_FSDATA_IS_REAL_FOPS_BIT)
return; return;
lock_map_acquire(&fsd->lockdep_map);
lock_map_release(&fsd->lockdep_map);
/* if we hit zero, just wait for all to finish */ /* if we hit zero, just wait for all to finish */
if (!refcount_dec_and_test(&fsd->active_users)) { if (!refcount_dec_and_test(&fsd->active_users)) {
wait_for_completion(&fsd->active_users_drained); wait_for_completion(&fsd->active_users_drained);

View File

@ -7,7 +7,6 @@
#ifndef _DEBUGFS_INTERNAL_H_ #ifndef _DEBUGFS_INTERNAL_H_
#define _DEBUGFS_INTERNAL_H_ #define _DEBUGFS_INTERNAL_H_
#include <linux/lockdep.h>
#include <linux/list.h> #include <linux/list.h>
struct file_operations; struct file_operations;
@ -25,11 +24,6 @@ struct debugfs_fsdata {
struct { struct {
refcount_t active_users; refcount_t active_users;
struct completion active_users_drained; struct completion active_users_drained;
#ifdef CONFIG_LOCKDEP
struct lockdep_map lockdep_map;
struct lock_class_key key;
char *lock_name;
#endif
/* protect cancellations */ /* protect cancellations */
struct mutex cancellations_mtx; struct mutex cancellations_mtx;