diff mbox

[1/4] nfsd: remove net pointer from debug messages

Message ID 4c16eedb-7122-da42-a5fb-0ae2defdfffc@virtuozzo.com (mailing list archive)
State New, archived
Headers show

Commit Message

Vasily Averin Nov. 8, 2017, 5:55 a.m. UTC
Publishing of net pointer is not safe,
replace it in debug meesages by net->ns.inum

[  119.989161] nfsd: initializing export module (net: f00001e7).
[  171.767188] NFSD: starting 90-second grace period (net f00001e7)
[  322.185240] nfsd: shutting down export module (net: f00001e7).
[  322.186062] nfsd: export shutdown complete (net: f00001e7).

Signed-off-by: Vasily Averin <vvs@virtuozzo.com>
---
 fs/nfsd/export.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

Comments

J. Bruce Fields Nov. 8, 2017, 8:19 p.m. UTC | #1
Thanks, applying for 4.15.--b.

On Wed, Nov 08, 2017 at 08:55:22AM +0300, Vasily Averin wrote:
> Publishing of net pointer is not safe,
> replace it in debug meesages by net->ns.inum
> 
> [  119.989161] nfsd: initializing export module (net: f00001e7).
> [  171.767188] NFSD: starting 90-second grace period (net f00001e7)
> [  322.185240] nfsd: shutting down export module (net: f00001e7).
> [  322.186062] nfsd: export shutdown complete (net: f00001e7).
> 
> Signed-off-by: Vasily Averin <vvs@virtuozzo.com>
> ---
>  fs/nfsd/export.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/fs/nfsd/export.c b/fs/nfsd/export.c
> index 46b48db..f9e7dd5 100644
> --- a/fs/nfsd/export.c
> +++ b/fs/nfsd/export.c
> @@ -1230,7 +1230,7 @@ nfsd_export_init(struct net *net)
>  	int rv;
>  	struct nfsd_net *nn = net_generic(net, nfsd_net_id);
>  
> -	dprintk("nfsd: initializing export module (net: %p).\n", net);
> +	dprintk("nfsd: initializing export module (net: %x).\n", net->ns.inum);
>  
>  	nn->svc_export_cache = cache_create_net(&svc_export_cache_template, net);
>  	if (IS_ERR(nn->svc_export_cache))
> @@ -1278,7 +1278,7 @@ nfsd_export_shutdown(struct net *net)
>  {
>  	struct nfsd_net *nn = net_generic(net, nfsd_net_id);
>  
> -	dprintk("nfsd: shutting down export module (net: %p).\n", net);
> +	dprintk("nfsd: shutting down export module (net: %x).\n", net->ns.inum);
>  
>  	cache_unregister_net(nn->svc_expkey_cache, net);
>  	cache_unregister_net(nn->svc_export_cache, net);
> @@ -1286,5 +1286,5 @@ nfsd_export_shutdown(struct net *net)
>  	cache_destroy_net(nn->svc_export_cache, net);
>  	svcauth_unix_purge(net);
>  
> -	dprintk("nfsd: export shutdown complete (net: %p).\n", net);
> +	dprintk("nfsd: export shutdown complete (net: %x).\n", net->ns.inum);
>  }
> -- 
> 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/nfsd/export.c b/fs/nfsd/export.c
index 46b48db..f9e7dd5 100644
--- a/fs/nfsd/export.c
+++ b/fs/nfsd/export.c
@@ -1230,7 +1230,7 @@  nfsd_export_init(struct net *net)
 	int rv;
 	struct nfsd_net *nn = net_generic(net, nfsd_net_id);
 
-	dprintk("nfsd: initializing export module (net: %p).\n", net);
+	dprintk("nfsd: initializing export module (net: %x).\n", net->ns.inum);
 
 	nn->svc_export_cache = cache_create_net(&svc_export_cache_template, net);
 	if (IS_ERR(nn->svc_export_cache))
@@ -1278,7 +1278,7 @@  nfsd_export_shutdown(struct net *net)
 {
 	struct nfsd_net *nn = net_generic(net, nfsd_net_id);
 
-	dprintk("nfsd: shutting down export module (net: %p).\n", net);
+	dprintk("nfsd: shutting down export module (net: %x).\n", net->ns.inum);
 
 	cache_unregister_net(nn->svc_expkey_cache, net);
 	cache_unregister_net(nn->svc_export_cache, net);
@@ -1286,5 +1286,5 @@  nfsd_export_shutdown(struct net *net)
 	cache_destroy_net(nn->svc_export_cache, net);
 	svcauth_unix_purge(net);
 
-	dprintk("nfsd: export shutdown complete (net: %p).\n", net);
+	dprintk("nfsd: export shutdown complete (net: %x).\n", net->ns.inum);
 }