summaryrefslogtreecommitdiff
path: root/fs/fuse
diff options
context:
space:
mode:
authorTodd Poynor <toddpoynor@google.com>2011-08-24 15:01:30 -0700
committerJohn Stultz <john.stultz@linaro.org>2016-02-16 13:54:17 -0800
commitd111876c7ea15f9041c792c141fcfab5de8cf379 (patch)
treef361778e3870af85188ed5357c77b6552940f2b8 /fs/fuse
parent8f832d4ac1d40e3bf2d142a48ac8cd552ec35a74 (diff)
fuse: Freeze client on suspend when request sent to userspace
Suspend attempts can abort when the FUSE daemon is already frozen and a client is waiting uninterruptibly for a response, causing freezing of tasks to fail. Use the freeze-friendly wait API, but disregard other signals. Change-Id: Icefb7e4bbc718ccb76bf3c04daaa5eeea7e0e63c Signed-off-by: Todd Poynor <toddpoynor@google.com>
Diffstat (limited to 'fs/fuse')
-rw-r--r--fs/fuse/dev.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/fs/fuse/dev.c b/fs/fuse/dev.c
index ebb5e37455a0..175fcdeabe4c 100644
--- a/fs/fuse/dev.c
+++ b/fs/fuse/dev.c
@@ -19,6 +19,7 @@
#include <linux/pipe_fs_i.h>
#include <linux/swap.h>
#include <linux/splice.h>
+#include <linux/freezer.h>
MODULE_ALIAS_MISCDEV(FUSE_MINOR);
MODULE_ALIAS("devname:fuse");
@@ -473,7 +474,9 @@ static void request_wait_answer(struct fuse_conn *fc, struct fuse_req *req)
* Either request is already in userspace, or it was forced.
* Wait it out.
*/
- wait_event(req->waitq, test_bit(FR_FINISHED, &req->flags));
+ while (!test_bit(FR_FINISHED, &req->flags))
+ wait_event_freezable(req->waitq,
+ test_bit(FR_FINISHED, &req->flags));
}
static void __fuse_request_send(struct fuse_conn *fc, struct fuse_req *req)