On Wed, 2024-08-07 at 09:53 +1000, NeilBrown wrote: > > In "nfsd: don't allocate the versions array" I made the various arrays > of version information fixed-sized - except nfsd_version. > The size of nfsd_version was determined by CONFIG settings and could be > smaller than the index used by nfsd_support_version(). > > This patch makes it fixed-size. It should be squashed into the original. > > Signed-off-by: NeilBrown <neilb@xxxxxxx> > --- > fs/nfsd/nfssvc.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/fs/nfsd/nfssvc.c b/fs/nfsd/nfssvc.c > index 1cef09a3c78e..defc430f912f 100644 > --- a/fs/nfsd/nfssvc.c > +++ b/fs/nfsd/nfssvc.c > @@ -106,7 +106,7 @@ static struct svc_program nfsd_acl_program = { > > #endif /* defined(CONFIG_NFSD_V2_ACL) || defined(CONFIG_NFSD_V3_ACL) */ > > -static const struct svc_version *nfsd_version[] = { > +static const struct svc_version *nfsd_version[NFSD_MAXVERS+1] = { > #if defined(CONFIG_NFSD_V2) > [2] = &nfsd_version2, > #endif Reviewed-by: Jeff Layton <jlayton@xxxxxxxxxx>