From ed1e52a3cc41925b701cd1343ace4c450ff836d9 Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=A9mie=20Galarneau?= Date: Wed, 14 Nov 2018 16:00:15 -0500 Subject: [PATCH] Fix: session_list lock must be held to launch a rotation MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit The timer.h functions are documented as needing the session_list lock to be held. Since timers are setup during the launch of a rotation, the session_list lock must be taken while a job is executed by the rotation thread. Signed-off-by: Jérémie Galarneau --- src/bin/lttng-sessiond/rotation-thread.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/bin/lttng-sessiond/rotation-thread.c b/src/bin/lttng-sessiond/rotation-thread.c index 25dbf76a9..3256a1e9b 100644 --- a/src/bin/lttng-sessiond/rotation-thread.c +++ b/src/bin/lttng-sessiond/rotation-thread.c @@ -642,7 +642,7 @@ end: return ret; } -/* Call with the session lock held. */ +/* Call with the session and session_list locks held. */ static int launch_session_rotation(struct ltt_session *session) { @@ -736,10 +736,9 @@ int handle_job_queue(struct rotation_thread_handle *handle, } session_lock(session); - session_unlock_list(); - ret = run_job(job, session, handle->notification_thread_handle); session_unlock(session); + session_unlock_list(); free(job); if (ret) { goto end; -- 2.34.1