mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] nfsd: Add quotes to client info 'callback address'
@ 2024-08-07  1:58 Mark Grimes
  2024-08-07  2:36 ` NeilBrown
  2024-08-07 10:18 ` Jeff Layton
  0 siblings, 2 replies; 3+ messages in thread
From: Mark Grimes @ 2024-08-07  1:58 UTC (permalink / raw)
  To: Chuck Lever, Jeff Layton, Neil Brown, Olga Kornievskaia, Dai Ngo,
	Tom Talpey, linux-nfs, linux-kernel
  Cc: Mark Grimes

The 'callback address' in client_info_show is output without quotes
causing yaml parsers to fail on processing IPv6 addresses.
Adding quotes to 'callback address' also matches that used by
the 'address' field.

Signed-off-by: Mark Grimes <mark.grimes@ixsystems.com>
---
 fs/nfsd/nfs4state.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/nfsd/nfs4state.c b/fs/nfsd/nfs4state.c
index a20c2c9d7d45..0061ae253f4d 100644
--- a/fs/nfsd/nfs4state.c
+++ b/fs/nfsd/nfs4state.c
@@ -2692,7 +2692,7 @@ static int client_info_show(struct seq_file *m, void *v)
 			clp->cl_nii_time.tv_sec, clp->cl_nii_time.tv_nsec);
 	}
 	seq_printf(m, "callback state: %s\n", cb_state2str(clp->cl_cb_state));
-	seq_printf(m, "callback address: %pISpc\n", &clp->cl_cb_conn.cb_addr);
+	seq_printf(m, "callback address: \"%pISpc\"\n", &clp->cl_cb_conn.cb_addr);
 	seq_printf(m, "admin-revoked states: %d\n",
 		   atomic_read(&clp->cl_admin_revoked));
 	drop_client(clp);
-- 
2.39.2


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] nfsd: Add quotes to client info 'callback address'
  2024-08-07  1:58 [PATCH] nfsd: Add quotes to client info 'callback address' Mark Grimes
@ 2024-08-07  2:36 ` NeilBrown
  2024-08-07 10:18 ` Jeff Layton
  1 sibling, 0 replies; 3+ messages in thread
From: NeilBrown @ 2024-08-07  2:36 UTC (permalink / raw)
  To: Mark Grimes
  Cc: Chuck Lever, Jeff Layton, Olga Kornievskaia, Dai Ngo, Tom Talpey,
	linux-nfs, linux-kernel, Mark Grimes

On Wed, 07 Aug 2024, Mark Grimes wrote:
> The 'callback address' in client_info_show is output without quotes
> causing yaml parsers to fail on processing IPv6 addresses.
> Adding quotes to 'callback address' also matches that used by
> the 'address' field.

Reviewed-by: NeilBrown <neilb@suse.de>

It is conceivable that existing code already handles the existing format
and could break, but it seems unlikely.  nfs-utils has code to parse
this file but it ignores "callback address" and doesn't care about the
content of "address" just including it in logs.

Consistency with "address" is a strong argument - strong enough to risk
the unlikely breakage.

Thanks,
NeilBrown


> 
> Signed-off-by: Mark Grimes <mark.grimes@ixsystems.com>
> ---
>  fs/nfsd/nfs4state.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/fs/nfsd/nfs4state.c b/fs/nfsd/nfs4state.c
> index a20c2c9d7d45..0061ae253f4d 100644
> --- a/fs/nfsd/nfs4state.c
> +++ b/fs/nfsd/nfs4state.c
> @@ -2692,7 +2692,7 @@ static int client_info_show(struct seq_file *m, void *v)
>  			clp->cl_nii_time.tv_sec, clp->cl_nii_time.tv_nsec);
>  	}
>  	seq_printf(m, "callback state: %s\n", cb_state2str(clp->cl_cb_state));
> -	seq_printf(m, "callback address: %pISpc\n", &clp->cl_cb_conn.cb_addr);
> +	seq_printf(m, "callback address: \"%pISpc\"\n", &clp->cl_cb_conn.cb_addr);
>  	seq_printf(m, "admin-revoked states: %d\n",
>  		   atomic_read(&clp->cl_admin_revoked));
>  	drop_client(clp);
> -- 
> 2.39.2
> 
> 


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] nfsd: Add quotes to client info 'callback address'
  2024-08-07  1:58 [PATCH] nfsd: Add quotes to client info 'callback address' Mark Grimes
  2024-08-07  2:36 ` NeilBrown
@ 2024-08-07 10:18 ` Jeff Layton
  1 sibling, 0 replies; 3+ messages in thread
From: Jeff Layton @ 2024-08-07 10:18 UTC (permalink / raw)
  To: Mark Grimes, Chuck Lever, Neil Brown, Olga Kornievskaia, Dai Ngo,
	Tom Talpey, linux-nfs, linux-kernel

On Tue, 2024-08-06 at 18:58 -0700, Mark Grimes wrote:
> The 'callback address' in client_info_show is output without quotes
> causing yaml parsers to fail on processing IPv6 addresses.
> Adding quotes to 'callback address' also matches that used by
> the 'address' field.
> 
> Signed-off-by: Mark Grimes <mark.grimes@ixsystems.com>
> ---
>  fs/nfsd/nfs4state.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/fs/nfsd/nfs4state.c b/fs/nfsd/nfs4state.c
> index a20c2c9d7d45..0061ae253f4d 100644
> --- a/fs/nfsd/nfs4state.c
> +++ b/fs/nfsd/nfs4state.c
> @@ -2692,7 +2692,7 @@ static int client_info_show(struct seq_file *m, void *v)
>  			clp->cl_nii_time.tv_sec, clp->cl_nii_time.tv_nsec);
>  	}
>  	seq_printf(m, "callback state: %s\n", cb_state2str(clp->cl_cb_state));
> -	seq_printf(m, "callback address: %pISpc\n", &clp->cl_cb_conn.cb_addr);
> +	seq_printf(m, "callback address: \"%pISpc\"\n", &clp->cl_cb_conn.cb_addr);
>  	seq_printf(m, "admin-revoked states: %d\n",
>  		   atomic_read(&clp->cl_admin_revoked));
>  	drop_client(clp);

I agree with Neil's assessment here:

Reviewed-by: Jeff Layton <jlayton@kernel.org>

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2024-08-07 10:18 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-08-07  1:58 [PATCH] nfsd: Add quotes to client info 'callback address' Mark Grimes
2024-08-07  2:36 ` NeilBrown
2024-08-07 10:18 ` Jeff Layton

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®