X-Git-Url: http://git.liburcu.org/?a=blobdiff_plain;f=lttng-events.c;h=da1d38e67b5ef80e4d381f15ceed0097093837bd;hb=9aaa730e2f04ed2b5e656e6bd10c0712ecb2bd87;hp=04df65c6af21829a4820636d43401cb96b46fe5c;hpb=31b00794a30ea27fdf0c14f4885df500fb28a099;p=lttng-modules.git diff --git a/lttng-events.c b/lttng-events.c index 04df65c6..da1d38e6 100644 --- a/lttng-events.c +++ b/lttng-events.c @@ -87,7 +87,12 @@ int _lttng_field_statedump(struct lttng_session *session, void synchronize_trace(void) { +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5,1,0)) + synchronize_rcu(); +#else synchronize_sched(); +#endif + #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,4,0)) #ifdef CONFIG_PREEMPT_RT_FULL synchronize_rcu(); @@ -1115,8 +1120,8 @@ int lttng_session_list_tracker_pids(struct lttng_session *session) ret = PTR_ERR(tracker_pids_list_file); goto file_error; } - if (atomic_long_add_unless(&session->file->f_count, - 1, INT_MAX) == INT_MAX) { + if (!atomic_long_add_unless(&session->file->f_count, 1, LONG_MAX)) { + ret = -EOVERFLOW; goto refcount_error; } ret = lttng_tracker_pids_list_fops.open(NULL, tracker_pids_list_file);