Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1528534
| From | Al Viro <viro@ZenIV.linux.org.uk> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | Re: sendfile from 9p fs into af_alg |
| Date | 2016-11-23 17:00 +0100 |
| Message-ID | <sGI7M-6KY-17@gated-at.bofh.it> (permalink) |
| References | <sGwT0-7XV-1@gated-at.bofh.it> <sGxFn-8vk-11@gated-at.bofh.it> <sGxP3-6N-3@gated-at.bofh.it> <sGz4t-1dH-11@gated-at.bofh.it> <sGBzk-2Bt-15@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
On Wed, Nov 23, 2016 at 12:58:11AM -0800, Alexei Starovoitov wrote:
> if I read it correctly 9p actually responded with 8192 bytes of requests...
> whereas the file size was 9624.
> For large file sizes (in megabytes) the difference between what
> sendfile is reporting and actual file size can be 3x.
> In the small file case (like above dump) it looks rounded to page size for some reason.
OK, I think I see one bug in there; could you check if this gets it back to
normal?
diff --git a/fs/splice.c b/fs/splice.c
index dcaf185..5a7750b 100644
--- a/fs/splice.c
+++ b/fs/splice.c
@@ -408,7 +408,8 @@ static ssize_t default_file_splice_read(struct file *in, loff_t *ppos,
if (res <= 0)
return -ENOMEM;
- nr_pages = res / PAGE_SIZE;
+ BUG_ON(dummy);
+ nr_pages = DIV_ROUND_UP(res, PAGE_SIZE);
vec = __vec;
if (nr_pages > PIPE_DEF_BUFFERS) {
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
sendfile from 9p fs into af_alg Alexei Starovoitov <alexei.starovoitov@gmail.com> - 2016-11-23 05:00 +0100
Re: sendfile from 9p fs into af_alg Al Viro <viro@ZenIV.linux.org.uk> - 2016-11-23 05:50 +0100
Re: sendfile from 9p fs into af_alg Alexei Starovoitov <alexei.starovoitov@gmail.com> - 2016-11-23 06:00 +0100
Re: sendfile from 9p fs into af_alg Al Viro <viro@ZenIV.linux.org.uk> - 2016-11-23 07:20 +0100
Re: sendfile from 9p fs into af_alg Alexei Starovoitov <alexei.starovoitov@gmail.com> - 2016-11-23 10:00 +0100
Re: sendfile from 9p fs into af_alg Al Viro <viro@ZenIV.linux.org.uk> - 2016-11-23 17:00 +0100
Re: sendfile from 9p fs into af_alg Alexei Starovoitov <alexei.starovoitov@gmail.com> - 2016-11-23 17:40 +0100
csiph-web