linux-nfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] nfsd4: kill warnings on testing stateids with mismatched clientids
@ 2020-03-19 14:18 J. Bruce Fields
  2020-03-19 14:30 ` Benjamin Coddington
  0 siblings, 1 reply; 3+ messages in thread
From: J. Bruce Fields @ 2020-03-19 14:18 UTC (permalink / raw)
  To: Chuck Lever; +Cc: linux-nfs

From: "J. Bruce Fields" <bfields@redhat.com>

It's normal for a client to test a stateid from a previous instance,
e.g. after a network partition.

Signed-off-by: J. Bruce Fields <bfields@redhat.com>
---
 fs/nfsd/nfs4state.c | 9 +--------
 1 file changed, 1 insertion(+), 8 deletions(-)

I'm not a fan of printk's even on buggy client behavior.  I guess it
could be a dprintk.  I'm not sure it adds much over information you
could get at some other layer, e.g. from a network trace.

diff --git a/fs/nfsd/nfs4state.c b/fs/nfsd/nfs4state.c
index c1f347bbf8f4..927cfb9d2204 100644
--- a/fs/nfsd/nfs4state.c
+++ b/fs/nfsd/nfs4state.c
@@ -5522,15 +5522,8 @@ static __be32 nfsd4_validate_stateid(struct nfs4_client *cl, stateid_t *stateid)
 	if (ZERO_STATEID(stateid) || ONE_STATEID(stateid) ||
 		CLOSE_STATEID(stateid))
 		return status;
-	/* Client debugging aid. */
-	if (!same_clid(&stateid->si_opaque.so_clid, &cl->cl_clientid)) {
-		char addr_str[INET6_ADDRSTRLEN];
-		rpc_ntop((struct sockaddr *)&cl->cl_addr, addr_str,
-				 sizeof(addr_str));
-		pr_warn_ratelimited("NFSD: client %s testing state ID "
-					"with incorrect client ID\n", addr_str);
+	if (!same_clid(&stateid->si_opaque.so_clid, &cl->cl_clientid))
 		return status;
-	}
 	spin_lock(&cl->cl_lock);
 	s = find_stateid_locked(cl, stateid);
 	if (!s)
-- 
2.25.1


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

* Re: [PATCH] nfsd4: kill warnings on testing stateids with mismatched clientids
  2020-03-19 14:18 [PATCH] nfsd4: kill warnings on testing stateids with mismatched clientids J. Bruce Fields
@ 2020-03-19 14:30 ` Benjamin Coddington
  2020-03-19 14:59   ` Chuck Lever
  0 siblings, 1 reply; 3+ messages in thread
From: Benjamin Coddington @ 2020-03-19 14:30 UTC (permalink / raw)
  To: J. Bruce Fields; +Cc: Chuck Lever, linux-nfs

On 19 Mar 2020, at 10:18, J. Bruce Fields wrote:

> From: "J. Bruce Fields" <bfields@redhat.com>
>
> It's normal for a client to test a stateid from a previous instance,
> e.g. after a network partition.
>
> Signed-off-by: J. Bruce Fields <bfields@redhat.com>

Thanks!

Reviewed-by: Benjamin Coddington <bcodding@redhat.com>

Ben

> ---
>  fs/nfsd/nfs4state.c | 9 +--------
>  1 file changed, 1 insertion(+), 8 deletions(-)
>
> I'm not a fan of printk's even on buggy client behavior.  I guess it
> could be a dprintk.  I'm not sure it adds much over information you
> could get at some other layer, e.g. from a network trace.
>
> diff --git a/fs/nfsd/nfs4state.c b/fs/nfsd/nfs4state.c
> index c1f347bbf8f4..927cfb9d2204 100644
> --- a/fs/nfsd/nfs4state.c
> +++ b/fs/nfsd/nfs4state.c
> @@ -5522,15 +5522,8 @@ static __be32 nfsd4_validate_stateid(struct 
> nfs4_client *cl, stateid_t *stateid)
>  	if (ZERO_STATEID(stateid) || ONE_STATEID(stateid) ||
>  		CLOSE_STATEID(stateid))
>  		return status;
> -	/* Client debugging aid. */
> -	if (!same_clid(&stateid->si_opaque.so_clid, &cl->cl_clientid)) {
> -		char addr_str[INET6_ADDRSTRLEN];
> -		rpc_ntop((struct sockaddr *)&cl->cl_addr, addr_str,
> -				 sizeof(addr_str));
> -		pr_warn_ratelimited("NFSD: client %s testing state ID "
> -					"with incorrect client ID\n", addr_str);
> +	if (!same_clid(&stateid->si_opaque.so_clid, &cl->cl_clientid))
>  		return status;
> -	}
>  	spin_lock(&cl->cl_lock);
>  	s = find_stateid_locked(cl, stateid);
>  	if (!s)
> -- 
> 2.25.1


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

* Re: [PATCH] nfsd4: kill warnings on testing stateids with mismatched clientids
  2020-03-19 14:30 ` Benjamin Coddington
@ 2020-03-19 14:59   ` Chuck Lever
  0 siblings, 0 replies; 3+ messages in thread
From: Chuck Lever @ 2020-03-19 14:59 UTC (permalink / raw)
  To: Benjamin Coddington; +Cc: Bruce Fields, Linux NFS Mailing List



> On Mar 19, 2020, at 10:30 AM, Benjamin Coddington <bcodding@redhat.com> wrote:
> 
> On 19 Mar 2020, at 10:18, J. Bruce Fields wrote:
> 
>> From: "J. Bruce Fields" <bfields@redhat.com>
>> 
>> It's normal for a client to test a stateid from a previous instance,
>> e.g. after a network partition.
>> 
>> Signed-off-by: J. Bruce Fields <bfields@redhat.com>
> 
> Thanks!
> 
> Reviewed-by: Benjamin Coddington <bcodding@redhat.com>

Applied to nfsd-5.7, thanks all!


> Ben
> 
>> ---
>> fs/nfsd/nfs4state.c | 9 +--------
>> 1 file changed, 1 insertion(+), 8 deletions(-)
>> 
>> I'm not a fan of printk's even on buggy client behavior.  I guess it
>> could be a dprintk.  I'm not sure it adds much over information you
>> could get at some other layer, e.g. from a network trace.
>> 
>> diff --git a/fs/nfsd/nfs4state.c b/fs/nfsd/nfs4state.c
>> index c1f347bbf8f4..927cfb9d2204 100644
>> --- a/fs/nfsd/nfs4state.c
>> +++ b/fs/nfsd/nfs4state.c
>> @@ -5522,15 +5522,8 @@ static __be32 nfsd4_validate_stateid(struct nfs4_client *cl, stateid_t *stateid)
>> 	if (ZERO_STATEID(stateid) || ONE_STATEID(stateid) ||
>> 		CLOSE_STATEID(stateid))
>> 		return status;
>> -	/* Client debugging aid. */
>> -	if (!same_clid(&stateid->si_opaque.so_clid, &cl->cl_clientid)) {
>> -		char addr_str[INET6_ADDRSTRLEN];
>> -		rpc_ntop((struct sockaddr *)&cl->cl_addr, addr_str,
>> -				 sizeof(addr_str));
>> -		pr_warn_ratelimited("NFSD: client %s testing state ID "
>> -					"with incorrect client ID\n", addr_str);
>> +	if (!same_clid(&stateid->si_opaque.so_clid, &cl->cl_clientid))
>> 		return status;
>> -	}
>> 	spin_lock(&cl->cl_lock);
>> 	s = find_stateid_locked(cl, stateid);
>> 	if (!s)
>> -- 
>> 2.25.1
> 

--
Chuck Lever




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

end of thread, other threads:[~2020-03-19 15:00 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-03-19 14:18 [PATCH] nfsd4: kill warnings on testing stateids with mismatched clientids J. Bruce Fields
2020-03-19 14:30 ` Benjamin Coddington
2020-03-19 14:59   ` Chuck Lever

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).