]> git.lttng.org Git - lttng-modules.git/commitdiff
Fix: refuse overwrite mode buffers with less than two subbuffers
authorMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Fri, 23 May 2014 13:26:11 +0000 (09:26 -0400)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Fri, 23 May 2014 13:26:11 +0000 (09:26 -0400)
Fixes #793

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
lib/ringbuffer/ring_buffer_backend.c

index f7ed20df19869b767fd23f568c87e5831956ead2..3cc22d77b2d9ad5c2ed428fed783b9055a5f97d3 100644 (file)
@@ -331,6 +331,12 @@ int channel_backend_init(struct channel_backend *chanb,
                return -EINVAL;
        if (!num_subbuf || (num_subbuf & (num_subbuf - 1)))
                return -EINVAL;
+       /*
+        * Overwrite mode buffers require at least 2 subbuffers per
+        * buffer.
+        */
+       if (config->mode == RING_BUFFER_OVERWRITE && num_subbuf < 2)
+               return -EINVAL;
 
        ret = subbuffer_id_check_index(config, num_subbuf);
        if (ret)
This page took 0.031228 seconds and 4 git commands to generate.