summaryrefslogtreecommitdiff
path: root/fs/fuse/dev.c
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2016-09-17 20:44:45 -0400
committerLuK1337 <priv.luk@gmail.com>2024-07-19 11:25:46 +0200
commit6c9ab53cd4f1f751523f75189bd118d2b30dfc4c (patch)
tree701bb84c227890aa8588acda69a9d462234e8ce0 /fs/fuse/dev.c
parent3788b8fefd8e1e62e0b8de86089f881093cf2134 (diff)
splice: lift pipe_lock out of splice_to_pipe()
* splice_to_pipe() stops at pipe overflow and does *not* take pipe_lock * ->splice_read() instances do the same * vmsplice_to_pipe() and do_splice() (ultimate callers of splice_to_pipe()) arrange for waiting, looping, etc. themselves. That should make pipe_lock the outermost one. Unfortunately, existing rules for the amount passed by vmsplice_to_pipe() and do_splice() are quite ugly _and_ userland code can be easily broken by changing those. It's not even "no more than the maximal capacity of this pipe" - it's "once we'd fed pipe->nr_buffers pages into the pipe, leave instead of waiting". Considering how poorly these rules are documented, let's try "wait for some space to appear, unless given SPLICE_F_NONBLOCK, then push into pipe and if we run into overflow, we are done". Change-Id: I700882650893824562bd2cdd3f1b1056fff8d686 Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs/fuse/dev.c')
-rw-r--r--fs/fuse/dev.c2
1 files changed, 0 insertions, 2 deletions
diff --git a/fs/fuse/dev.c b/fs/fuse/dev.c
index fc55909ce515..a5c3bc632a21 100644
--- a/fs/fuse/dev.c
+++ b/fs/fuse/dev.c
@@ -1441,7 +1441,6 @@ static ssize_t fuse_dev_splice_read(struct file *in, loff_t *ppos,
goto out;
ret = 0;
- pipe_lock(pipe);
if (!pipe->readers) {
send_sig(SIGPIPE, current, 0);
@@ -1477,7 +1476,6 @@ static ssize_t fuse_dev_splice_read(struct file *in, loff_t *ppos,
}
out_unlock:
- pipe_unlock(pipe);
if (do_wakeup) {
smp_mb();