Skip to contentSkip to conversation

nfsd4: kill warnings on testing stateids with mismatched clientids

PATCH Applied J. Bruce Fields 3 participants 3 messages Mar 19, 2020

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 nfsd4: kill warnings on testing stateids with mismatched clientids

From: "J. Bruce Fields" <[email protected]>

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

---
 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.

fs/nfsd/nfs4state.c +1 -8
index c1f347bbf8f4..927cfb9d2204 100644
@@ -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)
Signature · 1 line
2.25.1
Reviewed-by on v1 1/1
#1 lore raw
Quoted 6 lines · J. Bruce Fields

From: "J. Bruce Fields" <[email protected]>

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

Thanks!

Ben

Quoted 32 lines
---
 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.

fs/nfsd/nfs4state.c +1 -8
index c1f347bbf8f4..927cfb9d2204 100644
@@ -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)

Signature · 1 line
2.25.1
Applied
#2 lore raw
Quoted 8 lines · Benjamin Coddington
Quoted 2 lines · J. Bruce Fields

From: "J. Bruce Fields" <[email protected]>

Quoted 8 lines
Quoted 4 lines

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

Thanks!

Applied to nfsd-5.7, thanks all!

Quoted 25 lines

Ben

Quoted 23 lines

---
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.

fs/nfsd/nfs4state.c +0 -7
index c1f347bbf8f4..927cfb9d2204 100644
@@ -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);
Quoted 9 lines
Quoted 8 lines
fs/nfsd/nfs4state.c +1 -1
+	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)
Signature · 1 line
2.25.1

--
Chuck Lever