[lttng-dev] [LTTNG-TOOLS 2.3 PATCH 1/2] Fix: return code of get_subbuff on metadata stream

Mathieu Desnoyers mathieu.desnoyers at efficios.com
Sun Aug 4 16:34:12 EDT 2013


* Julien Desfossez (jdesfossez at efficios.com) wrote:
> If no metadata is available on the kernel metadata stream when we
> do a get_subbuff, the kernel returns -EPERM, the consumer was not
> checking for this return code and closed the stream prematurely. It
> worked if no new metadata was added during the session.

Is the proper fix to change lttng-tools or lttng-modules ?

I would rather think that lttng-modules should return -ENODATA rather
than -EPERM in this case. It's clearly not a permission issue.

Thoughts ?

Thanks,

Mathieu

> 
> Signed-off-by: Julien Desfossez <jdesfossez at efficios.com>
> ---
>  src/common/consumer.c |    3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/src/common/consumer.c b/src/common/consumer.c
> index 4b657f3..a070f36 100644
> --- a/src/common/consumer.c
> +++ b/src/common/consumer.c
> @@ -2288,7 +2288,8 @@ restart:
>  				} while (len > 0);
>  
>  				/* It's ok to have an unavailable sub-buffer */
> -				if (len < 0 && len != -EAGAIN && len != -ENODATA) {
> +				if (len < 0 && len != -EAGAIN && len != -ENODATA &&
> +						len != -EPERM) {
>  					/* Clean up stream from consumer and free it. */
>  					lttng_poll_del(&events, stream->wait_fd);
>  					consumer_del_metadata_stream(stream, metadata_ht);
> -- 
> 1.7.10.4
> 

-- 
Mathieu Desnoyers
EfficiOS Inc.
http://www.efficios.com



More information about the lttng-dev mailing list