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 <[email protected]>
---
 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


_______________________________________________
lttng-dev mailing list
[email protected]
http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev

Reply via email to