From: NeilBrown <neil@xxxxxxxxxx> 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". The locking rules are expected to change, so this locking will become anachronistic if we don't remove it. Signed-off-by: NeilBrown <neil@xxxxxxxxxx> --- fs/proc/self.c | 3 --- fs/proc/thread_self.c | 3 --- 2 files changed, 6 deletions(-) diff --git a/fs/proc/self.c b/fs/proc/self.c index b46fbfd22681..a2867b009269 100644 --- a/fs/proc/self.c +++ b/fs/proc/self.c @@ -35,12 +35,10 @@ static unsigned self_inum __ro_after_init; int proc_setup_self(struct super_block *s) { - struct inode *root_inode = d_inode(s->s_root); struct proc_fs_info *fs_info = proc_sb_info(s); struct dentry *self; int ret = -ENOMEM; - inode_lock(root_inode); self = d_alloc_name(s->s_root, "self"); if (self) { struct inode *inode = new_inode(s); @@ -57,7 +55,6 @@ int proc_setup_self(struct super_block *s) dput(self); } } - inode_unlock(root_inode); if (ret) pr_err("proc_fill_super: can't allocate /proc/self\n"); diff --git a/fs/proc/thread_self.c b/fs/proc/thread_self.c index 0e5050d6ab64..9c4ff2131046 100644 --- a/fs/proc/thread_self.c +++ b/fs/proc/thread_self.c @@ -35,12 +35,10 @@ static unsigned thread_self_inum __ro_after_init; int proc_setup_thread_self(struct super_block *s) { - struct inode *root_inode = d_inode(s->s_root); struct proc_fs_info *fs_info = proc_sb_info(s); struct dentry *thread_self; int ret = -ENOMEM; - inode_lock(root_inode); thread_self = d_alloc_name(s->s_root, "thread-self"); if (thread_self) { struct inode *inode = new_inode(s); @@ -57,7 +55,6 @@ int proc_setup_thread_self(struct super_block *s) dput(thread_self); } } - inode_unlock(root_inode); if (ret) pr_err("proc_fill_super: can't allocate /proc/thread-self\n"); -- 2.50.0.107.gf914562f5916.dirty