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: v1.9.1~734 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=54b7447337f23516c8249065a459372b4fdd9326;p=lttng-ust.git 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 d8d4cfa3..65657490 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. */