NFSD: parse fsloc and secinfo export options without CONFIG_NFSD_V4
Subsystems (2)
Jeff Layton
maintainerPATCH 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.
--- fs/nfsd/export.c | 9 --------- 1 file changed, 9 deletions(-)
fs/nfsd/export.c +0 -9
@@ -1332,8 +1332,6 @@ static int check_export(const struct path *path, int *flags, unsigned char *uuidreturn 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]>
Chuck Lever
maintainerQuoted 10 lines · Jeff Layton
When
CONFIG_NFSD_V4is disabled,fsloc_parse()andsecinfo_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