Re: [PATCH RESEND v2 21/23] proc: let lockdep check the pin

From
sashiko-bot@kernel.org
Date
2026-11-05 19:36:13
Also in
dri-devel, kexec, linux-ext4, linux-hwmon, linux-input, linux-m68k, linux-mm, linux-pci, linux-raid, linux-s390, linux-scsi, linux-serial, linux-sound, linux-usb, sparclinux
Reply to
Christian Brauner, 2026-11-04
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Low] proc: kernel-doc mismatch on __proc_create_net_single_write()
--

commit 095fce4c95ecbe25e644f1a3fe90061f695e9271
Author: Christian Brauner [off-list ref]

proc: let lockdep check the pin

This commit adds lockdep tracking to proc_dir_entry pinning so lockdep can
detect deadlocks between proc entry methods and removal under held locks.
Entries created via proc_create_single() and related helpers receive a
per-registration-site lock_class_key via wrapper macros.
quoted hunk ↗ jump to hunk
diff --git a/fs/proc/proc_net.c b/fs/proc/proc_net.c
index b78d627b024f8..9ddd7c323dfcd 100644
--- a/fs/proc/proc_net.c
+++ b/fs/proc/proc_net.c
[ ... ]
quoted hunk ↗ jump to hunk
@@ -232,11 +233,12 @@ EXPORT_SYMBOL_GPL(proc_create_net_single);
  * pde_data() on the file inode.  The network namespace must be accessed by
  * calling seq_file_single_net() on the seq_file struct.
  */
-struct proc_dir_entry *proc_create_net_single_write(const char *name, umode_t mode,
-						    struct proc_dir_entry *parent,
-						    int (*show)(struct seq_file *, void *),
-						    proc_write_t write,
-						    void *data)
+struct proc_dir_entry *__proc_create_net_single_write(const char *name, umode_t mode,
+						      struct proc_dir_entry *parent,
+						      int (*show)(struct seq_file *, void *),
+						      proc_write_t write,
+						      void *data,
+						      struct lock_class_key *key)
[Severity: Low]
When proc_create_net_single_write() in fs/proc/proc_net.c is renamed to
__proc_create_net_single_write() and given the new key parameter, the
preceding kernel-doc block still documents the old name and omits @key:

/**
 * proc_create_net_single_write - Create a writable net_ns-specific proc file
 * @name: The name of the file.
 * @mode: The file's access mode.
 * @parent: The parent directory in which to create.
 * @show: The seqfile show method with which to read the file.
 * @write: The write method with which to 'modify' the file.
 * @data: Data for retrieval by pde_data().

Should this kernel-doc comment be updated to match
__proc_create_net_single_write() and document @key (or moved to the
proc_create_net_single_write() macro in include/linux/proc_fs.h) to avoid
scripts/kernel-doc warnings when building with W=1?

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261104-work-procfs-core-v2-0-76ace653a773@kernel.org?part=21
Thread (209 messages) 209 messages, 9 authors, last reply 23d ago
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help