nfs client: exit_net cleanup check added
authorVasily Averin <vvs@virtuozzo.com>
Sun, 12 Nov 2017 08:48:16 +0000 (11:48 +0300)
committerAnna Schumaker <Anna.Schumaker@Netapp.com>
Fri, 17 Nov 2017 21:43:50 +0000 (16:43 -0500)
Be sure that nfs_client_list and nfs_volume_list lists initialized
in net_init hook were return to initial state in net_exit hook.

Signed-off-by: Vasily Averin <vvs@virtuozzo.com>
Signed-off-by: Anna Schumaker <Anna.Schumaker@Netapp.com>
fs/nfs/inode.c

index 52a60e399a2d0d2f1650cb31ba169bd6c024bc2d..e5fcc1f095aec2ff336c62c6b72a54a6ff7f5b8f 100644 (file)
@@ -2084,8 +2084,12 @@ static int nfs_net_init(struct net *net)
 
 static void nfs_net_exit(struct net *net)
 {
+       struct nfs_net *nn = net_generic(net, nfs_net_id);
+
        nfs_fs_proc_net_exit(net);
        nfs_cleanup_cb_ident_idr(net);
+       WARN_ON_ONCE(!list_empty(&nn->nfs_client_list));
+       WARN_ON_ONCE(!list_empty(&nn->nfs_volume_list));
 }
 
 static struct pernet_operations nfs_net_ops = {