lockdep: annotate proc and other filesystems
Subsystems (8)
RFC PATCH 1/1 lockdep: annotate proc and other filesystems
Using lockdep_annotate_inode_mutex_key() to annotate proc and other filesystems, resolves the lockdep messages as described in
http://www.spinics.net/lists/linux-fsdevel/msg49879.html.
Commit "e096d0c lockdep: Add helper function for dir vs file i_mutex annotation" defined lockdep_annotate_inode_mutex_key(), a helper function, but only updated hugetlbfs to call this function.
This patch annotates proc and other filesystems, which call new_inode() directly.
Signed-off-by Mimi Zohar <[email protected]>
--- fs/debugfs/inode.c | 1 + fs/devpts/inode.c | 4 +++- fs/proc/base.c | 4 ++++ fs/proc/namespaces.c | 1 + fs/proc/proc_sysctl.c | 1 + fs/ramfs/inode.c | 1 + mm/shmem.c | 1 + security/inode.c | 1 + security/selinux/selinuxfs.c | 1 + 9 files changed, 14 insertions(+), 1 deletions(-)
fs/debugfs/inode.c +1 -0
@@ -63,6 +63,7 @@ static struct inode *debugfs_get_inode(struct super_block *sb, int mode, dev_t dinc_nlink (inode);break ; } +lockdep_annotate_inode_mutex_key (inode); }return inode; }
fs/devpts/inode.c +3 -1
@@ -310,8 +310,10 @@ devpts_fill_super(struct super_block *s, void *data, int silent)set_nlink (inode,2 ); s->s_root =d_alloc_root (inode); -if (s->s_root) +if (s->s_root) { +lockdep_annotate_inode_mutex_key (inode);return 0 ; + }printk (KERN_ERR "devpts: get root dentry failed\n" );iput (inode);
fs/proc/base.c +4 -0
@@ -2259,6 +2259,7 @@ static struct dentry *proc_pident_instantiate(struct inode *dir,/* Close the race of the process dying before we return the dentry */ if (pid_revalidate (dentry,NULL )) error =NULL ; +lockdep_annotate_inode_mutex_key (inode); out:return error; }
@@ -2652,6 +2653,7 @@ static struct dentry *proc_base_instantiate(struct inode *dir, ei->op = p->op;d_add (dentry, inode); error =NULL ; +lockdep_annotate_inode_mutex_key (inode); out:return error; out_iput:
@@ -2990,6 +2992,7 @@ static struct dentry *proc_pid_instantiate(struct inode *dir,/* Close the race of the process dying before we return the dentry */ if (pid_revalidate (dentry,NULL )) error =NULL ; +lockdep_annotate_inode_mutex_key (inode); out:return error; }
@@ -3242,6 +3245,7 @@ static struct dentry *proc_task_instantiate(struct inode *dir,/* Close the race of the process dying before we return the dentry */ if (pid_revalidate (dentry,NULL )) error =NULL ; +lockdep_annotate_inode_mutex_key (inode); out:return error; }
fs/proc/namespaces.c +1 -0
@@ -59,6 +59,7 @@ static struct dentry *proc_ns_instantiate(struct inode *dir,/* Close the race of the process dying before we return the dentry */ if (pid_revalidate (dentry,NULL )) error =NULL ; +lockdep_annotate_inode_mutex_key (inode); out:return error; out_iput:
fs/proc/proc_sysctl.c +1 -0
@@ -53,6 +53,7 @@ static struct inode *proc_sys_make_inode(struct super_block *sb, inode->i_op = &proc_sys_dir_operations; inode->i_fop = &proc_sys_dir_file_operations; } +lockdep_annotate_inode_mutex_key (inode); out:return inode; }
fs/ramfs/inode.c +1 -0
@@ -83,6 +83,7 @@ struct inode *ramfs_get_inode(struct super_block *sb, inode->i_op = &page_symlink_inode_operations;break ; } +lockdep_annotate_inode_mutex_key (inode); }return inode; }
mm/shmem.c +1 -0
@@ -1144,6 +1144,7 @@ static struct inode *shmem_get_inode(struct super_block *sb, const struct inodempol_shared_policy_init (&info->policy,NULL );break ; } +lockdep_annotate_inode_mutex_key (inode); }else shmem_free_inode (sb);return inode;
security/inode.c +1 -0
@@ -79,6 +79,7 @@ static struct inode *get_inode(struct super_block *sb, int mode, dev_t dev)inc_nlink (inode);break ; } +lockdep_annotate_inode_mutex_key (inode); }return inode; }
security/selinux/selinuxfs.c +1 -0
@@ -1030,6 +1030,7 @@ static struct inode *sel_make_inode(struct super_block *sb, int mode)if (ret) { ret->i_mode = mode; ret->i_atime = ret->i_mtime = ret->i_ctime =CURRENT_TIME ; +lockdep_annotate_inode_mutex_key (ret); }return ret; }
Signature · 1 line
1.7.6.4