From owner-svn-src-projects@freebsd.org Sun Oct 20 01:09:15 2019 Return-Path: Delivered-To: svn-src-projects@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 2378C15B799 for ; Sun, 20 Oct 2019 01:09:15 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46whVz062tz3M8d; Sun, 20 Oct 2019 01:09:15 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C11392E59; Sun, 20 Oct 2019 01:09:14 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x9K19E4F097171; Sun, 20 Oct 2019 01:09:14 GMT (envelope-from rmacklem@FreeBSD.org) Received: (from rmacklem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x9K19ETn097170; Sun, 20 Oct 2019 01:09:14 GMT (envelope-from rmacklem@FreeBSD.org) Message-Id: <201910200109.x9K19ETn097170@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rmacklem set sender to rmacklem@FreeBSD.org using -f From: Rick Macklem Date: Sun, 20 Oct 2019 01:09:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org Subject: svn commit: r353772 - projects/nfsv42/sys/fs/nfsserver X-SVN-Group: projects X-SVN-Commit-Author: rmacklem X-SVN-Commit-Paths: projects/nfsv42/sys/fs/nfsserver X-SVN-Commit-Revision: 353772 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 20 Oct 2019 01:09:15 -0000 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);