diff options
author | Bryan Green <bryan@grid-net.com> | 2011-03-02 01:43:52 +0100 |
---|---|---|
committer | Miklos Szeredi <mszeredi@suse.cz> | 2011-03-21 13:58:05 +0100 |
commit | 357ccf2b69bcefa650a54db83702381d1c9d6959 (patch) | |
tree | 0bbcbb308b0a28a489d38177a4ad7b84b1ae36d5 /fs/fuse/dev.c | |
parent | fuse: reduce size of struct fuse_request (diff) | |
download | linux-357ccf2b69bcefa650a54db83702381d1c9d6959.tar.xz linux-357ccf2b69bcefa650a54db83702381d1c9d6959.zip |
fuse: wakeup pollers on connection release/abort
If a fuse dev connection is broken, wake up any
processes that are blocking, in a poll system call,
on one of the files in the now defunct filesystem.
Signed-off-by: Miklos Szeredi <mszeredi@suse.cz>
Diffstat (limited to 'fs/fuse/dev.c')
-rw-r--r-- | fs/fuse/dev.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/fs/fuse/dev.c b/fs/fuse/dev.c index cf8d28d1fbad..213d3cf4f5e9 100644 --- a/fs/fuse/dev.c +++ b/fs/fuse/dev.c @@ -1910,6 +1910,21 @@ __acquires(fc->lock) kfree(dequeue_forget(fc, 1, NULL)); } +static void end_polls(struct fuse_conn *fc) +{ + struct rb_node *p; + + p = rb_first(&fc->polled_files); + + while (p) { + struct fuse_file *ff; + ff = rb_entry(p, struct fuse_file, polled_node); + wake_up_interruptible_all(&ff->poll_wait); + + p = rb_next(p); + } +} + /* * Abort all requests. * @@ -1937,6 +1952,7 @@ void fuse_abort_conn(struct fuse_conn *fc) fc->blocked = 0; end_io_requests(fc); end_queued_requests(fc); + end_polls(fc); wake_up_all(&fc->waitq); wake_up_all(&fc->blocked_waitq); kill_fasync(&fc->fasync, SIGIO, POLL_IN); @@ -1953,6 +1969,7 @@ int fuse_dev_release(struct inode *inode, struct file *file) fc->connected = 0; fc->blocked = 0; end_queued_requests(fc); + end_polls(fc); wake_up_all(&fc->blocked_waitq); spin_unlock(&fc->lock); fuse_conn_put(fc); |