diff options
author | Miklos Szeredi <mszeredi@suse.cz> | 2015-07-01 17:26:06 +0300 |
---|---|---|
committer | Miklos Szeredi <mszeredi@suse.cz> | 2015-07-01 17:26:06 +0300 |
commit | 77cd9d488b32d19be852ad4d310ef13701557d61 (patch) | |
tree | 2bfe433ce2aaff445860eaf9bd009464ecafa2a3 /fs/fuse/dev.c | |
parent | 45a91cb1a4fd9bb0e53c95e3dc9185dd5b5ba245 (diff) | |
download | linux-77cd9d488b32d19be852ad4d310ef13701557d61.tar.xz |
fuse: add req flag for private list
When an unlocked request is aborted, it is moved from fpq->io to a private
list. Then, after unlocking fpq->lock, the private list is processed and
the requests are finished off.
To protect the private list, we need to mark the request with a flag, so if
in the meantime the request is unlocked the list is not corrupted.
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.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/fs/fuse/dev.c b/fs/fuse/dev.c index 32e0e74e8f4d..7f37e55edc0e 100644 --- a/fs/fuse/dev.c +++ b/fs/fuse/dev.c @@ -1328,7 +1328,8 @@ static ssize_t fuse_dev_do_read(struct fuse_conn *fc, struct file *file, return reqsize; out_end: - list_del_init(&req->list); + if (!test_bit(FR_PRIVATE, &req->flags)) + list_del_init(&req->list); spin_unlock(&fpq->lock); request_end(fc, req); return err; @@ -1945,7 +1946,8 @@ static ssize_t fuse_dev_do_write(struct fuse_conn *fc, err = -ENOENT; else if (err) req->out.h.error = -EIO; - list_del_init(&req->list); + if (!test_bit(FR_PRIVATE, &req->flags)) + list_del_init(&req->list); spin_unlock(&fpq->lock); request_end(fc, req); @@ -2149,8 +2151,10 @@ void fuse_abort_conn(struct fuse_conn *fc) req->out.h.error = -ECONNABORTED; spin_lock(&req->waitq.lock); set_bit(FR_ABORTED, &req->flags); - if (!test_bit(FR_LOCKED, &req->flags)) + if (!test_bit(FR_LOCKED, &req->flags)) { + set_bit(FR_PRIVATE, &req->flags); list_move(&req->list, &to_end1); + } spin_unlock(&req->waitq.lock); } list_splice_init(&fpq->processing, &to_end2); |