diff options
-rw-r--r-- | fs/fuse/dev.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/fs/fuse/dev.c b/fs/fuse/dev.c index 23d1f52eb1b8..b2e8613a26d8 100644 --- a/fs/fuse/dev.c +++ b/fs/fuse/dev.c | |||
@@ -804,17 +804,18 @@ static ssize_t fuse_dev_write(struct file *file, const char __user *buf, | |||
804 | 804 | ||
805 | static unsigned fuse_dev_poll(struct file *file, poll_table *wait) | 805 | static unsigned fuse_dev_poll(struct file *file, poll_table *wait) |
806 | { | 806 | { |
807 | struct fuse_conn *fc = fuse_get_conn(file); | ||
808 | unsigned mask = POLLOUT | POLLWRNORM; | 807 | unsigned mask = POLLOUT | POLLWRNORM; |
809 | 808 | struct fuse_conn *fc = fuse_get_conn(file); | |
810 | if (!fc) | 809 | if (!fc) |
811 | return -ENODEV; | 810 | return POLLERR; |
812 | 811 | ||
813 | poll_wait(file, &fc->waitq, wait); | 812 | poll_wait(file, &fc->waitq, wait); |
814 | 813 | ||
815 | spin_lock(&fuse_lock); | 814 | spin_lock(&fuse_lock); |
816 | if (!list_empty(&fc->pending)) | 815 | if (!fc->connected) |
817 | mask |= POLLIN | POLLRDNORM; | 816 | mask = POLLERR; |
817 | else if (!list_empty(&fc->pending)) | ||
818 | mask |= POLLIN | POLLRDNORM; | ||
818 | spin_unlock(&fuse_lock); | 819 | spin_unlock(&fuse_lock); |
819 | 820 | ||
820 | return mask; | 821 | return mask; |