X-Git-Url: http://git.liburcu.org/?a=blobdiff_plain;f=lttng-events.c;h=a4570b7b45a7d175ec2cf03680c7376786464eef;hb=5eac9d146a7d947f0f314c4f7103c92cbccaeaf3;hp=566080a3a4c1be92ea01e9e6b2af497fd040d007;hpb=41f229dc03b585cc3f434e1db1a5a68101c5da9a;p=lttng-modules.git diff --git a/lttng-events.c b/lttng-events.c index 566080a3..a4570b7b 100644 --- a/lttng-events.c +++ b/lttng-events.c @@ -75,7 +75,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(); @@ -1135,8 +1140,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);