All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
To: Julien Desfossez <jdesfossez@efficios.com>
Cc: lttng-dev@lists.lttng.org
Subject: Re: [LTTNG-TOOLS 2.3 PATCH 1/2] Fix: return code of get_subbuff on	metadata stream
Date: Sun, 4 Aug 2013 16:34:12 -0400	[thread overview]
Message-ID: <20130804203411.GA28914__32716.6013922126$1375648508$gmane$org@Krystal> (raw)
In-Reply-To: <1375641986-2278-1-git-send-email-jdesfossez@efficios.com>

* Julien Desfossez (jdesfossez@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@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

  parent reply	other threads:[~2013-08-04 20:34 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <1375641986-2278-1-git-send-email-jdesfossez@efficios.com>
2013-08-04 18:46 ` [LTTNG-TOOLS 2.3 PATCH 2/2] Test: enable kernel events after start Julien Desfossez
2013-08-04 20:34 ` Mathieu Desnoyers [this message]
     [not found] <1375716439-24407-1-git-send-email-jdesfossez@efficios.com>
2013-08-05 19:06 ` [LTTNG-TOOLS 2.3 PATCH 1/2] Fix: return code of get_subbuff on metadata stream Mathieu Desnoyers
2013-08-05 15:27 Julien Desfossez
  -- strict thread matches above, loose matches on Subject: below --
2013-08-04 18:46 Julien Desfossez

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='20130804203411.GA28914__32716.6013922126$1375648508$gmane$org@Krystal' \
    --to=mathieu.desnoyers@efficios.com \
    --cc=jdesfossez@efficios.com \
    --cc=lttng-dev@lists.lttng.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.