Skip to content

Commit

Permalink
lockd: added cleanup checks in exit_net hook
Browse files Browse the repository at this point in the history
Signed-off-by: Vasily Averin <[email protected]>
Signed-off-by: J. Bruce Fields <[email protected]>
  • Loading branch information
vaverin authored and J. Bruce Fields committed Nov 27, 2017
1 parent b872285 commit a3152f1
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions fs/lockd/svc.c
Original file line number Diff line number Diff line change
Expand Up @@ -677,6 +677,17 @@ 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_ONCE(!list_empty(&ln->lockd_manager.list),
"net %x %s: lockd_manager.list is not empty\n",
net->ns.inum, __func__);
WARN_ONCE(!list_empty(&ln->nsm_handles),
"net %x %s: nsm_handles list is not empty\n",
net->ns.inum, __func__);
WARN_ONCE(delayed_work_pending(&ln->grace_period_end),
"net %x %s: grace_period_end was not cancelled\n",
net->ns.inum, __func__);
}

static struct pernet_operations lockd_net_ops = {
Expand Down

0 comments on commit a3152f1

Please sign in to comment.