Date: Tue, 24 Apr 2018 20:21:59 +0000 (UTC) From: Rick Macklem <rmacklem@FreeBSD.org> To: src-committers@freebsd.org, svn-src-projects@freebsd.org Subject: svn commit: r332969 - projects/pnfs-planb-server/sys/fs/nfsserver Message-ID: <201804242021.w3OKLxtw028972@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
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. */
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201804242021.w3OKLxtw028972>