NFSD: Remove CONFIG_NFSD_V3

[ Upstream commit 5f9a62ff7d2808c7b56c0ec90f3b7eae5872afe6 ]

Eventually support for NFSv2 in the Linux NFS server is to be
deprecated and then removed.

However, NFSv2 is the "always supported" version that is available
as soon as CONFIG_NFSD is set.  Before NFSv2 support can be removed,
we need to choose a different "always supported" version.

This patch removes CONFIG_NFSD_V3 so that NFSv3 is always supported,
as NFSv2 is today. When NFSv2 support is removed, NFSv3 will become
the only "always supported" NFS version.

The defconfigs still need to be updated to remove CONFIG_NFSD_V3=y.

Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
Chuck Lever 2022-02-06 12:25:47 -05:00 committed by Ksawlii
parent 2c57725d69
commit 3cc88ae66e
8 changed files with 3 additions and 51 deletions

View file

@ -322,7 +322,7 @@ config LOCKD
config LOCKD_V4 config LOCKD_V4
bool bool
depends on NFSD_V3 || NFS_V3 depends on NFSD || NFS_V3
depends on FILE_LOCKING depends on FILE_LOCKING
default y default y

View file

@ -35,18 +35,9 @@ config NFSD_V2_ACL
bool bool
depends on NFSD depends on NFSD
config NFSD_V3
bool "NFS server support for NFS version 3"
depends on NFSD
help
This option enables support in your system's NFS server for
version 3 of the NFS protocol (RFC 1813).
If unsure, say Y.
config NFSD_V3_ACL config NFSD_V3_ACL
bool "NFS server support for the NFSv3 ACL protocol extension" bool "NFS server support for the NFSv3 ACL protocol extension"
depends on NFSD_V3 depends on NFSD
select NFSD_V2_ACL select NFSD_V2_ACL
help help
Solaris NFS servers support an auxiliary NFSv3 ACL protocol that Solaris NFS servers support an auxiliary NFSv3 ACL protocol that
@ -70,7 +61,6 @@ config NFSD_V3_ACL
config NFSD_V4 config NFSD_V4
bool "NFS server support for NFS version 4" bool "NFS server support for NFS version 4"
depends on NFSD && PROC_FS depends on NFSD && PROC_FS
select NFSD_V3
select FS_POSIX_ACL select FS_POSIX_ACL
select SUNRPC_GSS select SUNRPC_GSS
select CRYPTO select CRYPTO

View file

@ -12,9 +12,8 @@ nfsd-y += trace.o
nfsd-y += nfssvc.o nfsctl.o nfsproc.o nfsfh.o vfs.o \ nfsd-y += nfssvc.o nfsctl.o nfsproc.o nfsfh.o vfs.o \
export.o auth.o lockd.o nfscache.o nfsxdr.o \ export.o auth.o lockd.o nfscache.o nfsxdr.o \
stats.o filecache.o stats.o filecache.o nfs3proc.o nfs3xdr.o
nfsd-$(CONFIG_NFSD_V2_ACL) += nfs2acl.o nfsd-$(CONFIG_NFSD_V2_ACL) += nfs2acl.o
nfsd-$(CONFIG_NFSD_V3) += nfs3proc.o nfs3xdr.o
nfsd-$(CONFIG_NFSD_V3_ACL) += nfs3acl.o nfsd-$(CONFIG_NFSD_V3_ACL) += nfs3acl.o
nfsd-$(CONFIG_NFSD_V4) += nfs4proc.o nfs4xdr.o nfs4state.o nfs4idmap.o \ nfsd-$(CONFIG_NFSD_V4) += nfs4proc.o nfs4xdr.o nfs4state.o nfs4idmap.o \
nfs4acl.o nfs4callback.o nfs4recover.o nfs4acl.o nfs4callback.o nfs4recover.o

View file

@ -668,8 +668,6 @@ out_negative:
return nfserr_serverfault; return nfserr_serverfault;
} }
#ifdef CONFIG_NFSD_V3
/** /**
* fh_fill_pre_attrs - Fill in pre-op attributes * fh_fill_pre_attrs - Fill in pre-op attributes
* @fhp: file handle to be updated * @fhp: file handle to be updated
@ -730,8 +728,6 @@ void fh_fill_post_attrs(struct svc_fh *fhp)
nfsd4_change_attribute(&fhp->fh_post_attr, inode); nfsd4_change_attribute(&fhp->fh_post_attr, inode);
} }
#endif /* CONFIG_NFSD_V3 */
/* /*
* Release a file handle. * Release a file handle.
*/ */

View file

@ -43,7 +43,6 @@ typedef struct svc_fh {
* operation * operation
*/ */
int fh_flags; /* FH flags */ int fh_flags; /* FH flags */
#ifdef CONFIG_NFSD_V3
bool fh_post_saved; /* post-op attrs saved */ bool fh_post_saved; /* post-op attrs saved */
bool fh_pre_saved; /* pre-op attrs saved */ bool fh_pre_saved; /* pre-op attrs saved */
@ -60,7 +59,6 @@ typedef struct svc_fh {
/* Post-op attributes saved in fh_unlock */ /* Post-op attributes saved in fh_unlock */
struct kstat fh_post_attr; /* full attrs after operation */ struct kstat fh_post_attr; /* full attrs after operation */
u64 fh_post_change; /* nfsv4 change; see above */ u64 fh_post_change; /* nfsv4 change; see above */
#endif /* CONFIG_NFSD_V3 */
} svc_fh; } svc_fh;
#define NFSD4_FH_FOREIGN (1<<0) #define NFSD4_FH_FOREIGN (1<<0)
#define SET_FH_FLAG(c, f) ((c)->fh_flags |= (f)) #define SET_FH_FLAG(c, f) ((c)->fh_flags |= (f))
@ -236,8 +234,6 @@ static inline u32 knfsd_fh_hash(const struct knfsd_fh *fh)
} }
#endif #endif
#ifdef CONFIG_NFSD_V3
/** /**
* fh_clear_pre_post_attrs - Reset pre/post attributes * fh_clear_pre_post_attrs - Reset pre/post attributes
* @fhp: file handle to be updated * @fhp: file handle to be updated
@ -280,22 +276,6 @@ static inline u64 nfsd4_change_attribute(struct kstat *stat,
extern void fh_fill_pre_attrs(struct svc_fh *fhp); extern void fh_fill_pre_attrs(struct svc_fh *fhp);
extern void fh_fill_post_attrs(struct svc_fh *fhp); extern void fh_fill_post_attrs(struct svc_fh *fhp);
#else /* !CONFIG_NFSD_V3 */
static inline void fh_clear_pre_post_attrs(struct svc_fh *fhp)
{
}
static inline void fh_fill_pre_attrs(struct svc_fh *fhp)
{
}
static inline void fh_fill_post_attrs(struct svc_fh *fhp)
{
}
#endif /* !CONFIG_NFSD_V3 */
/* /*
* Lock a file handle/inode * Lock a file handle/inode

View file

@ -117,9 +117,7 @@ static struct svc_stat nfsd_acl_svcstats = {
static const struct svc_version *nfsd_version[] = { static const struct svc_version *nfsd_version[] = {
[2] = &nfsd_version2, [2] = &nfsd_version2,
#if defined(CONFIG_NFSD_V3)
[3] = &nfsd_version3, [3] = &nfsd_version3,
#endif
#if defined(CONFIG_NFSD_V4) #if defined(CONFIG_NFSD_V4)
[4] = &nfsd_version4, [4] = &nfsd_version4,
#endif #endif

View file

@ -32,9 +32,7 @@
#include <linux/writeback.h> #include <linux/writeback.h>
#include <linux/security.h> #include <linux/security.h>
#ifdef CONFIG_NFSD_V3
#include "xdr3.h" #include "xdr3.h"
#endif /* CONFIG_NFSD_V3 */
#ifdef CONFIG_NFSD_V4 #ifdef CONFIG_NFSD_V4
#include "../internal.h" #include "../internal.h"
@ -626,7 +624,6 @@ __be32 nfsd4_vfs_fallocate(struct svc_rqst *rqstp, struct svc_fh *fhp,
} }
#endif /* defined(CONFIG_NFSD_V4) */ #endif /* defined(CONFIG_NFSD_V4) */
#ifdef CONFIG_NFSD_V3
/* /*
* Check server access rights to a file system object * Check server access rights to a file system object
*/ */
@ -738,7 +735,6 @@ nfsd_access(struct svc_rqst *rqstp, struct svc_fh *fhp, u32 *access, u32 *suppor
out: out:
return error; return error;
} }
#endif /* CONFIG_NFSD_V3 */
int nfsd_open_break_lease(struct inode *inode, int access) int nfsd_open_break_lease(struct inode *inode, int access)
{ {
@ -1138,7 +1134,6 @@ out:
return err; return err;
} }
#ifdef CONFIG_NFSD_V3
/** /**
* nfsd_commit - Commit pending writes to stable storage * nfsd_commit - Commit pending writes to stable storage
* @rqstp: RPC request being processed * @rqstp: RPC request being processed
@ -1216,7 +1211,6 @@ nfsd_commit(struct svc_rqst *rqstp, struct svc_fh *fhp, u64 offset,
out: out:
return err; return err;
} }
#endif /* CONFIG_NFSD_V3 */
static __be32 static __be32
nfsd_create_setattr(struct svc_rqst *rqstp, struct svc_fh *resfhp, nfsd_create_setattr(struct svc_rqst *rqstp, struct svc_fh *resfhp,
@ -1405,8 +1399,6 @@ nfsd_create(struct svc_rqst *rqstp, struct svc_fh *fhp,
rdev, resfhp); rdev, resfhp);
} }
#ifdef CONFIG_NFSD_V3
/* /*
* NFSv3 and NFSv4 version of nfsd_create * NFSv3 and NFSv4 version of nfsd_create
*/ */
@ -1572,7 +1564,6 @@ do_nfsd_create(struct svc_rqst *rqstp, struct svc_fh *fhp,
err = nfserrno(host_err); err = nfserrno(host_err);
goto out; goto out;
} }
#endif /* CONFIG_NFSD_V3 */
/* /*
* Read a symlink. On entry, *lenp must contain the maximum path length that * Read a symlink. On entry, *lenp must contain the maximum path length that

View file

@ -68,7 +68,6 @@ __be32 nfsd_create_locked(struct svc_rqst *, struct svc_fh *,
__be32 nfsd_create(struct svc_rqst *, struct svc_fh *, __be32 nfsd_create(struct svc_rqst *, struct svc_fh *,
char *name, int len, struct iattr *attrs, char *name, int len, struct iattr *attrs,
int type, dev_t rdev, struct svc_fh *res); int type, dev_t rdev, struct svc_fh *res);
#ifdef CONFIG_NFSD_V3
__be32 nfsd_access(struct svc_rqst *, struct svc_fh *, u32 *, u32 *); __be32 nfsd_access(struct svc_rqst *, struct svc_fh *, u32 *, u32 *);
__be32 do_nfsd_create(struct svc_rqst *, struct svc_fh *, __be32 do_nfsd_create(struct svc_rqst *, struct svc_fh *,
char *name, int len, struct iattr *attrs, char *name, int len, struct iattr *attrs,
@ -76,7 +75,6 @@ __be32 do_nfsd_create(struct svc_rqst *, struct svc_fh *,
u32 *verifier, bool *truncp, bool *created); u32 *verifier, bool *truncp, bool *created);
__be32 nfsd_commit(struct svc_rqst *rqst, struct svc_fh *fhp, __be32 nfsd_commit(struct svc_rqst *rqst, struct svc_fh *fhp,
u64 offset, u32 count, __be32 *verf); u64 offset, u32 count, __be32 *verf);
#endif /* CONFIG_NFSD_V3 */
#ifdef CONFIG_NFSD_V4 #ifdef CONFIG_NFSD_V4
__be32 nfsd_getxattr(struct svc_rqst *rqstp, struct svc_fh *fhp, __be32 nfsd_getxattr(struct svc_rqst *rqstp, struct svc_fh *fhp,
char *name, void **bufp, int *lenp); char *name, void **bufp, int *lenp);