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

Julien Desfossez jdesfossez at efficios.com
Sun Aug 4 14:46:25 EDT 2013


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.

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




More information about the lttng-dev mailing list