ustd: use modulo value for first_subbuf
authorPierre-Marc Fournier <pierre-marc.fournier@polymtl.ca>
Mon, 15 Feb 2010 05:21:17 +0000 (00:21 -0500)
committerPierre-Marc Fournier <pierre-marc.fournier@polymtl.ca>
Mon, 15 Feb 2010 05:40:37 +0000 (00:40 -0500)
This prevented crash recovery when the buffer filled.

ustd/lowlevel.c

index d8d4cfa32c80cc83c1f11d456d24016ac6365289..65657490d6044d13ce3aa31aa1797d7637aab3ef 100644 (file)
@@ -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. */
This page took 0.023536 seconds and 4 git commands to generate.