summaryrefslogtreecommitdiff
path: root/fs/fuse/dev.c
diff options
context:
space:
mode:
authorMiklos Szeredi <mszeredi@suse.cz>2015-07-01 16:26:04 +0200
committerMiklos Szeredi <mszeredi@suse.cz>2015-07-01 16:26:04 +0200
commite96edd94d0887707fc41c5d21d5b488edcd31689 (patch)
treeeba934e52d1c1155590b116a9561560273ce411d /fs/fuse/dev.c
parent3a2b5b9cd9610f789f5e5f91a010d9fa3ca78632 (diff)
downloadlwn-e96edd94d0887707fc41c5d21d5b488edcd31689.tar.gz
lwn-e96edd94d0887707fc41c5d21d5b488edcd31689.zip
fuse: duplicate ->connected in pqueue
This will allow checking ->connected just with the processing queue lock. Signed-off-by: Miklos Szeredi <mszeredi@suse.cz> Reviewed-by: Ashish Samant <ashish.samant@oracle.com>
Diffstat (limited to 'fs/fuse/dev.c')
-rw-r--r--fs/fuse/dev.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/fs/fuse/dev.c b/fs/fuse/dev.c
index 0fae2a7ded77..6321d761c3c3 100644
--- a/fs/fuse/dev.c
+++ b/fs/fuse/dev.c
@@ -1303,7 +1303,7 @@ static ssize_t fuse_dev_do_read(struct fuse_conn *fc, struct file *file,
fuse_copy_finish(cs);
spin_lock(&fc->lock);
clear_bit(FR_LOCKED, &req->flags);
- if (!fc->connected) {
+ if (!fpq->connected) {
request_end(fc, req);
return -ENODEV;
}
@@ -1891,7 +1891,7 @@ static ssize_t fuse_dev_do_write(struct fuse_conn *fc,
spin_lock(&fc->lock);
err = -ENOENT;
- if (!fc->connected)
+ if (!fpq->connected)
goto err_unlock;
req = request_find(fpq, oh.unique);
@@ -1928,7 +1928,7 @@ static ssize_t fuse_dev_do_write(struct fuse_conn *fc,
spin_lock(&fc->lock);
clear_bit(FR_LOCKED, &req->flags);
- if (!fc->connected)
+ if (!fpq->connected)
err = -ENOENT;
else if (err)
req->out.h.error = -EIO;
@@ -2125,6 +2125,7 @@ void fuse_abort_conn(struct fuse_conn *fc)
fc->connected = 0;
fc->blocked = 0;
fuse_set_initialized(fc);
+ fpq->connected = 0;
list_for_each_entry_safe(req, next, &fpq->io, list) {
req->out.h.error = -ECONNABORTED;
spin_lock(&req->waitq.lock);