aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--fs/fuse/dev.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/fs/fuse/dev.c b/fs/fuse/dev.c
index 24f1d77b87a4..9e0ed3e714cb 100644
--- a/fs/fuse/dev.c
+++ b/fs/fuse/dev.c
@@ -327,10 +327,6 @@ static void queue_request(struct fuse_conn *fc, struct fuse_req *req)
len_args(req->in.numargs, (struct fuse_arg *) req->in.args);
list_add_tail(&req->list, &fc->pending);
req->state = FUSE_REQ_PENDING;
- if (!req->waiting) {
- req->waiting = 1;
- atomic_inc(&fc->num_waiting);
- }
wake_up(&fc->waitq);
kill_fasync(&fc->fasync, SIGIO, POLL_IN);
}
@@ -519,6 +515,10 @@ static void __fuse_request_send(struct fuse_conn *fc, struct fuse_req *req)
void fuse_request_send(struct fuse_conn *fc, struct fuse_req *req)
{
req->isreply = 1;
+ if (!req->waiting) {
+ req->waiting = 1;
+ atomic_inc(&fc->num_waiting);
+ }
__fuse_request_send(fc, req);
}
EXPORT_SYMBOL_GPL(fuse_request_send);
@@ -592,6 +592,10 @@ static void fuse_request_send_nowait_locked(struct fuse_conn *fc,
struct fuse_req *req)
{
BUG_ON(!req->background);
+ if (!req->waiting) {
+ req->waiting = 1;
+ atomic_inc(&fc->num_waiting);
+ }
fc->num_background++;
if (fc->num_background == fc->max_background)
fc->blocked = 1;