diff options
author | Miklos Szeredi <mszeredi@suse.cz> | 2015-07-01 14:25:57 (GMT) |
---|---|---|
committer | Miklos Szeredi <mszeredi@suse.cz> | 2015-07-01 14:25:57 (GMT) |
commit | de15522646b9822d82b613d84cfeb4482370db3d (patch) | |
tree | 3a34f4b9ccecfbe873a51687522dee80ce3432c9 /fs/fuse | |
parent | 5437f2417225dc89c785867f4790012668006abc (diff) | |
download | linux-de15522646b9822d82b613d84cfeb4482370db3d.tar.xz |
fuse: check conn_error earlier
fc->conn_error is set once in FUSE_INIT reply and never cleared. Check it
in request allocation, there's no sense in doing all the preparation if
sending will surely fail.
Signed-off-by: Miklos Szeredi <mszeredi@suse.cz>
Reviewed-by: Ashish Samant <ashish.samant@oracle.com>
Diffstat (limited to 'fs/fuse')
-rw-r--r-- | fs/fuse/dev.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/fs/fuse/dev.c b/fs/fuse/dev.c index 9e0ed3e..155610f 100644 --- a/fs/fuse/dev.c +++ b/fs/fuse/dev.c @@ -168,6 +168,10 @@ static struct fuse_req *__fuse_get_req(struct fuse_conn *fc, unsigned npages, if (!fc->connected) goto out; + err = -ECONNREFUSED; + if (fc->conn_error) + goto out; + req = fuse_request_alloc(npages); err = -ENOMEM; if (!req) { @@ -498,8 +502,6 @@ static void __fuse_request_send(struct fuse_conn *fc, struct fuse_req *req) spin_lock(&fc->lock); if (!fc->connected) req->out.h.error = -ENOTCONN; - else if (fc->conn_error) - req->out.h.error = -ECONNREFUSED; else { req->in.h.unique = fuse_get_unique(fc); queue_request(fc, req); |