diff --git a/[refs] b/[refs] index e0f29454e291..985349d20c4b 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 12f32bb31772e72d8cf52a29f961561bccc54c37 +refs/heads/master: 9e97198dbf318be7958b57900d05b37c7e09ad7c diff --git a/trunk/fs/splice.c b/trunk/fs/splice.c index 0a0b79b01d05..1577a7391d23 100644 --- a/trunk/fs/splice.c +++ b/trunk/fs/splice.c @@ -1031,7 +1031,11 @@ ssize_t splice_direct_to_actor(struct file *in, struct splice_desc *sd, goto out_release; } +done: pipe->nrbufs = pipe->curbuf = 0; + if (bytes > 0) + file_accessed(in); + return bytes; out_release: @@ -1047,16 +1051,11 @@ ssize_t splice_direct_to_actor(struct file *in, struct splice_desc *sd, buf->ops = NULL; } } - pipe->nrbufs = pipe->curbuf = 0; - - /* - * If we transferred some data, return the number of bytes: - */ - if (bytes > 0) - return bytes; - return ret; + if (!bytes) + bytes = ret; + goto done; } EXPORT_SYMBOL(splice_direct_to_actor);