projects
/
openwrt
/
staging
/
blogic.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
ea7fc33
)
relay file read: start-pos fix
author
David Wilder
<
[email protected]
>
Wed, 27 Jun 2007 21:10:03 +0000
(14:10 -0700)
committer
Linus Torvalds
<
[email protected]
>
Thu, 28 Jun 2007 18:34:54 +0000
(11:34 -0700)
Fix a bug in the relay read interface causing the number of consumed bytes
to be set incorrectly.
Signed-off-by: Tom Zanussi <
[email protected]
>
Signed-off-by: David Wilder <
[email protected]
>
Cc: Masami Hiramatsu <
[email protected]
>
Signed-off-by: Andrew Morton <
[email protected]
>
Signed-off-by: Linus Torvalds <
[email protected]
>
kernel/relay.c
patch
|
blob
|
history
diff --git
a/kernel/relay.c
b/kernel/relay.c
index 4311101b0ca75a46206a2e9a50f82bffd5683fa5..e61156ea4e2522c6ffdaf1dfdfc0c4b892c17d8d 100644
(file)
--- a/
kernel/relay.c
+++ b/
kernel/relay.c
@@
-899,7
+899,10
@@
static size_t relay_file_read_start_pos(size_t read_pos,
size_t read_subbuf, padding, padding_start, padding_end;
size_t subbuf_size = buf->chan->subbuf_size;
size_t n_subbufs = buf->chan->n_subbufs;
+ size_t consumed = buf->subbufs_consumed % n_subbufs;
+ if (!read_pos)
+ read_pos = consumed * subbuf_size + buf->bytes_consumed;
read_subbuf = read_pos / subbuf_size;
padding = buf->padding[read_subbuf];
padding_start = (read_subbuf + 1) * subbuf_size - padding;