public inbox for systemtap@sourceware.org
 help / color / mirror / Atom feed
* [PATCH] relay-file-read-start-pos-fix.patch
@ 2007-06-18  4:57 David Wilder
  2007-06-19  3:44 ` Masami Hiramatsu
  0 siblings, 1 reply; 8+ messages in thread
From: David Wilder @ 2007-06-18  4:57 UTC (permalink / raw)
  To: linux-kernel; +Cc: systemtap

[-- Attachment #1: Type: text/plain, Size: 104 bytes --]


-- 
David Wilder
IBM Linux Technology Center
Beaverton, Oregon, USA 
dwilder@us.ibm.com
(503)578-3789


[-- Attachment #2: relay-file-read-start-pos-fix.patch --]
[-- Type: text/x-patch, Size: 907 bytes --]

This patch fixes a bug in the relay read interface causing the number
of consumed bytes to be set incorrectly. 

Signed-off-by: Tom Zanussi <zanussi@us.ibm.com>
Signed-off-by: David Wilder <dwilder@us.ibm.com>

 kernel/relay.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/kernel/relay.c b/kernel/relay.c
index 4311101..e61156e 100644
--- 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;

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2007-06-21 18:06 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-06-18  4:57 [PATCH] relay-file-read-start-pos-fix.patch David Wilder
2007-06-19  3:44 ` Masami Hiramatsu
2007-06-19  5:36   ` Tom Zanussi
2007-06-20  8:32     ` Masami Hiramatsu
2007-06-20 14:52       ` Tom Zanussi
2007-06-21 18:06       ` David Wilder
2007-06-19 16:27   ` Tom Zanussi
2007-06-20  1:22     ` Masami Hiramatsu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).