aboutsummaryrefslogtreecommitdiffstats
path: root/fs/proc/inode.c
diff options
context:
space:
mode:
authorAlexey Dobriyan <adobriyan@gmail.com>2007-09-11 18:23:55 -0400
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-09-11 20:21:20 -0400
commitdd23aae4f5edf4e1dbd8f7f8013a754ba3253f48 (patch)
treec7babf45f8132876e8a715f0327cf480c05c6131 /fs/proc/inode.c
parent3210f0ecdba6a81c3f8efe6f442d2e1f57db98f9 (diff)
Fix select on /proc files without ->poll
Taneli Vähäkangas <vahakang@cs.helsinki.fi> reported that commit 786d7e1612f0b0adb6046f19b906609e4fe8b1ba aka "Fix rmmod/read/write races in /proc entries" broke SBCL + SLIME combo. The old code in do_select() used DEFAULT_POLLMASK, if couldn't find ->poll handler. The new code makes ->poll always there and returns 0 by default, which is not correct. Return DEFAULT_POLLMASK instead. Steps to reproduce: install emacs, SBCL, SLIME emacs M-x slime in *inferior-lisp* buffer [watch it doing "Connecting to Swank on port X.."] Please, apply before 2.6.23. P.S.: why SBCL can't just read(2) /proc/cpuinfo is a mystery. Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com> Cc: T Taneli Vahakangas <vahakang@cs.helsinki.fi> Cc: Oleg Nesterov <oleg@tv-sign.ru> Cc: "Eric W. Biederman" <ebiederm@xmission.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'fs/proc/inode.c')
-rw-r--r--fs/proc/inode.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/fs/proc/inode.c b/fs/proc/inode.c
index a5b0dfd89a17..0e4d37c93eea 100644
--- a/fs/proc/inode.c
+++ b/fs/proc/inode.c
@@ -11,6 +11,7 @@
11#include <linux/string.h> 11#include <linux/string.h>
12#include <linux/stat.h> 12#include <linux/stat.h>
13#include <linux/completion.h> 13#include <linux/completion.h>
14#include <linux/poll.h>
14#include <linux/file.h> 15#include <linux/file.h>
15#include <linux/limits.h> 16#include <linux/limits.h>
16#include <linux/init.h> 17#include <linux/init.h>
@@ -232,7 +233,7 @@ static ssize_t proc_reg_write(struct file *file, const char __user *buf, size_t
232static unsigned int proc_reg_poll(struct file *file, struct poll_table_struct *pts) 233static unsigned int proc_reg_poll(struct file *file, struct poll_table_struct *pts)
233{ 234{
234 struct proc_dir_entry *pde = PDE(file->f_path.dentry->d_inode); 235 struct proc_dir_entry *pde = PDE(file->f_path.dentry->d_inode);
235 unsigned int rv = 0; 236 unsigned int rv = DEFAULT_POLLMASK;
236 unsigned int (*poll)(struct file *, struct poll_table_struct *); 237 unsigned int (*poll)(struct file *, struct poll_table_struct *);
237 238
238 spin_lock(&pde->pde_unload_lock); 239 spin_lock(&pde->pde_unload_lock);