All of lore.kernel.org
 help / color / mirror / Atom feed
From: David Wilder <dwilder@us.ibm.com>
To: linux-kernel@vger.kernel.org
Cc: systemtap@sources.redhat.com
Subject: [PATCH] relay-file-read-start-pos-fix.patch
Date: Sun, 17 Jun 2007 21:57:03 -0700	[thread overview]
Message-ID: <4676109F.8020202@us.ibm.com> (raw)

[-- 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;

             reply	other threads:[~2007-06-18  4:58 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-06-18  4:57 David Wilder [this message]
2007-06-19  3:43 ` [PATCH] relay-file-read-start-pos-fix.patch Masami Hiramatsu
2007-06-19  5:35   ` Tom Zanussi
2007-06-20  8:31     ` Masami Hiramatsu
2007-06-20 14:46       ` Tom Zanussi
2007-06-21 18:05       ` David Wilder
2007-06-19 16:25   ` Tom Zanussi
2007-06-20  1:22     ` Masami Hiramatsu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4676109F.8020202@us.ibm.com \
    --to=dwilder@us.ibm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=systemtap@sources.redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.