From: David Goulet Date: Fri, 23 May 2014 14:57:37 +0000 (-0400) Subject: Fix: deny overwrite mode and num subbuf less than 2 X-Git-Url: https://git.lttng.org/?p=lttng-tools.git;a=commitdiff_plain;h=1124da525fd5271809172a9820029ae4a8821ccf Fix: deny overwrite mode and num subbuf less than 2 Also fixed in UST and modules with commit: (modules) 5140d2b3070f211e6d8a0ad7cb0a190e8b6f3e28 (ust) 3d8e9399b2fb9000b3b55e488a7d04184b5bb56e Fixes #793 Signed-off-by: David Goulet --- diff --git a/src/bin/lttng-sessiond/cmd.c b/src/bin/lttng-sessiond/cmd.c index 339a7659e..9ef9686bd 100644 --- a/src/bin/lttng-sessiond/cmd.c +++ b/src/bin/lttng-sessiond/cmd.c @@ -850,6 +850,16 @@ int cmd_enable_channel(struct ltt_session *session, rcu_read_lock(); + /* + * The ringbuffer (both in user space and kernel) behave badly in overwrite + * mode and with less than 2 subbuf so block it right away and send back an + * invalid attribute error. + */ + if (attr->attr.overwrite && attr->attr.num_subbuf < 2) { + ret = LTTNG_ERR_INVALID; + goto error; + } + switch (domain->type) { case LTTNG_DOMAIN_KERNEL: {