Date: Sun, 20 Oct 2019 01:09:14 +0000 (UTC) From: Rick Macklem <rmacklem@FreeBSD.org> To: src-committers@freebsd.org, svn-src-projects@freebsd.org Subject: svn commit: r353772 - projects/nfsv42/sys/fs/nfsserver Message-ID: <201910200109.x9K19ETn097170@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: rmacklem Date: Sun Oct 20 01:09:14 2019 New Revision: 353772 URL: https://svnweb.freebsd.org/changeset/base/353772 Log: Replace the two sysctls with one to enable a Linux compatible NFSv4.2 server. To be compatible with the NFSv4.2 client shipping in the 5.n Linux kernel, two changes in behaviour are currently required. Replace the two sysctls that enable these with the single sysctl vfs.nfsd.linux42server to minimize confusion over what needs to be done to be Linux compatible. There may also be more of these behaviour changes that have not yet been found during interoperability testing with Linux. Modified: projects/nfsv42/sys/fs/nfsserver/nfs_nfsdserv.c Modified: projects/nfsv42/sys/fs/nfsserver/nfs_nfsdserv.c ============================================================================== --- projects/nfsv42/sys/fs/nfsserver/nfs_nfsdserv.c Sat Oct 19 21:44:33 2019 (r353771) +++ projects/nfsv42/sys/fs/nfsserver/nfs_nfsdserv.c Sun Oct 20 01:09:14 2019 (r353772) @@ -77,13 +77,10 @@ SYSCTL_INT(_vfs_nfsd, OID_AUTO, async, CTLFLAG_RW, &nf extern int nfsrv_doflexfile; SYSCTL_INT(_vfs_nfsd, OID_AUTO, default_flexfile, CTLFLAG_RW, &nfsrv_doflexfile, 0, "Make Flex File Layout the default for pNFS"); -static int nfsrv_linuxseekdata = 1; -SYSCTL_INT(_vfs_nfsd, OID_AUTO, linuxseekdata, CTLFLAG_RW, - &nfsrv_linuxseekdata, 0, "Return EINVAL for SEEK_DATA at EOF"); -static int nfsrv_checkcopysize = 0; -SYSCTL_INT(_vfs_nfsd, OID_AUTO, checkcopysize, CTLFLAG_RW, - &nfsrv_checkcopysize, 0, - "Enable check for Copy inoff + len > file_size"); +static int nfsrv_linux42server = 1; +SYSCTL_INT(_vfs_nfsd, OID_AUTO, linux42server, CTLFLAG_RW, + &nfsrv_linux42server, 0, + "Enable Linux style NFSv4.2 server (non-RFC compliant)"); /* * This list defines the GSS mechanisms supported. @@ -5359,15 +5356,15 @@ nfsrvd_copy_file_range(struct nfsrv_descript *nd, __un * leave len == 0. */ len = at.na_size - inoff; - } else if (nfsrv_checkcopysize != 0 && + } else if (nfsrv_linux42server == 0 && inoff + len > at.na_size) { /* * RFC-7862 says that NFSERR_INVAL must * be returned when inoff + len exceeds * the file size, however the NFSv4.2 * Linux client likes to do this, so - * only check if nfsrv_checkcopysize - * is set. + * only check if nfsrv_linux42server + * is not set. */ nd->nd_repstat = NFSERR_INVAL; } @@ -5480,7 +5477,7 @@ nfsrvd_seek(struct nfsrv_descript *nd, __unused int is nd->nd_cred, curthread); vrele(vp); if (nd->nd_repstat == 0 && eof && content == NFSV4CONTENT_DATA && - nfsrv_linuxseekdata != 0) + nfsrv_linux42server != 0) nd->nd_repstat = NFSERR_INVAL; if (nd->nd_repstat == 0) { NFSM_BUILD(tl, uint32_t *, NFSX_UNSIGNED + NFSX_HYPER);
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201910200109.x9K19ETn097170>