From owner-svn-src-projects@freebsd.org Tue Apr 24 20:22:00 2018 Return-Path: Delivered-To: svn-src-projects@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6CEE6FB2287 for ; Tue, 24 Apr 2018 20:22:00 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 1AF466957A; Tue, 24 Apr 2018 20:22:00 +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 F0E4817F6B; Tue, 24 Apr 2018 20:21:59 +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 w3OKLxCS028973; Tue, 24 Apr 2018 20:21:59 GMT (envelope-from rmacklem@FreeBSD.org) Received: (from rmacklem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3OKLxtw028972; Tue, 24 Apr 2018 20:21:59 GMT (envelope-from rmacklem@FreeBSD.org) Message-Id: <201804242021.w3OKLxtw028972@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rmacklem set sender to rmacklem@FreeBSD.org using -f From: Rick Macklem Date: Tue, 24 Apr 2018 20:21:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org Subject: svn commit: r332969 - projects/pnfs-planb-server/sys/fs/nfsserver X-SVN-Group: projects X-SVN-Commit-Author: rmacklem X-SVN-Commit-Paths: projects/pnfs-planb-server/sys/fs/nfsserver X-SVN-Commit-Revision: 332969 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.25 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: Tue, 24 Apr 2018 20:22:00 -0000 Author: rmacklem Date: Tue Apr 24 20:21:59 2018 New Revision: 332969 URL: https://svnweb.freebsd.org/changeset/base/332969 Log: Add a sysctl called vfs.nfsd.flexlinuxhack which can be set non-zero to work around a Linux Flexible File Layout driver bug that causes it to use the synthetic user/group for "tightly coupled" servers like this one. Modified: projects/pnfs-planb-server/sys/fs/nfsserver/nfs_nfsdstate.c Modified: projects/pnfs-planb-server/sys/fs/nfsserver/nfs_nfsdstate.c ============================================================================== --- projects/pnfs-planb-server/sys/fs/nfsserver/nfs_nfsdstate.c Tue Apr 24 20:05:45 2018 (r332968) +++ projects/pnfs-planb-server/sys/fs/nfsserver/nfs_nfsdstate.c Tue Apr 24 20:21:59 2018 (r332969) @@ -105,6 +105,11 @@ SYSCTL_INT(_vfs_nfsd, OID_AUTO, pnfsstrictatime, CTLFL &nfsrv_pnfsatime, 0, "For pNFS service, do Getattr ops to keep atime up-to-date"); +int nfsrv_flexlinuxhack = 0; +SYSCTL_INT(_vfs_nfsd, OID_AUTO, flexlinuxhack, CTLFLAG_RW, + &nfsrv_flexlinuxhack, 0, + "For Linux clients, hack around Flex File Layout bug"); + /* * Hash lists for nfs V4. */ @@ -6432,13 +6437,15 @@ nfsrv_filelayout(struct nfsrv_descript *nd, int iomode } #define FLEX_OWNERID "999" +#define FLEX_UID0 "0" /* * Generate a Flex File Layout. * The FLEX_OWNERID can be any string of 3 decimal digits. Although this * string goes on the wire, it isn't supposed to be used by the client, * since this server uses tight coupling. - * The Linux Flexible File Layout client driver doesn't like a Null string - * for these. + * Although not recommended by the spec., if vfs.nfsd.flexlinuxhack=1 use + * a string of "0". This works around the Linux Flex File Layout driver bug + * which uses the synthetic uid/gid strings for the "tightly coupled" case. */ static struct nfslayout * nfsrv_flexlayout(struct nfsrv_descript *nd, int iomode, int mirrorcnt, @@ -6480,10 +6487,19 @@ nfsrv_flexlayout(struct nfsrv_descript *nd, int iomode NFSBCOPY(dsfhp, tl, sizeof(*dsfhp)); tl += (NFSM_RNDUP(NFSX_V4PNFSFH) / NFSX_UNSIGNED); dsfhp++; - *tl++ = txdr_unsigned(strlen(FLEX_OWNERID)); /* Any uid. */ - NFSBCOPY(FLEX_OWNERID, tl++, NFSX_UNSIGNED); - *tl++ = txdr_unsigned(strlen(FLEX_OWNERID)); /* Any gid. */ - NFSBCOPY(FLEX_OWNERID, tl++, NFSX_UNSIGNED); + if (nfsrv_flexlinuxhack != 0) { + *tl++ = txdr_unsigned(strlen(FLEX_UID0)); + *tl = 0; /* 0 pad string. */ + NFSBCOPY(FLEX_UID0, tl++, strlen(FLEX_UID0)); + *tl++ = txdr_unsigned(strlen(FLEX_UID0)); + *tl = 0; /* 0 pad string. */ + NFSBCOPY(FLEX_UID0, tl++, strlen(FLEX_UID0)); + } else { + *tl++ = txdr_unsigned(strlen(FLEX_OWNERID)); + NFSBCOPY(FLEX_OWNERID, tl++, NFSX_UNSIGNED); + *tl++ = txdr_unsigned(strlen(FLEX_OWNERID)); + NFSBCOPY(FLEX_OWNERID, tl++, NFSX_UNSIGNED); + } } *tl++ = txdr_unsigned(0); /* ff_flags. */ *tl = txdr_unsigned(60); /* Status interval hint. */ From owner-svn-src-projects@freebsd.org Thu Apr 26 22:15:07 2018 Return-Path: Delivered-To: svn-src-projects@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D2083FB9A55 for ; Thu, 26 Apr 2018 22:15:06 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7FD3A7540D; Thu, 26 Apr 2018 22:15:06 +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 7AC051E040; Thu, 26 Apr 2018 22:15:06 +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 w3QMF6p4044953; Thu, 26 Apr 2018 22:15:06 GMT (envelope-from rmacklem@FreeBSD.org) Received: (from rmacklem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3QMF6WX044951; Thu, 26 Apr 2018 22:15:06 GMT (envelope-from rmacklem@FreeBSD.org) Message-Id: <201804262215.w3QMF6WX044951@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rmacklem set sender to rmacklem@FreeBSD.org using -f From: Rick Macklem Date: Thu, 26 Apr 2018 22:15:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org Subject: svn commit: r333044 - in projects/pnfs-planb-server/sys/fs: nfs nfsclient X-SVN-Group: projects X-SVN-Commit-Author: rmacklem X-SVN-Commit-Paths: in projects/pnfs-planb-server/sys/fs: nfs nfsclient X-SVN-Commit-Revision: 333044 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.25 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: Thu, 26 Apr 2018 22:15:07 -0000 Author: rmacklem Date: Thu Apr 26 22:15:06 2018 New Revision: 333044 URL: https://svnweb.freebsd.org/changeset/base/333044 Log: Fix the NFSv4.1 pNFS fex file mirror client's setting of vfs.nfs.pnfsiothreads so that the default isn't "disabled". Setting it negative makes it use a default number of 4 * ncpus, whereas setting it to 0 disables the use of threads for mirror I/O. Modified: projects/pnfs-planb-server/sys/fs/nfs/nfs_commonport.c projects/pnfs-planb-server/sys/fs/nfsclient/nfs_clrpcops.c Modified: projects/pnfs-planb-server/sys/fs/nfs/nfs_commonport.c ============================================================================== --- projects/pnfs-planb-server/sys/fs/nfs/nfs_commonport.c Thu Apr 26 22:04:21 2018 (r333043) +++ projects/pnfs-planb-server/sys/fs/nfs/nfs_commonport.c Thu Apr 26 22:15:06 2018 (r333044) @@ -98,7 +98,7 @@ SYSCTL_INT(_vfs_nfs, OID_AUTO, debuglevel, CTLFLAG_RW, 0, "Debug level for NFS client"); SYSCTL_INT(_vfs_nfs, OID_AUTO, userhashsize, CTLFLAG_RDTUN, &nfsrv_lughashsize, 0, "Size of hash tables for uid/name mapping"); -int nfs_pnfsiothreads = 0; +int nfs_pnfsiothreads = -1; SYSCTL_INT(_vfs_nfs, OID_AUTO, pnfsiothreads, CTLFLAG_RW, &nfs_pnfsiothreads, 0, "Number of pNFS mirror I/O threads"); @@ -730,7 +730,7 @@ nfs_pnfsio(task_fn_t *func, void *context) pio = (struct pnfsio *)context; if (pnfsioq == NULL) { - if (nfs_pnfsiothreads == 0) + if (nfs_pnfsiothreads <= 0) nfs_pnfsiothreads = mp_ncpus * 4; pnfsioq = taskqueue_create("pnfsioq", M_WAITOK, taskqueue_thread_enqueue, &pnfsioq); Modified: projects/pnfs-planb-server/sys/fs/nfsclient/nfs_clrpcops.c ============================================================================== --- projects/pnfs-planb-server/sys/fs/nfsclient/nfs_clrpcops.c Thu Apr 26 22:04:21 2018 (r333043) +++ projects/pnfs-planb-server/sys/fs/nfsclient/nfs_clrpcops.c Thu Apr 26 22:15:06 2018 (r333044) @@ -6476,7 +6476,7 @@ nfsio_writedsmir(vnode_t vp, int *iomode, int *must_co drpc->p = p; drpc->inprog = 0; ret = EIO; - if (nfs_pnfsiothreads > 0) { + if (nfs_pnfsiothreads != 0) { ret = nfs_pnfsio(start_writedsmir, drpc); NFSCL_DEBUG(4, "nfsio_writedsmir: nfs_pnfsio=%d\n", ret); } @@ -6655,7 +6655,7 @@ nfsio_commitds(vnode_t vp, uint64_t offset, int cnt, s drpc->p = p; drpc->inprog = 0; ret = EIO; - if (nfs_pnfsiothreads > 0) { + if (nfs_pnfsiothreads != 0) { ret = nfs_pnfsio(start_commitds, drpc); NFSCL_DEBUG(4, "nfsio_commitds: nfs_pnfsio=%d\n", ret); }