viewer_stream_create must be called with the relay stream's
lock held since
9edaf114d. A call to pthread_mutex_unlock
was forgotten in the error path of viewer_stream_create resulting
in a double-unlock in some error scenarios.
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Change-Id: I613f67440669af52f625b7bdc4e9ae6ce75956ea
if (stream->is_metadata && stream->trace->viewer_metadata_stream) {
ERR("Cannot attach viewer metadata stream to trace (busy).");
if (stream->is_metadata && stream->trace->viewer_metadata_stream) {
ERR("Cannot attach viewer metadata stream to trace (busy).");
tracefile_array_get_seq_head(stream->tfa) + 1;
break;
default:
tracefile_array_get_seq_head(stream->tfa) + 1;
break;
default:
if (chunk_status == LTTNG_TRACE_CHUNK_STATUS_NO_FILE) {
vstream->index_file = NULL;
} else {
if (chunk_status == LTTNG_TRACE_CHUNK_STATUS_NO_FILE) {
vstream->index_file = NULL;
} else {
vstream->current_tracefile_id, NULL, file_path,
sizeof(file_path));
if (ret < 0) {
vstream->current_tracefile_id, NULL, file_path,
sizeof(file_path));
if (ret < 0) {
}
status = lttng_trace_chunk_open_fs_handle(
}
status = lttng_trace_chunk_open_fs_handle(
O_RDONLY, 0, &vstream->stream_file.handle,
true);
if (status != LTTNG_TRACE_CHUNK_STATUS_OK) {
O_RDONLY, 0, &vstream->stream_file.handle,
true);
if (status != LTTNG_TRACE_CHUNK_STATUS_OK) {
lseek_ret = fs_handle_seek(
vstream->index_file->file, 0, SEEK_END);
if (lseek_ret < 0) {
lseek_ret = fs_handle_seek(
vstream->index_file->file, 0, SEEK_END);
if (lseek_ret < 0) {
}
}
if (stream->is_metadata) {
}
}
if (stream->is_metadata) {
-error_unlock:
- pthread_mutex_unlock(&stream->lock);
error:
if (vstream) {
viewer_stream_destroy(vstream);
error:
if (vstream) {
viewer_stream_destroy(vstream);