Fix: sessiond: kernel error accounting fd still open when unloading modules
authorFrancis Deslauriers <francis.deslauriers@efficios.com>
Fri, 26 Mar 2021 21:06:12 +0000 (17:06 -0400)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Wed, 31 Mar 2021 23:18:46 +0000 (19:18 -0400)
commit1d25334cf088d661bac0643ccb50d1acc6d02e05
treeac2caa55507ae0e71b72b4076d57a626da345632
parent90aa04a116a8be510b9d256b47de6bbb4144fb8b
Fix: sessiond: kernel error accounting fd still open when unloading modules

Issue
=====
I noticed that some kernel modules were not unloading properly when
shutting down the sessiond. Namely those modules:
  lttng_counter_client_percpu_64_modular
  lttng_ring_buffer_event_notifier_client

The call to `modprobe -r` for those modules is failing because the
kernel error accounting fd has not been closed.

Fix
===
Only call `modprobe -r` after all kernel resources (file descriptors)
have been released.

Side note
=========
The `modprobe_remove_lttng()` is currently printing that the removal of a
_OPTIONAL module was a success even if it failed. I rework this function
to print a debug message in such situation. I used the
`modprobe_lttng()` as a template for this function.

Signed-off-by: Francis Deslauriers <francis.deslauriers@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Change-Id: Ibb51425ef3deedf6e982084ef879bc83ac823ba3
src/bin/lttng-sessiond/kernel.c
src/bin/lttng-sessiond/main.c
src/bin/lttng-sessiond/modprobe.c
This page took 0.025857 seconds and 4 git commands to generate.