From: Pierre-Marc Fournier Date: Mon, 15 Feb 2010 05:21:17 +0000 (-0500) Subject: ustd: use modulo value for first_subbuf X-Git-Tag: v0.2~11 X-Git-Url: https://git.lttng.org/?p=ust.git;a=commitdiff_plain;h=54b7447337f23516c8249065a459372b4fdd9326 ustd: use modulo value for first_subbuf This prevented crash recovery when the buffer filled. --- diff --git a/ustd/lowlevel.c b/ustd/lowlevel.c index d8d4cfa..6565749 100644 --- a/ustd/lowlevel.c +++ b/ustd/lowlevel.c @@ -91,7 +91,7 @@ void finish_consuming_dead_subbuffer(struct buffer_info *buf) } /* Iterate on subbuffers to recover. */ - for(i_subbuf=first_subbuf; ; i_subbuf++, i_subbuf %= buf->n_subbufs) { + for(i_subbuf = first_subbuf % buf->n_subbufs; ; i_subbuf++, i_subbuf %= buf->n_subbufs) { void *tmp; /* commit_seq is the offset in the buffer of the end of the last sequential commit. * Bytes beyond this limit cannot be recovered. This is a free-running counter. */