mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-08-25 02:09:42 +00:00
fuse: no fc->lock for pqueue parts
Remove fc->lock protection from processing queue members, now protected by fpq->lock. Signed-off-by: Miklos Szeredi <mszeredi@suse.cz> Reviewed-by: Ashish Samant <ashish.samant@oracle.com>
This commit is contained in:
parent
efe2800fac
commit
46c34a348b
1 changed files with 2 additions and 14 deletions
|
@ -1277,7 +1277,6 @@ static ssize_t fuse_dev_do_read(struct fuse_conn *fc, struct file *file,
|
||||||
list_del_init(&req->list);
|
list_del_init(&req->list);
|
||||||
spin_unlock(&fiq->waitq.lock);
|
spin_unlock(&fiq->waitq.lock);
|
||||||
|
|
||||||
spin_lock(&fc->lock);
|
|
||||||
in = &req->in;
|
in = &req->in;
|
||||||
reqsize = in->h.len;
|
reqsize = in->h.len;
|
||||||
/* If request is too large, reply with an error and restart the read */
|
/* If request is too large, reply with an error and restart the read */
|
||||||
|
@ -1286,21 +1285,18 @@ static ssize_t fuse_dev_do_read(struct fuse_conn *fc, struct file *file,
|
||||||
/* SETXATTR is special, since it may contain too large data */
|
/* SETXATTR is special, since it may contain too large data */
|
||||||
if (in->h.opcode == FUSE_SETXATTR)
|
if (in->h.opcode == FUSE_SETXATTR)
|
||||||
req->out.h.error = -E2BIG;
|
req->out.h.error = -E2BIG;
|
||||||
spin_unlock(&fc->lock);
|
|
||||||
request_end(fc, req);
|
request_end(fc, req);
|
||||||
goto restart;
|
goto restart;
|
||||||
}
|
}
|
||||||
spin_lock(&fpq->lock);
|
spin_lock(&fpq->lock);
|
||||||
list_add(&req->list, &fpq->io);
|
list_add(&req->list, &fpq->io);
|
||||||
spin_unlock(&fpq->lock);
|
spin_unlock(&fpq->lock);
|
||||||
spin_unlock(&fc->lock);
|
|
||||||
cs->req = req;
|
cs->req = req;
|
||||||
err = fuse_copy_one(cs, &in->h, sizeof(in->h));
|
err = fuse_copy_one(cs, &in->h, sizeof(in->h));
|
||||||
if (!err)
|
if (!err)
|
||||||
err = fuse_copy_args(cs, in->numargs, in->argpages,
|
err = fuse_copy_args(cs, in->numargs, in->argpages,
|
||||||
(struct fuse_arg *) in->args, 0);
|
(struct fuse_arg *) in->args, 0);
|
||||||
fuse_copy_finish(cs);
|
fuse_copy_finish(cs);
|
||||||
spin_lock(&fc->lock);
|
|
||||||
spin_lock(&fpq->lock);
|
spin_lock(&fpq->lock);
|
||||||
clear_bit(FR_LOCKED, &req->flags);
|
clear_bit(FR_LOCKED, &req->flags);
|
||||||
if (!fpq->connected) {
|
if (!fpq->connected) {
|
||||||
|
@ -1322,7 +1318,6 @@ static ssize_t fuse_dev_do_read(struct fuse_conn *fc, struct file *file,
|
||||||
smp_mb__after_atomic();
|
smp_mb__after_atomic();
|
||||||
if (test_bit(FR_INTERRUPTED, &req->flags))
|
if (test_bit(FR_INTERRUPTED, &req->flags))
|
||||||
queue_interrupt(fiq, req);
|
queue_interrupt(fiq, req);
|
||||||
spin_unlock(&fc->lock);
|
|
||||||
|
|
||||||
return reqsize;
|
return reqsize;
|
||||||
|
|
||||||
|
@ -1330,7 +1325,6 @@ static ssize_t fuse_dev_do_read(struct fuse_conn *fc, struct file *file,
|
||||||
if (!test_bit(FR_PRIVATE, &req->flags))
|
if (!test_bit(FR_PRIVATE, &req->flags))
|
||||||
list_del_init(&req->list);
|
list_del_init(&req->list);
|
||||||
spin_unlock(&fpq->lock);
|
spin_unlock(&fpq->lock);
|
||||||
spin_unlock(&fc->lock);
|
|
||||||
request_end(fc, req);
|
request_end(fc, req);
|
||||||
return err;
|
return err;
|
||||||
|
|
||||||
|
@ -1898,7 +1892,6 @@ static ssize_t fuse_dev_do_write(struct fuse_conn *fc,
|
||||||
if (oh.error <= -1000 || oh.error > 0)
|
if (oh.error <= -1000 || oh.error > 0)
|
||||||
goto err_finish;
|
goto err_finish;
|
||||||
|
|
||||||
spin_lock(&fc->lock);
|
|
||||||
spin_lock(&fpq->lock);
|
spin_lock(&fpq->lock);
|
||||||
err = -ENOENT;
|
err = -ENOENT;
|
||||||
if (!fpq->connected)
|
if (!fpq->connected)
|
||||||
|
@ -1914,14 +1907,13 @@ static ssize_t fuse_dev_do_write(struct fuse_conn *fc,
|
||||||
|
|
||||||
err = -EINVAL;
|
err = -EINVAL;
|
||||||
if (nbytes != sizeof(struct fuse_out_header))
|
if (nbytes != sizeof(struct fuse_out_header))
|
||||||
goto err_unlock;
|
goto err_finish;
|
||||||
|
|
||||||
if (oh.error == -ENOSYS)
|
if (oh.error == -ENOSYS)
|
||||||
fc->no_interrupt = 1;
|
fc->no_interrupt = 1;
|
||||||
else if (oh.error == -EAGAIN)
|
else if (oh.error == -EAGAIN)
|
||||||
queue_interrupt(&fc->iq, req);
|
queue_interrupt(&fc->iq, req);
|
||||||
|
|
||||||
spin_unlock(&fc->lock);
|
|
||||||
fuse_copy_finish(cs);
|
fuse_copy_finish(cs);
|
||||||
return nbytes;
|
return nbytes;
|
||||||
}
|
}
|
||||||
|
@ -1934,12 +1926,10 @@ static ssize_t fuse_dev_do_write(struct fuse_conn *fc,
|
||||||
cs->req = req;
|
cs->req = req;
|
||||||
if (!req->out.page_replace)
|
if (!req->out.page_replace)
|
||||||
cs->move_pages = 0;
|
cs->move_pages = 0;
|
||||||
spin_unlock(&fc->lock);
|
|
||||||
|
|
||||||
err = copy_out_args(cs, &req->out, nbytes);
|
err = copy_out_args(cs, &req->out, nbytes);
|
||||||
fuse_copy_finish(cs);
|
fuse_copy_finish(cs);
|
||||||
|
|
||||||
spin_lock(&fc->lock);
|
|
||||||
spin_lock(&fpq->lock);
|
spin_lock(&fpq->lock);
|
||||||
clear_bit(FR_LOCKED, &req->flags);
|
clear_bit(FR_LOCKED, &req->flags);
|
||||||
if (!fpq->connected)
|
if (!fpq->connected)
|
||||||
|
@ -1949,15 +1939,13 @@ static ssize_t fuse_dev_do_write(struct fuse_conn *fc,
|
||||||
if (!test_bit(FR_PRIVATE, &req->flags))
|
if (!test_bit(FR_PRIVATE, &req->flags))
|
||||||
list_del_init(&req->list);
|
list_del_init(&req->list);
|
||||||
spin_unlock(&fpq->lock);
|
spin_unlock(&fpq->lock);
|
||||||
spin_unlock(&fc->lock);
|
|
||||||
request_end(fc, req);
|
request_end(fc, req);
|
||||||
|
|
||||||
return err ? err : nbytes;
|
return err ? err : nbytes;
|
||||||
|
|
||||||
err_unlock_pq:
|
err_unlock_pq:
|
||||||
spin_unlock(&fpq->lock);
|
spin_unlock(&fpq->lock);
|
||||||
err_unlock:
|
|
||||||
spin_unlock(&fc->lock);
|
|
||||||
err_finish:
|
err_finish:
|
||||||
fuse_copy_finish(cs);
|
fuse_copy_finish(cs);
|
||||||
return err;
|
return err;
|
||||||
|
|
Loading…
Reference in a new issue