Fix: remove one too many metadata refcount increment
authorDavid Goulet <dgoulet@efficios.com>
Wed, 29 May 2013 16:19:57 +0000 (12:19 -0400)
committerDavid Goulet <dgoulet@efficios.com>
Wed, 29 May 2013 16:24:44 +0000 (12:24 -0400)
The refcount increment is removed from the add metadata stream function
so for both kernel and UST, the increment is done once the stream is
allocated and the channel reference is set.

Signed-off-by: David Goulet <dgoulet@efficios.com>
src/common/consumer.c
src/common/kernel-consumer/kernel-consumer.c

index a856f030efe63c3553c820d96012b065e9817e8b..3709092198e5a9d1fcf6781134ba7e645ce3e202 100644 (file)
@@ -2019,9 +2019,6 @@ static int add_metadata_stream(struct lttng_consumer_stream *stream,
                uatomic_inc(&relayd->refcount);
        }
 
-       /* Update channel refcount once added without error(s). */
-       uatomic_inc(&stream->chan->refcount);
-
        /*
         * When nb_init_stream_left reaches 0, we don't need to trigger any action
         * in terms of destroying the associated channel, because the action that
index f47c498777531ef6702b41d34b153abba3320e1e..c0d56171c89f5224f397a347c7774d54d9d32db0 100644 (file)
@@ -255,11 +255,11 @@ int lttng_kconsumer_recv_cmd(struct lttng_consumer_local_data *ctx,
                new_stream->chan = channel;
                new_stream->wait_fd = fd;
 
-               /* Metadata chan refcount is increment in add_metadata_stream */
-               if (new_stream->chan->type != CONSUMER_CHANNEL_TYPE_METADATA) {
-                       /* Update channel refcount */
-                       uatomic_inc(&new_stream->chan->refcount);
-               }
+               /*
+                * We've just assigned the channel to the stream so increment the
+                * refcount right now.
+                */
+               uatomic_inc(&new_stream->chan->refcount);
 
                /*
                 * The buffer flush is done on the session daemon side for the kernel
This page took 0.030406 seconds and 4 git commands to generate.