@@ -690,6 +690,14 @@ static int lockd_init_net(struct net *net)
static void lockd_exit_net(struct net *net)
{
+ struct lockd_net *ln = net_generic(net, lockd_net_id);
+
+ WARN(!list_empty(&ln->lockd_manager.list),
+ "per-netns lockd_manager.list is not empty\n");
+ WARN(!list_empty(&ln->nsm_handles),
+ "per-netns nsm_handles list is not empty\n");
+ WARN(delayed_work_pending(&ln->grace_period_end),
+ "per-netns grace_period_end dealyed work was not cancelled\n");
}
static struct pernet_operations lockd_net_ops = {
Patch generates warnings if exit_net hook detects that structures initialized in init_net hook are still in use. [ 2355.129218] per-netns lockd_manager.list is not empty [ 2355.130483] WARNING: CPU: 7 PID: 97 at fs/lockd/svc.c:682 lockd_exit_net+0x52/0x80 [lockd] ... [ 2355.148073] per-netns grace_period_end dealyed work was not cancelled [ 2355.149205] WARNING: CPU: 7 PID: 97 at fs/lockd/svc.c:686 lockd_exit_net+0x78/0x80 [lockd] Signed-off-by: Vasily Averin <vvs@virtuozzo.com> --- fs/lockd/svc.c | 8 ++++++++ 1 file changed, 8 insertions(+)