Skip to contentSkip to conversation

NFSD: parse fsloc and secinfo export options without CONFIG_NFSD_V4

PATCH In review Jeff Layton 2 participants 2 messages Dec 3

Subsystems (2)
lore
Share & tools
lore

Jeff Layton

author maintainer
#0 lore raw

PATCH 1/1 NFSD: parse fsloc and secinfo export options without CONFIG_NFSD_V4

When CONFIG_NFSD_V4 is disabled, fsloc_parse() and secinfo_parse() are stubs that don't consume their arguments. mountd sends secinfo before uuid, so the parser stops at the secinfo list and the export never gets a uuid. nfsd then falls back to a dev-based fsid that mountd can't match on btrfs, and NFSv3 mounts fail with ESTALE.

Nothing in these parsers depends on NFSv4, so remove the stubs. Note that this means sec= options are now enforced on NFSv3-only servers.

Fixes e677bfe4d451 ("knfsd: nfsd4: parse secinfo information in exports downcall")
---
 fs/nfsd/export.c | 9 ---------
 1 file changed, 9 deletions(-)
fs/nfsd/export.c +0 -9
index 589422bd4e2e..d085d0bd0d3e 100644
@@ -1332,8 +1332,6 @@ static int check_export(const struct path *path, int *flags, unsigned char *uuid
 	return 0;
 }
 
-#ifdef CONFIG_NFSD_V4
-
 static int
 fsloc_parse(char **mesg, char *buf, struct nfsd4_fs_locations *fsloc)
 {
@@ -1428,13 +1426,6 @@ static int secinfo_parse(char **mesg, char *buf, struct svc_export *exp)
 	return 0;
 }
 
-#else /* CONFIG_NFSD_V4 */
-static inline int
-fsloc_parse(char **mesg, char *buf, struct nfsd4_fs_locations *fsloc){return 0;}
-static inline int
-secinfo_parse(char **mesg, char *buf, struct svc_export *exp) { return 0; }
-#endif
-
 static int xprtsec_parse(char **mesg, char *buf, struct svc_export *exp)
 {
 	unsigned int i, mode, listsize;

---
base-commit: 830c1154afdf4cb6e264ce60778abde4af0861fb
change-id: 20261203-nfsd-nov4-export-parse-6d0ae1e265a1

Best regards,

Signature · 1 line
Jeff Layton <[email protected]>
maintainer
#1 lore raw
Quoted 10 lines · Jeff Layton

When CONFIG_NFSD_V4 is disabled, fsloc_parse() and secinfo_parse() are stubs that don't consume their arguments. mountd sends secinfo before uuid, so the parser stops at the secinfo list and the export never gets a uuid. nfsd then falls back to a dev-based fsid that mountd can't match on btrfs, and NFSv3 mounts fail with ESTALE.

Nothing in these parsers depends on NFSv4, so remove the stubs. Note that this means sec= options are now enforced on NFSv3-only servers.

[...]

Applied to nfsd-testing, thanks!

[1/1] NFSD: parse fsloc and secinfo export options without CONFIG_NFSD_V4

      commit: eb76c146d6facf9588b6c1da360e2db41cdda335

--
Chuck Lever