]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
fs/proc: Don't lock root inode when creating "self" and "thread-self"
authorNeilBrown <neil@brown.name>
Tue, 24 Feb 2026 22:16:47 +0000 (09:16 +1100)
committerChristian Brauner <brauner@kernel.org>
Fri, 6 Mar 2026 09:24:11 +0000 (10:24 +0100)
commit9ab68389843a434d7d49e2a986ebf6d01d81ae42
tree63aa3d3b71787e4be966195b37ce138b24bceb07
parentc025a53314127b8cd236201bed765be0df5cf1eb
fs/proc: Don't lock root inode when creating "self" and "thread-self"

proc_setup_self() and proc_setup_thread_self() are only called from
proc_fill_super() which is before the filesystem is "live".  So there is
no need to lock the root directory when adding "self" and "thread-self".
This is clear from simple_fill_super() which provides similar
functionality for other filesystems and does not lock anything.

The locking is not harmful, except that it may be confusing to a reader.
As part of an effort to centralise all locking for directories for
name-based operations (prior to changing some locking rules), it is
simplest to remove the locking here.

Reviewed-by: Jeff Layton <jlayton@kernel.org>
Signed-off-by: NeilBrown <neil@brown.name>
Link: https://patch.msgid.link/20260224222542.3458677-3-neilb@ownmail.net
Signed-off-by: Christian Brauner <brauner@kernel.org>
fs/proc/self.c
fs/proc/thread_self.c