Skip to contentSkip to conversation

nfsd: delete unnecessary NULL check in __fh_verify()

PATCH In review Dan Carpenter 3 participants 3 messages Sep 4, 2025 – Sep 5, 2025

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

PATCH 1/1 nfsd: delete unnecessary NULL check in __fh_verify()

In commit 4a0de50a44bb ("nfsd: decouple the xprtsec policy check from check_nfsd_access()") we added a NULL check on "rqstp" to earlier in the function. This check is no longer required so delete it.

---
 fs/nfsd/nfsfh.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
fs/nfsd/nfsfh.c +1 -3
index 062cfc18d8c6..3edccc38db42 100644
@@ -403,9 +403,7 @@ __fh_verify(struct svc_rqst *rqstp,
 	if (error)
 		goto out;
 
-	/* During LOCALIO call to fh_verify will be called with a NULL rqstp */
-	if (rqstp)
-		svc_xprt_set_valid(rqstp->rq_xprt);
+	svc_xprt_set_valid(rqstp->rq_xprt);
 
 check_permissions:
 	/* Finally, check access permissions. */
Signature · 1 line
2.47.2
Reviewed-by on v1 1/1
#1 lore raw
Quoted 5 lines · Dan Carpenter

In commit 4a0de50a44bb ("nfsd: decouple the xprtsec policy check from check_nfsd_access()") we added a NULL check on "rqstp" to earlier in the function. This check is no longer required so delete it.

-Scott

Quoted 22 lines
---
 fs/nfsd/nfsfh.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
fs/nfsd/nfsfh.c +1 -3
index 062cfc18d8c6..3edccc38db42 100644
@@ -403,9 +403,7 @@ __fh_verify(struct svc_rqst *rqstp,
 	if (error)
 		goto out;
 
-	/* During LOCALIO call to fh_verify will be called with a NULL rqstp */
-	if (rqstp)
-		svc_xprt_set_valid(rqstp->rq_xprt);
+	svc_xprt_set_valid(rqstp->rq_xprt);
 
 check_permissions:
 	/* Finally, check access permissions. */
Signature · 1 line
2.47.2
maintainer
#2 lore raw
In reply to Dan Carpenter

From: Chuck Lever <[email protected]>

Quoted 5 lines · Dan Carpenter

In commit 4a0de50a44bb ("nfsd: decouple the xprtsec policy check from check_nfsd_access()") we added a NULL check on "rqstp" to earlier in the function. This check is no longer required so delete it.

Applied to nfsd-testing, thanks!

[1/1] nfsd: delete unnecessary NULL check in __fh_verify()

      commit: ec3d9745c6a3f41658d17873e4890b56cc27f9c8

--
Chuck Lever