Skip to contentSkip to conversation

NFSD: Fix NFSv4's PUTPUBFH operation

PATCH In review [email protected] 2 participants 2 messages Nov 10, 2024 – Nov 12, 2024

Subsystems (3)
lore
Share & tools
lore

[email protected]

author maintainer
#0 lore raw

PATCH 1/1 NFSD: Fix NFSv4's PUTPUBFH operation

From: Chuck Lever <[email protected]>

[ Upstream commit 202f39039a11402dcbcd5fece8d9fa6be83f49ae ]

According to RFC 8881, all minor versions of NFSv4 support PUTPUBFH.

Replace the XDR decoder for PUTPUBFH with a "noop" since we no longer want the minorversion check, and PUTPUBFH has no arguments to decode. (Ideally nfsd4_decode_noop should really be called nfsd4_decode_void).

PUTPUBFH should now behave just like PUTROOTFH.

Fixes e1a90ebd8b23 ("NFSD: Combine decode operations for v4 and v4.1")
Cc Dan Shelton <[email protected]>
Cc Roland Mainz <[email protected]>
[ cel: adjusted to apply to origin/linux-5.4.y ]
---
 fs/nfsd/nfs4xdr.c | 10 +---------
 1 file changed, 1 insertion(+), 9 deletions(-)

In response to:

https://lore.kernel.org/stable/2024100703-decorated-bodacious-fa3c@gregkh/

here is a version of upstream commit 202f39039a11 ("NFSD: Fix NFSv4's PUTPUBFH operation") that applies to both origin/linux-5.4.y and origin/linux-4.19.y.

fs/nfsd/nfs4xdr.c +1 -9
index 1d24fff2709c..55b18c145390 100644
@@ -1068,14 +1068,6 @@ nfsd4_decode_putfh(struct nfsd4_compoundargs *argp, struct nfsd4_putfh *putfh)
 	DECODE_TAIL;
 }
 
-static __be32
-nfsd4_decode_putpubfh(struct nfsd4_compoundargs *argp, void *p)
-{
-	if (argp->minorversion == 0)
-		return nfs_ok;
-	return nfserr_notsupp;
-}
-
 static __be32
 nfsd4_decode_read(struct nfsd4_compoundargs *argp, struct nfsd4_read *read)
 {
@@ -1825,7 +1817,7 @@ static const nfsd4_dec nfsd4_dec_ops[] = {
 	[OP_OPEN_CONFIRM]	= (nfsd4_dec)nfsd4_decode_open_confirm,
 	[OP_OPEN_DOWNGRADE]	= (nfsd4_dec)nfsd4_decode_open_downgrade,
 	[OP_PUTFH]		= (nfsd4_dec)nfsd4_decode_putfh,
-	[OP_PUTPUBFH]		= (nfsd4_dec)nfsd4_decode_putpubfh,
+	[OP_PUTPUBFH]		= (nfsd4_dec)nfsd4_decode_noop,
 	[OP_PUTROOTFH]		= (nfsd4_dec)nfsd4_decode_noop,
 	[OP_READ]		= (nfsd4_dec)nfsd4_decode_read,
 	[OP_READDIR]		= (nfsd4_dec)nfsd4_decode_readdir,
Signature · 1 line
2.47.0
maintainer
#1 lore raw
Quoted 20 lines · On Sun, Nov 10, 2024 at 01:45:10PM -0500, [email protected] wrote:

From: Chuck Lever <[email protected]>

[ Upstream commit 202f39039a11402dcbcd5fece8d9fa6be83f49ae ]

According to RFC 8881, all minor versions of NFSv4 support PUTPUBFH.

Replace the XDR decoder for PUTPUBFH with a "noop" since we no longer want the minorversion check, and PUTPUBFH has no arguments to decode. (Ideally nfsd4_decode_noop should really be called nfsd4_decode_void).

PUTPUBFH should now behave just like PUTROOTFH.

Fixes e1a90ebd8b23 ("NFSD: Combine decode operations for v4 and v4.1")
Cc Dan Shelton <[email protected]>
Cc Roland Mainz <[email protected]>
[ cel: adjusted to apply to origin/linux-5.4.y ]
Quoted 7 lines
---
 fs/nfsd/nfs4xdr.c | 10 +---------
 1 file changed, 1 insertion(+), 9 deletions(-)

In response to:

https://lore.kernel.org/stable/2024100703-decorated-bodacious-fa3c@gregkh/

Now queued up, thanks.

greg k-h