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>
diff --git a/fs/proc/internal.h b/fs/proc/internal.h
index c43d536..e2fa934 100644
--- a/fs/proc/internal.h
+++ b/fs/proc/internal.h
@@ -153,6 +153,8 @@
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 *);