diff mbox

[v3,02/21] lockd: added cleanup checks in exit_net hook

Message ID a43dae6a-2f3f-cd72-3384-f22b28494eb0@virtuozzo.com (mailing list archive)
State New, archived
Headers show

Commit Message

Vasily Averin Nov. 6, 2017, 1:23 p.m. UTC
Signed-off-by: Vasily Averin <vvs@virtuozzo.com>
---
 fs/lockd/svc.c | 11 +++++++++++
 1 file changed, 11 insertions(+)

Comments

J. Bruce Fields Nov. 9, 2017, 3:06 p.m. UTC | #1
Applied.--b.

On Mon, Nov 06, 2017 at 04:23:24PM +0300, Vasily Averin wrote:
> Signed-off-by: Vasily Averin <vvs@virtuozzo.com>
> ---
>  fs/lockd/svc.c | 11 +++++++++++
>  1 file changed, 11 insertions(+)
> 
> diff --git a/fs/lockd/svc.c b/fs/lockd/svc.c
> index 809cbcc..2a48558 100644
> --- a/fs/lockd/svc.c
> +++ b/fs/lockd/svc.c
> @@ -690,6 +690,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 = {
> -- 
> 2.7.4
--
To unsubscribe from this list: send the line "unsubscribe linux-nfs" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/fs/lockd/svc.c b/fs/lockd/svc.c
index 809cbcc..2a48558 100644
--- a/fs/lockd/svc.c
+++ b/fs/lockd/svc.c
@@ -690,6 +690,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 = {