projects
/
lttng-tools.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fix: add missing buffer registry cleanup on error
[lttng-tools.git]
/
src
/
bin
/
lttng-sessiond
/
consumer.c
diff --git
a/src/bin/lttng-sessiond/consumer.c
b/src/bin/lttng-sessiond/consumer.c
index 0cf43d2ca3da002ffb7d68aef558316c75b9006a..245fda5628d42c707ee4097e5757e143ffbfb32a 100644
(file)
--- a/
src/bin/lttng-sessiond/consumer.c
+++ b/
src/bin/lttng-sessiond/consumer.c
@@
-407,6
+407,8
@@
error:
/*
* Delete the consumer_output object from the list and free the ptr.
/*
* Delete the consumer_output object from the list and free the ptr.
+ *
+ * Should *NOT* be called with RCU read-side lock held.
*/
void consumer_destroy_output(struct consumer_output *obj)
{
*/
void consumer_destroy_output(struct consumer_output *obj)
{
@@
-434,6
+436,8
@@
void consumer_destroy_output(struct consumer_output *obj)
/*
* Copy consumer output and returned the newly allocated copy.
/*
* Copy consumer output and returned the newly allocated copy.
+ *
+ * Should *NOT* be called with RCU read-side lock held.
*/
struct consumer_output *consumer_copy_output(struct consumer_output *obj)
{
*/
struct consumer_output *consumer_copy_output(struct consumer_output *obj)
{
@@
-504,6
+508,12
@@
int consumer_set_network_uri(struct consumer_output *obj,
if (uri->port == 0) {
/* Assign default port. */
uri->port = DEFAULT_NETWORK_CONTROL_PORT;
if (uri->port == 0) {
/* Assign default port. */
uri->port = DEFAULT_NETWORK_CONTROL_PORT;
+ } else {
+ if (obj->dst.net.data_isset && uri->port ==
+ obj->dst.net.data.port) {
+ ret = -LTTNG_ERR_INVALID;
+ goto error;
+ }
}
DBG3("Consumer control URI set with port %d", uri->port);
break;
}
DBG3("Consumer control URI set with port %d", uri->port);
break;
@@
-513,11
+523,18
@@
int consumer_set_network_uri(struct consumer_output *obj,
if (uri->port == 0) {
/* Assign default port. */
uri->port = DEFAULT_NETWORK_DATA_PORT;
if (uri->port == 0) {
/* Assign default port. */
uri->port = DEFAULT_NETWORK_DATA_PORT;
+ } else {
+ if (obj->dst.net.control_isset && uri->port ==
+ obj->dst.net.control.port) {
+ ret = -LTTNG_ERR_INVALID;
+ goto error;
+ }
}
DBG3("Consumer data URI set with port %d", uri->port);
break;
default:
ERR("Set network uri type unknown %d", uri->stype);
}
DBG3("Consumer data URI set with port %d", uri->port);
break;
default:
ERR("Set network uri type unknown %d", uri->stype);
+ ret = -LTTNG_ERR_INVALID;
goto error;
}
goto error;
}
@@
-553,6
+570,7
@@
int consumer_set_network_uri(struct consumer_output *obj,
}
if (ret < 0) {
PERROR("snprintf set consumer uri subdir");
}
if (ret < 0) {
PERROR("snprintf set consumer uri subdir");
+ ret = -LTTNG_ERR_NOMEM;
goto error;
}
goto error;
}
@@
-564,7
+582,7
@@
int consumer_set_network_uri(struct consumer_output *obj,
equal:
return 1;
error:
equal:
return 1;
error:
- return
-1
;
+ return
ret
;
}
/*
}
/*
@@
-1107,7
+1125,7
@@
int consumer_push_metadata(struct consumer_socket *socket,
goto end;
}
goto end;
}
- DBG3("Consumer pushing metadata on sock %d of len %
l
u", socket->fd, len);
+ DBG3("Consumer pushing metadata on sock %d of len %
z
u", socket->fd, len);
ret = lttcomm_send_unix_sock(socket->fd, metadata_str, len);
if (ret < 0) {
ret = lttcomm_send_unix_sock(socket->fd, metadata_str, len);
if (ret < 0) {
This page took
0.025806 seconds
and
4
git commands to generate.