Skip to content

Commit 88ac06a

Browse files
jmberg-intelgregkh
authored andcommitted
Revert "debugfs: annotate debugfs handlers vs. removal with lockdep"
This reverts commit f4acfcd ("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 <[email protected]> Link: https://lore.kernel.org/r/20231202114936.fd55431ab160.I911aa53abeeca138126f690d383a89b13eb05667@changeid Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent 4906f39 commit 88ac06a

File tree

3 files changed

+0
-23
lines changed

3 files changed

+0
-23
lines changed

fs/debugfs/file.c

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -108,12 +108,6 @@ int debugfs_file_get(struct dentry *dentry)
108108
kfree(fsd);
109109
fsd = READ_ONCE(dentry->d_fsdata);
110110
}
111-
#ifdef CONFIG_LOCKDEP
112-
fsd->lock_name = kasprintf(GFP_KERNEL, "debugfs:%pd", dentry);
113-
lockdep_register_key(&fsd->key);
114-
lockdep_init_map(&fsd->lockdep_map, fsd->lock_name ?: "debugfs",
115-
&fsd->key, 0);
116-
#endif
117111
INIT_LIST_HEAD(&fsd->cancellations);
118112
mutex_init(&fsd->cancellations_mtx);
119113
}
@@ -132,8 +126,6 @@ int debugfs_file_get(struct dentry *dentry)
132126
if (!refcount_inc_not_zero(&fsd->active_users))
133127
return -EIO;
134128

135-
lock_map_acquire_read(&fsd->lockdep_map);
136-
137129
return 0;
138130
}
139131
EXPORT_SYMBOL_GPL(debugfs_file_get);
@@ -151,8 +143,6 @@ void debugfs_file_put(struct dentry *dentry)
151143
{
152144
struct debugfs_fsdata *fsd = READ_ONCE(dentry->d_fsdata);
153145

154-
lock_map_release(&fsd->lockdep_map);
155-
156146
if (refcount_dec_and_test(&fsd->active_users))
157147
complete(&fsd->active_users_drained);
158148
}

fs/debugfs/inode.c

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -243,10 +243,6 @@ static void debugfs_release_dentry(struct dentry *dentry)
243243

244244
/* check it wasn't a dir (no fsdata) or automount (no real_fops) */
245245
if (fsd && fsd->real_fops) {
246-
#ifdef CONFIG_LOCKDEP
247-
lockdep_unregister_key(&fsd->key);
248-
kfree(fsd->lock_name);
249-
#endif
250246
WARN_ON(!list_empty(&fsd->cancellations));
251247
mutex_destroy(&fsd->cancellations_mtx);
252248
}
@@ -755,9 +751,6 @@ static void __debugfs_file_removed(struct dentry *dentry)
755751
if ((unsigned long)fsd & DEBUGFS_FSDATA_IS_REAL_FOPS_BIT)
756752
return;
757753

758-
lock_map_acquire(&fsd->lockdep_map);
759-
lock_map_release(&fsd->lockdep_map);
760-
761754
/* if we hit zero, just wait for all to finish */
762755
if (!refcount_dec_and_test(&fsd->active_users)) {
763756
wait_for_completion(&fsd->active_users_drained);

fs/debugfs/internal.h

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77

88
#ifndef _DEBUGFS_INTERNAL_H_
99
#define _DEBUGFS_INTERNAL_H_
10-
#include <linux/lockdep.h>
1110
#include <linux/list.h>
1211

1312
struct file_operations;
@@ -25,11 +24,6 @@ struct debugfs_fsdata {
2524
struct {
2625
refcount_t active_users;
2726
struct completion active_users_drained;
28-
#ifdef CONFIG_LOCKDEP
29-
struct lockdep_map lockdep_map;
30-
struct lock_class_key key;
31-
char *lock_name;
32-
#endif
3327

3428
/* protect cancellations */
3529
struct mutex cancellations_mtx;

0 commit comments

Comments
 (0)