deal with races between remove_proc_entry() and proc_reg_release()

* serialize the call of ->release() on per-pdeo mutex
* don't remove pdeo from per-pde list until we are through with it

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
This commit is contained in:
Al Viro
2013-04-03 19:57:00 -04:00
parent 866ad9a747
commit ca469f35a8
2 changed files with 34 additions and 53 deletions

View File

@@ -153,6 +153,8 @@ int proc_readdir_de(struct proc_dir_entry *de, struct file *filp, void *dirent,
struct pde_opener {
struct file *file;
struct list_head lh;
int count; /* number of threads in close_pdeo() */
struct mutex mutex;
};
ssize_t __proc_file_read(struct file *, char __user *, size_t, loff_t *);