From: Miklos Szeredi fuse_dev_poll() returned an error value instead of a poll mask. Luckily (or unluckily) -ENODEV does contain the POLLERR bit. There's also a race if filesystem is unmounted between fuse_get_conn() and spin_lock(), in which case this event will be missed by poll(). Signed-off-by: Miklos Szeredi Signed-off-by: Andrew Morton --- fs/fuse/dev.c | 11 ++++++----- 1 files changed, 6 insertions(+), 5 deletions(-) diff -puN fs/fuse/dev.c~fuse-fix-fuse_dev_poll-return-value fs/fuse/dev.c --- devel/fs/fuse/dev.c~fuse-fix-fuse_dev_poll-return-value 2006-04-01 16:22:37.000000000 -0800 +++ devel-akpm/fs/fuse/dev.c 2006-04-01 16:22:37.000000000 -0800 @@ -804,17 +804,18 @@ static ssize_t fuse_dev_write(struct fil static unsigned fuse_dev_poll(struct file *file, poll_table *wait) { - struct fuse_conn *fc = fuse_get_conn(file); unsigned mask = POLLOUT | POLLWRNORM; - + struct fuse_conn *fc = fuse_get_conn(file); if (!fc) - return -ENODEV; + return POLLERR; poll_wait(file, &fc->waitq, wait); spin_lock(&fuse_lock); - if (!list_empty(&fc->pending)) - mask |= POLLIN | POLLRDNORM; + if (!fc->connected) + mask = POLLERR; + else if (!list_empty(&fc->pending)) + mask |= POLLIN | POLLRDNORM; spin_unlock(&fuse_lock); return mask; _