diff --git a/SOURCES/nfs-utils-1.3.0-exportfs-rwro-display.patch b/SOURCES/nfs-utils-1.3.0-exportfs-rwro-display.patch new file mode 100644 index 0000000..bda51a4 --- /dev/null +++ b/SOURCES/nfs-utils-1.3.0-exportfs-rwro-display.patch @@ -0,0 +1,25 @@ +diff -up nfs-utils-1.3.0/support/nfs/exports.c.orig nfs-utils-1.3.0/support/nfs/exports.c +--- nfs-utils-1.3.0/support/nfs/exports.c.orig 2018-07-10 13:49:12.978210878 -0400 ++++ nfs-utils-1.3.0/support/nfs/exports.c 2018-07-10 13:50:44.057806104 -0400 +@@ -197,6 +197,7 @@ static const struct secinfo_flag_display + const char *set; + const char *unset; + } secinfo_flag_displaymap[] = { ++ { NFSEXP_READONLY, "ro", "rw" }, + { NFSEXP_INSECURE_PORT, "insecure", "secure" }, + { NFSEXP_ROOTSQUASH, "root_squash", "no_root_squash" }, + { NFSEXP_ALLSQUASH, "all_squash", "no_all_squash" }, +diff -up nfs-utils-1.3.0/utils/exportfs/exportfs.c.orig nfs-utils-1.3.0/utils/exportfs/exportfs.c +--- nfs-utils-1.3.0/utils/exportfs/exportfs.c.orig 2018-07-10 13:49:12.960210562 -0400 ++++ nfs-utils-1.3.0/utils/exportfs/exportfs.c 2018-07-10 13:50:44.058806122 -0400 +@@ -756,10 +756,6 @@ dump(int verbose, int export_format) + continue; + } + c = '('; +- if (ep->e_flags & NFSEXP_READONLY) +- c = dumpopt(c, "ro"); +- else +- c = dumpopt(c, "rw"); + if (ep->e_flags & NFSEXP_ASYNC) + c = dumpopt(c, "async"); + else diff --git a/SOURCES/nfs-utils-1.3.0-mount-clientaddr.patch b/SOURCES/nfs-utils-1.3.0-mount-clientaddr.patch new file mode 100644 index 0000000..8a9a2af --- /dev/null +++ b/SOURCES/nfs-utils-1.3.0-mount-clientaddr.patch @@ -0,0 +1,128 @@ +diff -up nfs-utils-1.3.0/utils/mount/network.c.orig nfs-utils-1.3.0/utils/mount/network.c +--- nfs-utils-1.3.0/utils/mount/network.c.orig 2018-07-30 14:14:01.242771732 -0400 ++++ nfs-utils-1.3.0/utils/mount/network.c 2018-07-30 14:15:36.918075978 -0400 +@@ -44,6 +44,8 @@ + #include + #include + #include ++#include ++#include + + #include "sockaddr.h" + #include "xcommon.h" +@@ -1736,3 +1738,48 @@ int nfs_umount_do_umnt(struct mount_opti + + return EX_SUCCESS; + } ++ ++int nfs_is_inaddr_any(struct sockaddr *nfs_saddr) ++{ ++ switch (nfs_saddr->sa_family) { ++ case AF_INET: { ++ if (((struct sockaddr_in *)nfs_saddr)->sin_addr.s_addr == ++ INADDR_ANY) ++ return 1; ++ break; ++ } ++ case AF_INET6: ++ if (!memcmp(&((struct sockaddr_in6 *)nfs_saddr)->sin6_addr, ++ &in6addr_any, sizeof(in6addr_any))) ++ return 1; ++ break; ++ } ++ return 0; ++} ++ ++int nfs_addr_matches_localips(struct sockaddr *nfs_saddr) ++{ ++ struct ifaddrs *myaddrs, *ifa; ++ int found = 0; ++ ++ /* acquire exiting network interfaces */ ++ if (getifaddrs(&myaddrs) != 0) ++ return 0; ++ ++ /* interate over the available interfaces and check if we ++ * we find a match to the supplied clientaddr value ++ */ ++ for (ifa = myaddrs; ifa != NULL; ifa = ifa->ifa_next) { ++ if (ifa->ifa_addr == NULL) ++ continue; ++ if (!(ifa->ifa_flags & IFF_UP)) ++ continue; ++ if (!memcmp(ifa->ifa_addr, nfs_saddr, ++ sizeof(struct sockaddr))) { ++ found = 1; ++ break; ++ } ++ } ++ freeifaddrs(myaddrs); ++ return found; ++} +diff -up nfs-utils-1.3.0/utils/mount/network.h.orig nfs-utils-1.3.0/utils/mount/network.h +--- nfs-utils-1.3.0/utils/mount/network.h.orig 2018-07-30 14:14:01.242771732 -0400 ++++ nfs-utils-1.3.0/utils/mount/network.h 2018-07-30 14:15:36.918075978 -0400 +@@ -54,6 +54,8 @@ int nfs_callback_address(const struct so + int clnt_ping(struct sockaddr_in *, const unsigned long, + const unsigned long, const unsigned int, + struct sockaddr_in *); ++int nfs_is_inaddr_any(struct sockaddr *); ++int nfs_addr_matches_localips(struct sockaddr *); + + struct mount_options; + +diff -up nfs-utils-1.3.0/utils/mount/nfs.man.orig nfs-utils-1.3.0/utils/mount/nfs.man +--- nfs-utils-1.3.0/utils/mount/nfs.man.orig 2018-07-30 14:14:01.240771705 -0400 ++++ nfs-utils-1.3.0/utils/mount/nfs.man 2018-07-30 14:15:43.365163864 -0400 +@@ -825,6 +825,9 @@ to perform NFS version 4.0 callback requ + files on this mount point. If the server is unable to + establish callback connections to clients, performance + may degrade, or accesses to files may temporarily hang. ++Can specify a value of IPv4_ANY (0.0.0.0) or equivalent ++IPv6 any address which will signal to the NFS server that ++this NFS client does not want delegations. + .IP + If this option is not specified, the + .BR mount (8) +diff -up nfs-utils-1.3.0/utils/mount/stropts.c.orig nfs-utils-1.3.0/utils/mount/stropts.c +--- nfs-utils-1.3.0/utils/mount/stropts.c.orig 2018-07-30 14:14:01.243771746 -0400 ++++ nfs-utils-1.3.0/utils/mount/stropts.c 2018-07-30 14:15:36.918075978 -0400 +@@ -229,7 +229,8 @@ static int nfs_append_addr_option(const + + /* + * Called to discover our address and append an appropriate 'clientaddr=' +- * option to the options string. ++ * option to the options string. If the supplied 'clientaddr=' value does ++ * not match either IPV4/IPv6 any or a local address, then fail the mount. + * + * Returns 1 if 'clientaddr=' option created successfully or if + * 'clientaddr=' option is already present; otherwise zero. +@@ -242,8 +243,27 @@ static int nfs_append_clientaddr_option( + struct sockaddr *my_addr = &address.sa; + socklen_t my_len = sizeof(address); + +- if (po_contains(options, "clientaddr") == PO_FOUND) ++ if (po_contains(options, "clientaddr") == PO_FOUND) { ++ char *addr = po_get(options, "clientaddr"); ++ union nfs_sockaddr nfs_address; ++ struct sockaddr *nfs_saddr = &nfs_address.sa; ++ socklen_t nfs_salen = sizeof(nfs_address); ++ ++ /* translate the input for clientaddr to nfs_sockaddr */ ++ if (!nfs_string_to_sockaddr(addr, nfs_saddr, &nfs_salen)) ++ return 0; ++ ++ /* check for IPV4_ANY and IPV6_ANY */ ++ if (nfs_is_inaddr_any(nfs_saddr)) ++ return 1; ++ ++ /* check if ip matches local network addresses */ ++ if (!nfs_addr_matches_localips(nfs_saddr)) ++ nfs_error(_("%s: [warning] supplied clientaddr=%s " ++ "does not match any existing network " ++ "addresses"), progname, addr); + return 1; ++ } + + nfs_callback_address(sap, salen, my_addr, &my_len); + diff --git a/SOURCES/nfs-utils-1.3.0-mount-nfsvers.patch b/SOURCES/nfs-utils-1.3.0-mount-nfsvers.patch new file mode 100644 index 0000000..c100856 --- /dev/null +++ b/SOURCES/nfs-utils-1.3.0-mount-nfsvers.patch @@ -0,0 +1,36 @@ +diff -up nfs-utils-1.3.0/utils/mount/configfile.c.orig nfs-utils-1.3.0/utils/mount/configfile.c +--- nfs-utils-1.3.0/utils/mount/configfile.c.orig 2017-10-05 11:44:08.775077208 -0400 ++++ nfs-utils-1.3.0/utils/mount/configfile.c 2017-10-05 11:49:50.811349443 -0400 +@@ -70,6 +70,7 @@ struct mnt_alias { + {"background", "bg", MNT_NOARG}, + {"foreground", "fg", MNT_NOARG}, + {"sloppy", "sloppy", MNT_NOARG}, ++ {"nfsvers", "vers", MNT_UNSET}, + }; + int mnt_alias_sz = (sizeof(mnt_alias_tab)/sizeof(mnt_alias_tab[0])); + +@@ -296,20 +297,21 @@ conf_parse_mntopts(char *section, char * + + list = conf_get_tag_list(section, arg); + TAILQ_FOREACH(node, &list->fields, link) { ++ /* check first if this is an alias for another option */ ++ field = mountopts_alias(node->field, &argtype); + /* + * Do not overwrite options if already exists + */ +- snprintf(buf, BUFSIZ, "%s=", node->field); ++ snprintf(buf, BUFSIZ, "%s=", field); + if (opts && strcasestr(opts, buf) != NULL) + continue; + +- if (lookup_entry(node->field) != NULL) ++ if (lookup_entry(field) != NULL) + continue; + buf[0] = '\0'; + value = conf_get_section(section, arg, node->field); + if (value == NULL) + continue; +- field = mountopts_alias(node->field, &argtype); + if (strcasecmp(value, "false") == 0) { + if (argtype != MNT_NOARG) + snprintf(buf, BUFSIZ, "no%s", field); diff --git a/SOURCES/nfs-utils-1.3.0-mount-turnoffv4.patch b/SOURCES/nfs-utils-1.3.0-mount-turnoffv4.patch new file mode 100644 index 0000000..a6f5b42 --- /dev/null +++ b/SOURCES/nfs-utils-1.3.0-mount-turnoffv4.patch @@ -0,0 +1,280 @@ +diff -up nfs-utils-1.3.0/support/include/nfs/nfs.h.orig nfs-utils-1.3.0/support/include/nfs/nfs.h +--- nfs-utils-1.3.0/support/include/nfs/nfs.h.orig 2018-08-20 14:18:13.975034097 -0400 ++++ nfs-utils-1.3.0/support/include/nfs/nfs.h 2018-08-20 14:18:29.624303893 -0400 +@@ -16,8 +16,8 @@ + #define NFSD_MINVERS 2 + #define NFSD_MAXVERS 4 + +-#define NFS4_MINMINOR 1 +-#define NFS4_MAXMINOR WORD_BIT ++#define NFS4_MINMINOR 0 ++#define NFS4_MAXMINOR (WORD_BIT-1) + + struct nfs_fh_len { + int fh_size; +@@ -49,16 +49,19 @@ struct nfs_fh_old { + #define NFSCTL_TCPBIT (1 << (18 - 1)) + + #define NFSCTL_VERUNSET(_cltbits, _v) ((_cltbits) &= ~(1 << ((_v) - 1))) ++#define NFSCTL_MINORUNSET(_cltbits, _v) ((_cltbits) &= ~(1 << (_v))) + #define NFSCTL_UDPUNSET(_cltbits) ((_cltbits) &= ~NFSCTL_UDPBIT) + #define NFSCTL_TCPUNSET(_cltbits) ((_cltbits) &= ~NFSCTL_TCPBIT) + + #define NFSCTL_VERISSET(_cltbits, _v) ((_cltbits) & (1 << ((_v) - 1))) ++#define NFSCTL_MINORISSET(_cltbits, _v) ((_cltbits) & (1 << (_v))) + #define NFSCTL_UDPISSET(_cltbits) ((_cltbits) & NFSCTL_UDPBIT) + #define NFSCTL_TCPISSET(_cltbits) ((_cltbits) & NFSCTL_TCPBIT) + + #define NFSCTL_VERDEFAULT (0xc) /* versions 3 and 4 */ + #define NFSCTL_MINDEFAULT (0x7) /* minor versions 4.1 and 4.2 */ + #define NFSCTL_VERSET(_cltbits, _v) ((_cltbits) |= (1 << ((_v) - 1))) ++#define NFSCTL_MINORSET(_cltbits, _v) ((_cltbits) |= (1 << (_v))) + #define NFSCTL_UDPSET(_cltbits) ((_cltbits) |= NFSCTL_UDPBIT) + #define NFSCTL_TCPSET(_cltbits) ((_cltbits) |= NFSCTL_TCPBIT) + +diff -up nfs-utils-1.3.0/utils/nfsd/nfsd.c.orig nfs-utils-1.3.0/utils/nfsd/nfsd.c +--- nfs-utils-1.3.0/utils/nfsd/nfsd.c.orig 2018-08-20 14:18:13.975034097 -0400 ++++ nfs-utils-1.3.0/utils/nfsd/nfsd.c 2018-08-20 14:18:58.023793505 -0400 +@@ -66,10 +66,12 @@ main(int argc, char **argv) + int socket_up = 0; + unsigned int minorvers = NFSCTL_MINDEFAULT; + unsigned int minorversset = NFSCTL_MINDEFAULT; ++ unsigned int minormask = 0; + unsigned int versbits = NFSCTL_VERDEFAULT; + unsigned int protobits = NFSCTL_ALLBITS; + int grace = -1; + int lease = -1; ++ int force4dot0 = 0; + + progname = basename(argv[0]); + haddr = xmalloc(sizeof(char *)); +@@ -103,6 +105,8 @@ main(int argc, char **argv) + else + NFSCTL_VERUNSET(versbits, i); + } ++ ++ nfssvc_get_minormask(&minormask); + /* We assume the kernel will default all minor versions to 'on', + * and allow the config file to disable some. + */ +@@ -118,12 +122,16 @@ main(int argc, char **argv) + * (i.e. don't set the bit in minorversset). + */ + if (!conf_get_bool("nfsd", tag, 1)) { +- NFSCTL_VERSET(minorversset, i); +- NFSCTL_VERUNSET(minorvers, i); ++ NFSCTL_MINORSET(minorversset, i); ++ NFSCTL_MINORUNSET(minorvers, i); ++ if (i == 0) ++ force4dot0 = 1; + } + if (conf_get_bool("nfsd", tag, 0)) { +- NFSCTL_VERSET(minorversset, i); +- NFSCTL_VERSET(minorvers, i); ++ NFSCTL_MINORSET(minorversset, i); ++ NFSCTL_MINORSET(minorvers, i); ++ if (i == 0) ++ force4dot0 = 1; + } + } + +@@ -178,13 +186,19 @@ main(int argc, char **argv) + case 4: + if (*p == '.') { + int i = atoi(p+1); +- if (i < NFS4_MINMINOR || i > NFS4_MAXMINOR) { ++ if (i < 0 || i > NFS4_MAXMINOR) { + fprintf(stderr, "%s: unsupported minor version\n", optarg); + exit(1); + } +- NFSCTL_VERSET(minorversset, i); +- NFSCTL_VERUNSET(minorvers, i); +- break; ++ NFSCTL_MINORSET(minorversset, i); ++ NFSCTL_MINORUNSET(minorvers, i); ++ if (i == 0) ++ force4dot0 = 1; ++ if (minorvers != 0) ++ break; ++ } else { ++ minorvers = 0; ++ minorversset = minormask; + } + case 3: + case 2: +@@ -200,14 +214,16 @@ main(int argc, char **argv) + case 4: + if (*p == '.') { + int i = atoi(p+1); +- if (i < NFS4_MINMINOR || i > NFS4_MAXMINOR) { ++ if (i < 0 || i > NFS4_MAXMINOR) { + fprintf(stderr, "%s: unsupported minor version\n", optarg); + exit(1); + } +- NFSCTL_VERSET(minorversset, i); +- NFSCTL_VERSET(minorvers, i); +- break; +- } ++ NFSCTL_MINORSET(minorversset, i); ++ NFSCTL_MINORSET(minorvers, i); ++ if (i == 0) ++ force4dot0 = 1; ++ } else ++ minorvers = minorversset = minormask; + case 3: + case 2: + NFSCTL_VERSET(versbits, c); +@@ -305,7 +321,7 @@ main(int argc, char **argv) + * Timeouts must also be set before ports are created else we get + * EBUSY. + */ +- nfssvc_setvers(versbits, minorvers, minorversset); ++ nfssvc_setvers(versbits, minorvers, minorversset, force4dot0); + if (grace > 0) + nfssvc_set_time("grace", grace); + if (lease > 0) +diff -up nfs-utils-1.3.0/utils/nfsd/nfsd.man.orig nfs-utils-1.3.0/utils/nfsd/nfsd.man +--- nfs-utils-1.3.0/utils/nfsd/nfsd.man.orig 2018-08-20 14:18:13.934033391 -0400 ++++ nfs-utils-1.3.0/utils/nfsd/nfsd.man 2018-08-20 14:18:29.625303910 -0400 +@@ -57,7 +57,7 @@ This option can be used to request that + .B rpc.nfsd + does not offer certain versions of NFS. The current version of + .B rpc.nfsd +-can support major NFS versions 2,3,4 and the minor versions 4.1 and 4.2. ++can support major NFS versions 2,3,4 and the minor versions 4.0, 4.1 and 4.2. + .TP + .B \-s " or " \-\-syslog + By default, +@@ -82,7 +82,7 @@ This option can be used to request that + .B rpc.nfsd + offer certain versions of NFS. The current version of + .B rpc.nfsd +-can support major NFS versions 2,3,4 and the minor versions 4.1 and 4.2. ++can support major NFS versions 2,3,4 and the minor versions 4.0, 4.1 and 4.2. + .TP + .B \-L " or " \-\-lease-time seconds + Set the lease-time used for NFSv4. This corresponds to how often +diff -up nfs-utils-1.3.0/utils/nfsd/nfssvc.c.orig nfs-utils-1.3.0/utils/nfsd/nfssvc.c +--- nfs-utils-1.3.0/utils/nfsd/nfssvc.c.orig 2018-08-20 14:18:13.963033891 -0400 ++++ nfs-utils-1.3.0/utils/nfsd/nfssvc.c 2018-08-20 14:18:58.023793505 -0400 +@@ -24,6 +24,7 @@ + #include "nfslib.h" + #include "xlog.h" + #include "nfssvc.h" ++#include "../mount/version.h" + + #ifndef NFSD_FS_DIR + #define NFSD_FS_DIR "/proc/fs/nfsd" +@@ -333,36 +334,81 @@ nfssvc_set_time(const char *type, const + } + + void +-nfssvc_setvers(unsigned int ctlbits, unsigned int minorvers, unsigned int minorversset) ++nfssvc_get_minormask(unsigned int *mask) ++{ ++ int fd; ++ char *ptr = buf; ++ ssize_t size; ++ ++ fd = open(NFSD_VERS_FILE, O_RDONLY); ++ if (fd < 0) ++ return; ++ ++ size = read(fd, buf, sizeof(buf)); ++ if (size < 0) { ++ xlog(L_ERROR, "Getting versions failed: errno %d (%m)", errno); ++ goto out; ++ } ++ ptr[size] = '\0'; ++ for (;;) { ++ unsigned vers, minor = 0; ++ char *token = strtok(ptr, " "); ++ ++ if (!token) ++ break; ++ ptr = NULL; ++ if (*token != '+' && *token != '-') ++ continue; ++ if (sscanf(++token, "%u.%u", &vers, &minor) > 0 && ++ vers == 4 && minor <= NFS4_MAXMINOR) ++ NFSCTL_MINORSET(*mask, minor); ++ } ++out: ++ close(fd); ++ return; ++} ++ ++static int ++nfssvc_print_vers(char *ptr, unsigned size, unsigned vers, unsigned minorvers, ++ int isset, int force4dot0) ++{ ++ char sign = isset ? '+' : '-'; ++ if (minorvers == 0) ++ if (linux_version_code() < MAKE_VERSION(4, 11, 0) || !force4dot0) ++ return snprintf(ptr, size, "%c%u ", sign, vers); ++ return snprintf(ptr, size, "%c%u.%u ", sign, vers, minorvers); ++} ++ ++void ++nfssvc_setvers(unsigned int ctlbits, unsigned int minorvers, unsigned int minorversset, ++ int force4dot0) + { + int fd, n, off; +- char *ptr; + +- ptr = buf; + off = 0; + fd = open(NFSD_VERS_FILE, O_WRONLY); + if (fd < 0) + return; + +- for (n = NFS4_MINMINOR; n <= NFS4_MAXMINOR; n++) { +- if (NFSCTL_VERISSET(minorversset, n)) { +- if (NFSCTL_VERISSET(minorvers, n)) +- off += snprintf(ptr+off, sizeof(buf) - off, "+4.%d ", n); +- else +- off += snprintf(ptr+off, sizeof(buf) - off, "-4.%d ", n); +- } +- } +- for (n = NFSD_MINVERS; n <= NFSD_MAXVERS; n++) { +- if (NFSCTL_VERISSET(ctlbits, n)) +- off += snprintf(ptr+off, sizeof(buf) - off, "+%d ", n); +- else +- off += snprintf(ptr+off, sizeof(buf) - off, "-%d ", n); ++ for (n = NFSD_MINVERS; n <= ((NFSD_MAXVERS < 3) ? NFSD_MAXVERS : 3); n++) ++ off += nfssvc_print_vers(&buf[off], sizeof(buf) - off, ++ n, 0, NFSCTL_VERISSET(ctlbits, n), 0); ++ ++ for (n = 0; n <= NFS4_MAXMINOR; n++) { ++ if (!NFSCTL_MINORISSET(minorversset, n)) ++ continue; ++ off += nfssvc_print_vers(&buf[off], sizeof(buf) - off, ++ 4, n, NFSCTL_MINORISSET(minorvers, n), ++ (n == 0) ? force4dot0 : 0); + } ++ if (!off--) ++ goto out; ++ buf[off] = '\0'; + xlog(D_GENERAL, "Writing version string to kernel: %s", buf); +- snprintf(ptr+off, sizeof(buf) - off, "\n"); ++ snprintf(&buf[off], sizeof(buf) - off, "\n"); + if (write(fd, buf, strlen(buf)) != (ssize_t)strlen(buf)) + xlog(L_ERROR, "Setting version failed: errno %d (%m)", errno); +- ++out: + close(fd); + + return; +diff -up nfs-utils-1.3.0/utils/nfsd/nfssvc.h.orig nfs-utils-1.3.0/utils/nfsd/nfssvc.h +--- nfs-utils-1.3.0/utils/nfsd/nfssvc.h.orig 2018-08-20 14:18:13.934033391 -0400 ++++ nfs-utils-1.3.0/utils/nfsd/nfssvc.h 2018-08-20 14:18:58.023793505 -0400 +@@ -26,5 +26,7 @@ int nfssvc_set_sockets(const unsigned in + const char *host, const char *port); + void nfssvc_set_time(const char *type, const int seconds); + int nfssvc_set_rdmaport(const char *port); +-void nfssvc_setvers(unsigned int ctlbits, unsigned int minorvers4, unsigned int minorvers4set); +-int nfssvc_threads(unsigned short port, int nrservs); ++void nfssvc_setvers(unsigned int ctlbits, unsigned int minorvers4, ++ unsigned int minorvers4set, int force4dot0); ++int nfssvc_threads(unsigned short port, int nrservs); ++void nfssvc_get_minormask(unsigned int *mask); diff --git a/SOURCES/nfs-utils-1.3.0-mountstats-rdma.patch b/SOURCES/nfs-utils-1.3.0-mountstats-rdma.patch new file mode 100644 index 0000000..bbc6475 --- /dev/null +++ b/SOURCES/nfs-utils-1.3.0-mountstats-rdma.patch @@ -0,0 +1,259 @@ +diff -up nfs-utils-1.3.0/tools/mountstats/mountstats.man.orig nfs-utils-1.3.0/tools/mountstats/mountstats.man +--- nfs-utils-1.3.0/tools/mountstats/mountstats.man.orig 2018-06-11 10:10:22.450171982 -0400 ++++ nfs-utils-1.3.0/tools/mountstats/mountstats.man 2018-06-11 10:11:00.756778817 -0400 +@@ -19,6 +19,8 @@ mountstats \- Displays various NFS clien + .RB [ \-r | \-\-rpc ] + | + .RB [ \-R | \-\-raw ] ++| ++.RB [ \-x | \-\-xprt ] + ] + .RI [ mountpoint ] ... + .P +@@ -110,6 +112,9 @@ Display only the raw statistics. This i + and + .BR \-S | \-\-since + options. ++.TP ++.B \-x, \-\-xprt ++Display only the transport statistics + .SS Options specific to the iostat sub-command + .IP "\fIinterval\fP" + Specifies the amount of time in seconds between each report. The first report contains statistics for the time since each file system was mounted. Each subsequent report contains statistics collected during the interval since the previous report. This may not be used with the +diff -up nfs-utils-1.3.0/tools/mountstats/mountstats.py.orig nfs-utils-1.3.0/tools/mountstats/mountstats.py +--- nfs-utils-1.3.0/tools/mountstats/mountstats.py.orig 2018-06-11 10:10:22.501172790 -0400 ++++ nfs-utils-1.3.0/tools/mountstats/mountstats.py 2018-06-11 10:11:00.757778833 -0400 +@@ -87,7 +87,10 @@ XprtUdpCounters = [ + 'rpcreceives', + 'badxids', + 'inflightsends', +- 'backlogutil' ++ 'backlogutil', ++ 'maxslots', ++ 'sendutil', ++ 'pendutil' + ] + + XprtTcpCounters = [ +@@ -100,7 +103,10 @@ XprtTcpCounters = [ + 'rpcreceives', + 'badxids', + 'inflightsends', +- 'backlogutil' ++ 'backlogutil', ++ 'maxslots', ++ 'sendutil', ++ 'pendutil' + ] + + XprtRdmaCounters = [ +@@ -112,17 +118,25 @@ XprtRdmaCounters = [ + 'rpcsends', + 'rpcreceives', + 'badxids', ++ 'inflightsends', + 'backlogutil', +- 'read_chunks', +- 'write_chunks', +- 'reply_chunks', ++ 'read_segments', ++ 'write_segments', ++ 'reply_segments', + 'total_rdma_req', + 'total_rdma_rep', + 'pullup', + 'fixup', + 'hardway', + 'failed_marshal', +- 'bad_reply' ++ 'bad_reply', ++ 'nomsg_calls', ++ 'recovered_mrs', ++ 'orphaned_mrs', ++ 'allocated_mrs', ++ 'local_invalidates', ++ 'empty_sendctx_q', ++ 'reply_waits_for_send', + ] + + Nfsv3ops = [ +@@ -266,17 +280,20 @@ class DeviceData: + if words[1] == 'udp': + i = 2 + for key in XprtUdpCounters: +- self.__rpc_data[key] = int(words[i]) ++ if i < len(words): ++ self.__rpc_data[key] = int(words[i]) + i += 1 + elif words[1] == 'tcp': + i = 2 + for key in XprtTcpCounters: +- self.__rpc_data[key] = int(words[i]) ++ if i < len(words): ++ self.__rpc_data[key] = int(words[i]) + i += 1 + elif words[1] == 'rdma': + i = 2 + for key in XprtRdmaCounters: +- self.__rpc_data[key] = int(words[i]) ++ if i < len(words): ++ self.__rpc_data[key] = int(words[i]) + i += 1 + elif words[0] == 'per-op': + self.__rpc_data['per-op'] = words +@@ -354,12 +371,11 @@ class DeviceData: + def display_stats_header(self): + print('Stats for %s mounted on %s:' % \ + (self.__nfs_data['export'], self.__nfs_data['mountpoint'])) ++ print() + + def display_nfs_options(self): + """Pretty-print the NFS options + """ +- self.display_stats_header() +- + print(' NFS mount options: %s' % ','.join(self.__nfs_data['mountoptions'])) + print(' NFS server capabilities: %s' % ','.join(self.__nfs_data['servercapabilities'])) + if 'nfsv4flags' in self.__nfs_data: +@@ -425,7 +441,6 @@ class DeviceData: + """ + sends = self.__rpc_data['rpcsends'] + +- print() + print('RPC statistics:') + + print(' %d RPC requests sent, %d RPC replies received (%d XIDs not found)' % \ +@@ -643,6 +658,83 @@ class DeviceData: + self.__print_rpc_op_stats('WRITE', sample_time) + sys.stdout.flush() + ++ def display_xprt_stats(self): ++ """Pretty-print the xprt statistics ++ """ ++ if self.__rpc_data['protocol'] == 'udp': ++ print('\tTransport protocol: udp') ++ print('\tSource port: %d' % self.__rpc_data['port']) ++ print('\tBind count: %d' % self.__rpc_data['bind_count']) ++ print('\tRPC requests: %d' % self.__rpc_data['rpcsends']) ++ print('\tRPC replies: %d' % self.__rpc_data['rpcreceives']) ++ print('\tXIDs not found: %d' % self.__rpc_data['badxids']) ++ print('\tMax slots: %d' % self.__rpc_data['maxslots']) ++ if self.__rpc_data['rpcsends'] != 0: ++ print('\tAvg backlog length: %d' % \ ++ (float(self.__rpc_data['backlogutil']) / self.__rpc_data['rpcsends'])) ++ print('\tAvg send queue length: %d' % \ ++ (float(self.__rpc_data['sendutil']) / self.__rpc_data['rpcsends'])) ++ print('\tAvg pending queue length: %d' % \ ++ (float(self.__rpc_data['pendutil']) / self.__rpc_data['rpcsends'])) ++ elif self.__rpc_data['protocol'] == 'tcp': ++ print('\tTransport protocol: tcp') ++ print('\tSource port: %d' % self.__rpc_data['port']) ++ print('\tBind count: %d' % self.__rpc_data['bind_count']) ++ print('\tConnect count: %d' % self.__rpc_data['connect_count']) ++ print('\tConnect time: %d seconds' % self.__rpc_data['connect_time']) ++ print('\tIdle time: %d seconds' % self.__rpc_data['idle_time']) ++ print('\tRPC requests: %d' % self.__rpc_data['rpcsends']) ++ print('\tRPC replies: %d' % self.__rpc_data['rpcreceives']) ++ print('\tXIDs not found: %d' % self.__rpc_data['badxids']) ++ print('\tMax slots: %d' % self.__rpc_data['maxslots']) ++ if self.__rpc_data['rpcsends'] != 0: ++ print('\tAvg backlog length: %d' % \ ++ (float(self.__rpc_data['backlogutil']) / self.__rpc_data['rpcsends'])) ++ print('\tAvg send queue length: %d' % \ ++ (float(self.__rpc_data['sendutil']) / self.__rpc_data['rpcsends'])) ++ print('\tAvg pending queue length: %d' % \ ++ (float(self.__rpc_data['pendutil']) / self.__rpc_data['rpcsends'])) ++ elif self.__rpc_data['protocol'] == 'rdma': ++ print('\tTransport protocol: rdma') ++ print('\tConnect count: %d' % self.__rpc_data['connect_count']) ++ print('\tConnect time: %d seconds' % self.__rpc_data['connect_time']) ++ print('\tIdle time: %d seconds' % self.__rpc_data['idle_time']) ++ sends = self.__rpc_data['rpcsends'] ++ print('\tRPC requests: %d' % self.__rpc_data['rpcsends']) ++ print('\tRPC replies: %d' % self.__rpc_data['rpcreceives']) ++ print('\tXIDs not found: %d' % self.__rpc_data['badxids']) ++ if self.__rpc_data['rpcsends'] != 0: ++ print('\tAvg backlog length: %d' % \ ++ (float(self.__rpc_data['backlogutil']) / self.__rpc_data['rpcsends'])) ++ print('\tRead segments: %d' % self.__rpc_data['read_segments']) ++ print('\tWrite segments: %d' % self.__rpc_data['write_segments']) ++ print('\tReply segments: %d' % self.__rpc_data['reply_segments']) ++ print('\tRegistered: %d bytes' % self.__rpc_data['total_rdma_req']) ++ print('\tRDMA received: %d bytes' % self.__rpc_data['total_rdma_rep']) ++ print('\tTotal pull-up: %d bytes' % self.__rpc_data['pullup']) ++ print('\tTotal fix-up: %d bytes' % self.__rpc_data['fixup']) ++ print('\tHardway allocations: %d bytes' % self.__rpc_data['hardway']) ++ print('\tFailed marshals: %d' % self.__rpc_data['failed_marshal']) ++ print('\tBad replies: %d' % self.__rpc_data['bad_reply']) ++ ++ """ Counters not present in all kernels """ ++ if 'nomsg_calls' in self.__rpc_data: ++ print('\tRDMA_NOMSG calls: %d' % self.__rpc_data['nomsg_calls']) ++ if 'allocated_mrs' in self.__rpc_data: ++ print('\tAllocated MRs: %d' % self.__rpc_data['allocated_mrs']) ++ if 'recovered_mrs' in self.__rpc_data: ++ print('\tRecovered MRs: %d' % self.__rpc_data['recovered_mrs']) ++ if 'orphaned_mrs' in self.__rpc_data: ++ print('\tOrphaned MRs: %d' % self.__rpc_data['orphaned_mrs']) ++ if 'local_invalidates' in self.__rpc_data: ++ print('\tLocal Invalidates needed: %d' % self.__rpc_data['local_invalidates']) ++ if 'empty_sendctx_q' in self.__rpc_data: ++ print('\tEmpty sendctx queue count: %d' % self.__rpc_data['empty_sendctx_q']) ++ if 'reply_waits_for_send' in self.__rpc_data: ++ print('\tReplies that waited for Send completion: %d' % self.__rpc_data['reply_waits_for_send']) ++ else: ++ raise Exception('Unknown RPC transport protocol %s' % self.__rpc_data['protocol']) ++ + def parse_stats_file(f): + """pop the contents of a mountstats file into a dictionary, + keyed by mount point. each value object is a list of the +@@ -669,8 +761,9 @@ def parse_stats_file(f): + + return ms_dict + +-def print_mountstats(stats, nfs_only, rpc_only, raw): ++def print_mountstats(stats, nfs_only, rpc_only, raw, xprt_only): + if nfs_only: ++ stats.display_stats_header() + stats.display_nfs_options() + stats.display_nfs_events() + stats.display_nfs_bytes() +@@ -680,7 +773,11 @@ def print_mountstats(stats, nfs_only, rp + stats.display_rpc_op_stats() + elif raw: + stats.display_raw_stats() ++ elif xprt_only: ++ stats.display_stats_header() ++ stats.display_xprt_stats() + else: ++ stats.display_stats_header() + stats.display_nfs_options() + stats.display_nfs_bytes() + stats.display_rpc_generic_stats() +@@ -722,14 +819,14 @@ def mountstats_command(args): + stats = DeviceData() + stats.parse_stats(mountstats[mp]) + if not args.since: +- print_mountstats(stats, args.nfs_only, args.rpc_only, args.raw) ++ print_mountstats(stats, args.nfs_only, args.rpc_only, args.raw, args.xprt_only) + elif args.since and mp not in old_mountstats: +- print_mountstats(stats, args.nfs_only, args.rpc_only, args.raw) ++ print_mountstats(stats, args.nfs_only, args.rpc_only, args.raw, args.xprt_only) + else: + old_stats = DeviceData() + old_stats.parse_stats(old_mountstats[mp]) + diff_stats = stats.compare_iostats(old_stats) +- print_mountstats(diff_stats, args.nfs_only, args.rpc_only, args.raw) ++ print_mountstats(diff_stats, args.nfs_only, args.rpc_only, args.raw, args.xprt_only) + + args.infile.close() + if args.since: +@@ -941,6 +1038,8 @@ def main(): + help='Display only the RPC statistics') + group.add_argument('-R', '--raw', action='store_true', + help='Display only the raw statistics') ++ group.add_argument('-x', '--xprt', action='store_true', dest='xprt_only', ++ help='Display only the xprt statistics') + # The mountpoints argument cannot be moved into the common_parser because + # it will screw up the parsing of the iostat arguments (interval and count) + mountstats_parser.add_argument('mountpoints', nargs='*', metavar='mountpoint', diff --git a/SOURCES/nfs-utils-1.3.0-mountstats-shebang.patch b/SOURCES/nfs-utils-1.3.0-mountstats-shebang.patch new file mode 100644 index 0000000..4217191 --- /dev/null +++ b/SOURCES/nfs-utils-1.3.0-mountstats-shebang.patch @@ -0,0 +1,22 @@ +commit a1f89c17f529b688ce3f686a48a49cb3789807c5 +Author: Steve Dickson +Date: Thu Jul 27 10:35:55 2017 -0400 + + mountstats: Remove a shebang + + There might be an issue that the script is executed with unwanted + version of . + + Signed-off-by: Steve Dickson + (cherry picked from commit caa59a30b78dedea99a2317da95bb86810360645) + +diff --git a/tools/mountstats/mountstats.py b/tools/mountstats/mountstats.py +index 90b15a5..1dd1f1b 100644 +--- a/tools/mountstats/mountstats.py ++++ b/tools/mountstats/mountstats.py +@@ -1,4 +1,4 @@ +-#!/usr/bin/env python ++#!/usr/bin/python + # -*- python-mode -*- + """Parse /proc/self/mountstats and display it in human readable form + """ diff --git a/SOURCES/nfs-utils-1.3.0-nfs-iostat-no-dev.patch b/SOURCES/nfs-utils-1.3.0-nfs-iostat-no-dev.patch new file mode 100644 index 0000000..edfe58a --- /dev/null +++ b/SOURCES/nfs-utils-1.3.0-nfs-iostat-no-dev.patch @@ -0,0 +1,12 @@ +diff -up nfs-utils-1.3.0/tools/nfs-iostat/nfs-iostat.py.orig nfs-utils-1.3.0/tools/nfs-iostat/nfs-iostat.py +--- nfs-utils-1.3.0/tools/nfs-iostat/nfs-iostat.py.orig 2017-11-03 09:29:39.000000000 -0400 ++++ nfs-utils-1.3.0/tools/nfs-iostat/nfs-iostat.py 2017-11-03 09:34:25.000000000 -0400 +@@ -434,6 +434,8 @@ def parse_stats_file(filename): + words = line.split() + if len(words) == 0: + continue ++ if line.startswith("no device mounted") : ++ continue + if words[0] == 'device': + key = words[4] + new = [ line.strip() ] diff --git a/SOURCES/nfs-utils-1.3.0-nfs-man-v2.patch b/SOURCES/nfs-utils-1.3.0-nfs-man-v2.patch new file mode 100644 index 0000000..0496be5 --- /dev/null +++ b/SOURCES/nfs-utils-1.3.0-nfs-man-v2.patch @@ -0,0 +1,103 @@ +diff -up nfs-utils-1.3.0/utils/exportfs/exports.man.orig nfs-utils-1.3.0/utils/exportfs/exports.man +--- nfs-utils-1.3.0/utils/exportfs/exports.man.orig 2017-11-03 07:45:47.000000000 -0400 ++++ nfs-utils-1.3.0/utils/exportfs/exports.man 2017-11-03 09:25:47.000000000 -0400 +@@ -410,7 +410,7 @@ of the filesystem must be handled elsewh + + .TP + .IR pnfs +-This option allows enables the use of pNFS extension if protocol level ++This option enables the use of the pNFS extension if the protocol level + is NFSv4.1 or higher, and the filesystem supports pNFS exports. With + pNFS clients can bypass the server and perform I/O directly to storage + devices. The default can be explicitly requested with the +diff -up nfs-utils-1.3.0/utils/mount/nfs.man.orig nfs-utils-1.3.0/utils/mount/nfs.man +--- nfs-utils-1.3.0/utils/mount/nfs.man.orig 2017-11-03 07:45:47.000000000 -0400 ++++ nfs-utils-1.3.0/utils/mount/nfs.man 2017-11-03 09:23:20.000000000 -0400 +@@ -11,11 +11,8 @@ NFS is an Internet Standard protocol + created by Sun Microsystems in 1984. NFS was developed + to allow file sharing between systems residing + on a local area network. +-The Linux NFS client supports three versions +-of the NFS protocol: +-NFS version 2 [RFC1094], +-NFS version 3 [RFC1813], +-and NFS version 4 [RFC3530]. ++Depending on kernel configuration, the Linux NFS client may ++support NFS versions 2, 3, 4.0, 4.1, or 4.2. + .P + The + .BR mount (8) +@@ -88,9 +85,8 @@ These options are valid to use with any + The NFS protocol version number used to contact the server's NFS service. + If the server does not support the requested version, the mount request + fails. +-If this option is not specified, the client negotiates a suitable version +-with +-the server, trying version 4 first, version 3 second, and version 2 last. ++If this option is not specified, the client tries version 4.1 first, ++then negotiates down until it finds a version supported by the server. + .TP 1.5i + .BI vers= n + This option is an alternative to the +@@ -752,7 +748,7 @@ NOTE: When used together, the 'local_loc + by 'nolock'/'lock' mount option. + .SS "Options for NFS version 4 only" + Use these options, along with the options in the first subsection above, +-for NFS version 4 and newer. ++for NFS version 4.0 and newer. + .TP 1.5i + .BI proto= netid + The +@@ -825,7 +821,7 @@ the behavior of this option in more deta + Specifies a single IPv4 address (in dotted-quad form), + or a non-link-local IPv6 address, + that the NFS client advertises to allow servers +-to perform NFS version 4 callback requests against ++to perform NFS version 4.0 callback requests against + files on this mount point. If the server is unable to + establish callback connections to clients, performance + may degrade, or accesses to files may temporarily hang. +@@ -838,6 +834,11 @@ In the presence of multiple client netwo + special routing policies, + or atypical network topologies, + the exact address to use for callbacks may be nontrivial to determine. ++.IP ++NFS protocol versions 4.1 and 4.2 use the client-established ++TCP connection for callback requests, so do not require the server to ++connect to the client. This option is therefore only affect NFS version ++4.0 mounts. + .TP 1.5i + .BR migration " / " nomigration + Selects whether the client uses an identification string that is compatible +@@ -1726,7 +1727,7 @@ file system table + .TP 1.5i + .I /etc/nfsmount.conf + Configuration file for NFS mounts +-.SH BUGS ++.SH NOTES + Before 2.4.7, the Linux NFS client did not support NFS over TCP. + .P + Before 2.4.20, the Linux NFS client used a heuristic +@@ -1745,9 +1746,9 @@ when the + .BR rsize " and " wsize + settings were smaller than the system's page size. + .P +-The Linux NFS client does not yet support +-certain optional features of the NFS version 4 protocol, +-such as security negotiation, server referrals, and named attributes. ++The Linux client's support for protocol versions depend on whether the ++kernel was built with options CONFIG_NFS_V2, CONFIG_NFS_V3, ++CONFIG_NFS_V4, CONFIG_NFS_V4_1, and CONFIG_NFS_V4_2. + .SH "SEE ALSO" + .BR fstab (5), + .BR mount (8), +@@ -1780,4 +1781,8 @@ RFC 1833 for the RPC bind specification. + .br + RFC 2203 for the RPCSEC GSS API protocol specification. + .br +-RFC 3530 for the NFS version 4 specification. ++RFC 7530 for the NFS version 4.0 specification. ++.br ++RFC 5661 for the NFS version 4.1 specification. ++.br ++RFC 7862 for the NFS version 4.2 specification. diff --git a/SOURCES/nfs-utils-1.3.0-nfsclient-getopt.patch b/SOURCES/nfs-utils-1.3.0-nfsclient-getopt.patch new file mode 100644 index 0000000..4622b44 --- /dev/null +++ b/SOURCES/nfs-utils-1.3.0-nfsclient-getopt.patch @@ -0,0 +1,12 @@ +diff -up nfs-utils-1.3.0/utils/nfsdcltrack/nfsdcltrack.c.orig nfs-utils-1.3.0/utils/nfsdcltrack/nfsdcltrack.c +--- nfs-utils-1.3.0/utils/nfsdcltrack/nfsdcltrack.c.orig 2018-07-10 13:58:43.314210025 -0400 ++++ nfs-utils-1.3.0/utils/nfsdcltrack/nfsdcltrack.c 2018-07-10 14:10:43.732857114 -0400 +@@ -555,7 +555,7 @@ find_cmd(char *cmdname) + int + main(int argc, char **argv) + { +- char arg; ++ int arg; + char *val; + int rc = 0; + char *progname, *cmdarg = NULL; diff --git a/SOURCES/nfs-utils-1.3.0-nfsconf-disable-v4.patch b/SOURCES/nfs-utils-1.3.0-nfsconf-disable-v4.patch new file mode 100644 index 0000000..422eb5f --- /dev/null +++ b/SOURCES/nfs-utils-1.3.0-nfsconf-disable-v4.patch @@ -0,0 +1,36 @@ +diff -up nfs-utils-1.3.0/utils/nfsd/nfsd.c.orig nfs-utils-1.3.0/utils/nfsd/nfsd.c +--- nfs-utils-1.3.0/utils/nfsd/nfsd.c.orig 2018-09-26 10:41:27.733102553 -0400 ++++ nfs-utils-1.3.0/utils/nfsd/nfsd.c 2018-09-26 10:43:27.749413870 -0400 +@@ -82,6 +82,9 @@ main(int argc, char **argv) + + conf_init(); + xlog_from_conffile("nfsd"); ++ ++ nfssvc_get_minormask(&minormask); ++ + count = conf_get_num("nfsd", "threads", count); + grace = conf_get_num("nfsd", "grace-time", grace); + lease = conf_get_num("nfsd", "lease-time", lease); +@@ -100,13 +103,19 @@ main(int argc, char **argv) + for (i = 2; i <= 4; i++) { + char tag[10]; + sprintf(tag, "vers%d", i); +- if (conf_get_bool("nfsd", tag, NFSCTL_VERISSET(versbits, i))) ++ if (conf_get_bool("nfsd", tag, NFSCTL_VERISSET(versbits, i))) { + NFSCTL_VERSET(versbits, i); +- else ++ if (i == 4) ++ minorvers = minorversset = minormask; ++ } else { + NFSCTL_VERUNSET(versbits, i); ++ if (i == 4) { ++ minorvers = 0; ++ minorversset = minormask; ++ } ++ } + } + +- nfssvc_get_minormask(&minormask); + /* We assume the kernel will default all minor versions to 'on', + * and allow the config file to disable some. + */ diff --git a/SOURCES/nfs-utils-1.3.0-nfsd-defautvers.patch b/SOURCES/nfs-utils-1.3.0-nfsd-defautvers.patch new file mode 100644 index 0000000..6a4e8de --- /dev/null +++ b/SOURCES/nfs-utils-1.3.0-nfsd-defautvers.patch @@ -0,0 +1,25 @@ +diff -up nfs-utils-1.3.0/support/include/nfs/nfs.h.orig nfs-utils-1.3.0/support/include/nfs/nfs.h +--- nfs-utils-1.3.0/support/include/nfs/nfs.h.orig 2014-03-25 11:12:07.000000000 -0400 ++++ nfs-utils-1.3.0/support/include/nfs/nfs.h 2018-06-11 11:27:27.591007479 -0400 +@@ -57,6 +57,7 @@ struct nfs_fh_old { + #define NFSCTL_TCPISSET(_cltbits) ((_cltbits) & NFSCTL_TCPBIT) + + #define NFSCTL_VERDEFAULT (0xc) /* versions 3 and 4 */ ++#define NFSCTL_MINDEFAULT (0x7) /* minor versions 4.1 and 4.2 */ + #define NFSCTL_VERSET(_cltbits, _v) ((_cltbits) |= (1 << ((_v) - 1))) + #define NFSCTL_UDPSET(_cltbits) ((_cltbits) |= NFSCTL_UDPBIT) + #define NFSCTL_TCPSET(_cltbits) ((_cltbits) |= NFSCTL_TCPBIT) +diff -up nfs-utils-1.3.0/utils/nfsd/nfsd.c.orig nfs-utils-1.3.0/utils/nfsd/nfsd.c +--- nfs-utils-1.3.0/utils/nfsd/nfsd.c.orig 2018-06-11 10:44:25.722941203 -0400 ++++ nfs-utils-1.3.0/utils/nfsd/nfsd.c 2018-06-11 11:28:00.084537974 -0400 +@@ -64,8 +64,8 @@ main(int argc, char **argv) + int hcounter = 0; + struct conf_list *hosts; + int socket_up = 0; +- unsigned int minorvers = 0; +- unsigned int minorversset = 0; ++ unsigned int minorvers = NFSCTL_MINDEFAULT; ++ unsigned int minorversset = NFSCTL_MINDEFAULT; + unsigned int versbits = NFSCTL_VERDEFAULT; + unsigned int protobits = NFSCTL_ALLBITS; + int grace = -1; diff --git a/SOURCES/nfs-utils-1.3.0-nfsdcltrack-invalops.patch b/SOURCES/nfs-utils-1.3.0-nfsdcltrack-invalops.patch new file mode 100644 index 0000000..f3d07a2 --- /dev/null +++ b/SOURCES/nfs-utils-1.3.0-nfsdcltrack-invalops.patch @@ -0,0 +1,12 @@ +diff -up nfs-utils-1.3.0/utils/nfsdcltrack/nfsdcltrack.c.orig nfs-utils-1.3.0/utils/nfsdcltrack/nfsdcltrack.c +--- nfs-utils-1.3.0/utils/nfsdcltrack/nfsdcltrack.c.orig 2017-10-12 12:46:02.785182594 -0400 ++++ nfs-utils-1.3.0/utils/nfsdcltrack/nfsdcltrack.c 2017-10-12 13:30:35.756186324 -0400 +@@ -591,7 +591,7 @@ main(int argc, char **argv) + break; + default: + usage(progname); +- return 0; ++ return 1; + } + } + diff --git a/SOURCES/nfs-utils-1.3.0-nfsdcltrack-warning01.patch b/SOURCES/nfs-utils-1.3.0-nfsdcltrack-warning01.patch new file mode 100644 index 0000000..6a2ed40 --- /dev/null +++ b/SOURCES/nfs-utils-1.3.0-nfsdcltrack-warning01.patch @@ -0,0 +1,24 @@ +commit d6ee36b8dcc663dc2b797d51e553f390ea2f7e31 +Author: Steve Dickson +Date: Wed Jul 19 16:42:39 2017 -0400 + + nfsdcltrack.c: remove a warning + + nfsdcltrack.c:581:4: warning: this statement may fall through [-Wimplicit-fallthrough=] + + Acked-by: Jeff Layton + Signed-off-by: Steve Dickson + (cherry picked from commit f80c9984339da6f689f330b8a83d5ee503126827) + +diff --git a/utils/nfsdcltrack/nfsdcltrack.c b/utils/nfsdcltrack/nfsdcltrack.c +index 7af9efb..2f58f96 100644 +--- a/utils/nfsdcltrack/nfsdcltrack.c ++++ b/utils/nfsdcltrack/nfsdcltrack.c +@@ -581,6 +581,7 @@ main(int argc, char **argv) + switch (arg) { + case 'd': + xlog_config(D_ALL, 1); ++ break; + case 'f': + xlog_syslog(0); + xlog_stderr(1); diff --git a/SOURCES/nfs-utils-1.3.0-nfsmountconf-typo.patch b/SOURCES/nfs-utils-1.3.0-nfsmountconf-typo.patch new file mode 100644 index 0000000..7ac6459 --- /dev/null +++ b/SOURCES/nfs-utils-1.3.0-nfsmountconf-typo.patch @@ -0,0 +1,21 @@ +commit 3d0e59c63c9957d8cbca26f88bac1784d835e019 +Author: Steve Dickson +Date: Tue Jul 10 14:19:30 2018 -0400 + + Fixed typo in nfsmount.conf + + Signed-off-by: Steve Dickson + +diff --git a/utils/mount/nfsmount.conf b/utils/mount/nfsmount.conf +index aeb3023..6bdc225 100644 +--- a/utils/mount/nfsmount.conf ++++ b/utils/mount/nfsmount.conf +@@ -122,7 +122,7 @@ + # mountproto=tcp + # + # Server Mountd Version +-# mounvers=3 ++# mountvers=3 + # + # Server Mountd Host + # mounthost=hostname diff --git a/SOURCES/nfs-utils-1.3.0-rpcgssd-16bits.patch b/SOURCES/nfs-utils-1.3.0-rpcgssd-16bits.patch new file mode 100644 index 0000000..9b3c7bb --- /dev/null +++ b/SOURCES/nfs-utils-1.3.0-rpcgssd-16bits.patch @@ -0,0 +1,58 @@ +commit 2a6b8307fa4243a7921270aedf8ce6506e31569a +Author: Steve Dickson +Date: Tue Jul 17 15:09:37 2018 -0400 + + rpc.gssd: truncates 32-bit UIDs/GIDs to 16 bits architectures. + + utils/gssd_proc.c uses SYS_setresuid and SYS_setresgid in + change_identity when it should use SYS_setresuid32 and + SYS_setresgid32 instead. This causes it to truncate + UIDs/GIDs > 65536. + + Fixes: https://bugs.launchpad.net/ubuntu/+source/nfs-utils/+bug/1779962 + Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=1595927 + + Tested-by: James Ettle + Tested-by: Sree + Signed-off-by: Steve Dickson + +diff --git a/utils/gssd/gssd_proc.c b/utils/gssd/gssd_proc.c +index 8767e26..7a57c4e 100644 +--- a/utils/gssd/gssd_proc.c ++++ b/utils/gssd/gssd_proc.c +@@ -434,6 +434,7 @@ static int + change_identity(uid_t uid) + { + struct passwd *pw; ++ int res; + + /* drop list of supplimentary groups first */ + if (syscall(SYS_setgroups, 0, 0) != 0) { +@@ -459,14 +460,23 @@ change_identity(uid_t uid) + * send a signal to all other threads to synchronize the uid in all + * other threads. To bypass this, we have to call syscall() directly. + */ +- if (syscall(SYS_setresgid, pw->pw_gid, pw->pw_gid, pw->pw_gid) != 0) { ++#ifdef __NR_setresuid32 ++ res = syscall(SYS_setresgid32, pw->pw_gid, pw->pw_gid, pw->pw_gid); ++#else ++ res = syscall(SYS_setresgid, pw->pw_gid, pw->pw_gid, pw->pw_gid); ++#endif ++ if (res != 0) { + printerr(0, "WARNING: failed to set gid to %u!\n", pw->pw_gid); + return errno; + } + +- if (syscall(SYS_setresuid, uid, uid, uid) != 0) { +- printerr(0, "WARNING: Failed to setuid for user with uid %u\n", +- uid); ++#ifdef __NR_setresuid32 ++ res = syscall(SYS_setresuid32, uid, uid, uid); ++#else ++ res = syscall(SYS_setresuid, uid, uid, uid); ++#endif ++ if (res != 0) { ++ printerr(0, "WARNING: Failed to setuid for user with uid %u\n", uid); + return errno; + } + diff --git a/SOURCES/nfs-utils-1.3.0-server-chgrpcpipefs.patch b/SOURCES/nfs-utils-1.3.0-server-chgrpcpipefs.patch new file mode 100644 index 0000000..473fab8 --- /dev/null +++ b/SOURCES/nfs-utils-1.3.0-server-chgrpcpipefs.patch @@ -0,0 +1,935 @@ +diff --git a/.gitignore b/.gitignore +index 3d9640d..d26f4be 100644 +--- a/.gitignore ++++ b/.gitignore +@@ -70,6 +70,8 @@ tests/nsm_client/nlm_sm_inter_svc.c + tests/nsm_client/nlm_sm_inter_xdr.c + utils/nfsidmap/nfsidmap + systemd/nfs-server-generator ++systemd/rpc-pipefs-generator ++systemd/rpc-gssd.service + # cscope database files + cscope.* + # generic editor backup et al +diff --git a/configure.ac b/configure.ac +index 3bce774..fce0e15 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -498,8 +498,14 @@ AC_SUBST([AM_CFLAGS], ["$my_am_cflags"]) + # Make sure that $ACLOCAL_FLAGS are used during a rebuild + AC_SUBST([ACLOCAL_AMFLAGS], ["-I $ac_macro_dir \$(ACLOCAL_FLAGS)"]) + ++# make _sysconfdir available for substituion in config files ++# 2 "evals" needed late to expand variable names. ++AC_SUBST([_sysconfdir]) ++AC_CONFIG_COMMANDS_PRE([eval eval _sysconfdir=$sysconfdir]) ++ + AC_CONFIG_FILES([ + Makefile ++ systemd/rpc-gssd.service + linux-nfs/Makefile + support/Makefile + support/export/Makefile +diff --git a/nfs.conf b/nfs.conf +index c907de6..89cf386 100644 +--- a/nfs.conf ++++ b/nfs.conf +@@ -1,7 +1,10 @@ + # +-# This is a general conifguration for the ++# This is a general configuration for the + # NFS daemons and tools + # ++#[general] ++# pipefs-directory=/var/lib/nfs/rpc_pipefs ++# + #[exportfs] + # debug=0 + # +@@ -12,7 +15,6 @@ + # limit-to-legacy-enctypes=0 + # context-timeout=0 + # rpc-timeout=5 +-# pipefs-directory=/var/lib/nfs/rpc_pipefs + # keytab-file=/etc/krb5.keytab + # cred-cache-directory= + # preferred-realm= +diff --git a/support/include/xcommon.h b/support/include/xcommon.h +index d1a4b18..23c9a13 100644 +--- a/support/include/xcommon.h ++++ b/support/include/xcommon.h +@@ -17,6 +17,12 @@ + #include + #include + ++#ifdef MAJOR_IN_MKDEV ++#include ++#elif defined(MAJOR_IN_SYSMACROS) ++#include ++#endif ++ + #define streq(s, t) (strcmp ((s), (t)) == 0) + + /* Functions in sundries.c that are used in mount.c and umount.c */ +diff --git a/support/nfs/nfsexport.c b/support/nfs/nfsexport.c +index f129fd2..c1c736e 100644 +--- a/support/nfs/nfsexport.c ++++ b/support/nfs/nfsexport.c +@@ -18,6 +18,7 @@ + #include + + #include "nfslib.h" ++#include "xcommon.h" + + /* if /proc/net/rpc/... exists, then + * write to it, as that interface is more stable. +diff --git a/systemd/Makefile.am b/systemd/Makefile.am +index b789916..54a3b64 100644 +--- a/systemd/Makefile.am ++++ b/systemd/Makefile.am +@@ -8,6 +8,7 @@ unit_files = \ + nfs-blkmap.service \ + nfs-config.service \ + nfs-idmapd.service \ ++ rpc_pipefs.target \ + nfs-mountd.service \ + nfs-server.service \ + nfs-utils.service \ +@@ -24,14 +25,23 @@ EXTRA_DIST = $(unit_files) $(man5_MANS) $(man7_MANS) + unit_dir = /usr/lib/systemd/system + generator_dir = /usr/lib/systemd/system-generators + +-EXTRA_PROGRAMS = nfs-server-generator ++EXTRA_PROGRAMS = nfs-server-generator rpc-pipefs-generator + genexecdir = $(generator_dir) ++ ++COMMON_SRCS = systemd.c systemd.h ++ ++nfs_server_generator_SOURCES = $(COMMON_SRCS) nfs-server-generator.c ++ ++rpc_pipefs_generator_SOURCES = $(COMMON_SRCS) rpc-pipefs-generator.c ++ + nfs_server_generator_LDADD = ../support/export/libexport.a \ + ../support/nfs/libnfs.a \ + ../support/misc/libmisc.a + ++rpc_pipefs_generator_LDADD = ../support/nfs/libnfs.a ++ + if INSTALL_SYSTEMD +-genexec_PROGRAMS = nfs-server-generator ++genexec_PROGRAMS = nfs-server-generator rpc-pipefs-generator + install-data-hook: $(unit_files) + mkdir -p $(DESTDIR)/$(unitdir) + cp $(unit_files) $(DESTDIR)/$(unitdir) +diff --git a/systemd/nfs-blkmap.service b/systemd/nfs-blkmap.service +index ddbf4e9..c844e2d 100644 +--- a/systemd/nfs-blkmap.service ++++ b/systemd/nfs-blkmap.service +@@ -2,8 +2,8 @@ + Description=pNFS block layout mapping daemon + DefaultDependencies=no + Conflicts=umount.target +-After=var-lib-nfs-rpc_pipefs.mount +-Requires=var-lib-nfs-rpc_pipefs.mount ++After=rpc_pipefs.target ++Requires=rpc_pipefs.target + + PartOf=nfs-utils.service + +diff --git a/systemd/nfs-idmapd.service b/systemd/nfs-idmapd.service +index df3dd9d..38685b6 100644 +--- a/systemd/nfs-idmapd.service ++++ b/systemd/nfs-idmapd.service +@@ -1,8 +1,8 @@ + [Unit] + Description=NFSv4 ID-name mapping service + DefaultDependencies=no +-Requires=var-lib-nfs-rpc_pipefs.mount +-After=var-lib-nfs-rpc_pipefs.mount local-fs.target ++Requires=rpc_pipefs.target ++After=rpc_pipefs.target local-fs.target + + BindsTo=nfs-server.service + +diff --git a/systemd/nfs-server-generator.c b/systemd/nfs-server-generator.c +index 4aa6509..737f109 100644 +--- a/systemd/nfs-server-generator.c ++++ b/systemd/nfs-server-generator.c +@@ -29,6 +29,7 @@ + #include "misc.h" + #include "nfslib.h" + #include "exportfs.h" ++#include "systemd.h" + + /* A simple "set of strings" to remove duplicates + * found in /etc/exports +@@ -55,35 +56,6 @@ static int is_unique(struct list **lp, char *path) + return 1; + } + +-/* We need to convert a path name to a systemd unit +- * name. This requires some translation ('/' -> '-') +- * and some escaping. +- */ +-static void systemd_escape(FILE *f, char *path) +-{ +- while (*path == '/') +- path++; +- if (!*path) { +- /* "/" becomes "-", otherwise leading "/" is ignored */ +- fputs("-", f); +- return; +- } +- while (*path) { +- char c = *path++; +- +- if (c == '/') { +- /* multiple non-trailing slashes become '-' */ +- while (*path == '/') +- path++; +- if (*path) +- fputs("-", f); +- } else if (isalnum(c) || c == ':' || c == '.') +- fputc(c, f); +- else +- fprintf(f, "\\x%02x", c & 0xff); +- } +-} +- + static int has_noauto_flag(char *path) + { + FILE *fstab; +@@ -108,7 +80,7 @@ static int has_noauto_flag(char *path) + + int main(int argc, char *argv[]) + { +- char *path; ++ char *path, *spath; + char dirbase[] = "/nfs-server.service.d"; + char filebase[] = "/order-with-mounts.conf"; + nfs_export *exp; +@@ -167,9 +139,15 @@ int main(int argc, char *argv[]) + if (strcmp(mnt->mnt_type, "nfs") != 0 && + strcmp(mnt->mnt_type, "nfs4") != 0) + continue; +- fprintf(f, "Before= "); +- systemd_escape(f, mnt->mnt_dir); +- fprintf(f, ".mount\n"); ++ ++ spath = systemd_escape(mnt->mnt_dir, ".mount"); ++ if (!spath) { ++ fprintf(stderr, ++ "nfs-server-generator: convert path failed: %s\n", ++ mnt->mnt_dir); ++ continue; ++ } ++ fprintf(f, "Before=%s\n", spath); + } + + fclose(fstab); +diff --git a/systemd/nfs.conf.man b/systemd/nfs.conf.man +index 938b970..9700586 100644 +--- a/systemd/nfs.conf.man ++++ b/systemd/nfs.conf.man +@@ -96,6 +96,18 @@ value, which can be one or more from the list + .BR all . + When a list is given, the members should be comma-separated. + .TP ++.B general ++Recognized values: ++.BR pipefs-directory . ++ ++See ++.BR blkmapd (8), ++.BR rpc.idmapd (8), ++and ++.BR rpc.gssd (8) ++for details. ++ ++.TP + .B nfsdcltrack + Recognized values: + .BR storagedir . +@@ -198,7 +210,6 @@ Recognized values: + .BR limit-to-legacy-enctypes , + .BR context-timeout , + .BR rpc-timeout , +-.BR pipefs-directory , + .BR keytab-file , + .BR cred-cache-directory , + .BR preferred-realm . +diff --git a/systemd/rpc-gssd.service b/systemd/rpc-gssd.service +deleted file mode 100644 +index 5d6d09f..0000000 +--- a/systemd/rpc-gssd.service ++++ /dev/null +@@ -1,19 +0,0 @@ +-[Unit] +-Description=RPC security service for NFS client and server +-DefaultDependencies=no +-Conflicts=umount.target +-Requires=var-lib-nfs-rpc_pipefs.mount +-After=var-lib-nfs-rpc_pipefs.mount gssproxy.service +- +-ConditionPathExists=/etc/krb5.keytab +- +-PartOf=nfs-utils.service +- +-Wants=nfs-config.service +-After=nfs-config.service +- +-[Service] +-EnvironmentFile=-/run/sysconfig/nfs-utils +- +-Type=forking +-ExecStart=/usr/sbin/rpc.gssd $GSSDARGS +diff --git a/systemd/rpc-gssd.service.in b/systemd/rpc-gssd.service.in +new file mode 100644 +index 0000000..c75ccbd +--- /dev/null ++++ b/systemd/rpc-gssd.service.in +@@ -0,0 +1,19 @@ ++[Unit] ++Description=RPC security service for NFS client and server ++DefaultDependencies=no ++Conflicts=umount.target ++Requires=rpc_pipefs.target ++After=rpc_pipefs.target gssproxy.service ++ ++ConditionPathExists=@_sysconfdir@/krb5.keytab ++ ++PartOf=nfs-utils.service ++ ++Wants=nfs-config.service ++After=nfs-config.service ++ ++[Service] ++EnvironmentFile=-/run/sysconfig/nfs-utils ++ ++Type=forking ++ExecStart=/usr/sbin/rpc.gssd $GSSDARGS +diff --git a/systemd/rpc-pipefs-generator.c b/systemd/rpc-pipefs-generator.c +new file mode 100644 +index 0000000..66addb9 +--- /dev/null ++++ b/systemd/rpc-pipefs-generator.c +@@ -0,0 +1,138 @@ ++/* ++ * rpc-pipefs-generator: ++ * systemd generator to create ordering dependencies between ++ * nfs services and the rpc_pipefs mountpoint ++ */ ++ ++#ifdef HAVE_CONFIG_H ++#include ++#endif ++ ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++ ++#include "nfslib.h" ++#include "conffile.h" ++#include "systemd.h" ++ ++#define RPC_PIPEFS_DEFAULT "/var/lib/nfs/rpc_pipefs" ++char *conf_path = NFS_CONFFILE; ++ ++static int generate_mount_unit(const char *pipefs_path, const char *pipefs_unit, ++ const char *dirname) ++{ ++ char *path; ++ FILE *f; ++ ++ path = malloc(strlen(dirname) + 1 + strlen(pipefs_unit)); ++ if (!path) ++ return 1; ++ sprintf(path, "%s/%s", dirname, pipefs_unit); ++ f = fopen(path, "w"); ++ if (!f) ++ return 1; ++ ++ fprintf(f, "# Automatically generated by rpc-pipefs-generator\n\n[Unit]\n"); ++ fprintf(f, "Description=RPC Pipe File System\n"); ++ fprintf(f, "DefaultDependencies=no\n"); ++ fprintf(f, "After=systemd-tmpfiles-setup.service\n"); ++ fprintf(f, "Conflicts=umount.target\n"); ++ fprintf(f, "\n[Mount]\n"); ++ fprintf(f, "What=sunrpc\n"); ++ fprintf(f, "Where=%s\n", pipefs_path); ++ fprintf(f, "Type=rpc_pipefs\n"); ++ ++ fclose(f); ++ return 0; ++} ++ ++static ++int generate_target(char *pipefs_path, const char *dirname) ++{ ++ char *path; ++ char filebase[] = "/rpc_pipefs.target"; ++ char *pipefs_unit; ++ FILE *f; ++ int ret = 0; ++ ++ pipefs_unit = systemd_escape(pipefs_path, ".mount"); ++ if (!pipefs_unit) ++ return 1; ++ ++ ret = generate_mount_unit(pipefs_path, pipefs_unit, dirname); ++ if (ret) ++ return ret; ++ ++ path = malloc(strlen(dirname) + 1 + sizeof(filebase)); ++ if (!path) ++ return 2; ++ sprintf(path, "%s", dirname); ++ mkdir(path, 0755); ++ strcat(path, filebase); ++ f = fopen(path, "w"); ++ if (!f) ++ return 1; ++ ++ fprintf(f, "# Automatically generated by rpc-pipefs-generator\n\n[Unit]\n"); ++ fprintf(f, "Requires=%s\n", pipefs_unit); ++ fprintf(f, "After=%s\n", pipefs_unit); ++ fclose(f); ++ ++ return 0; ++} ++ ++static int is_non_pipefs_mountpoint(char *path) ++{ ++ FILE *mtab; ++ struct mntent *mnt; ++ ++ mtab = setmntent("/etc/mtab", "r"); ++ if (!mtab) ++ return 0; ++ ++ while ((mnt = getmntent(mtab)) != NULL) { ++ if (strlen(mnt->mnt_dir) != strlen(path)) ++ continue; ++ if (strncmp(mnt->mnt_dir, path, strlen(mnt->mnt_dir))) ++ continue; ++ if (strncmp(mnt->mnt_type, "rpc_pipefs", strlen(mnt->mnt_type))) ++ break; ++ } ++ fclose(mtab); ++ return mnt != NULL; ++} ++ ++int main(int argc, char *argv[]) ++{ ++ int ret; ++ char *s; ++ ++ /* Avoid using any external services */ ++ xlog_syslog(0); ++ ++ if (argc != 4 || argv[1][0] != '/') { ++ fprintf(stderr, "rpc-pipefs-generator: create systemd dependencies for nfs services\n"); ++ fprintf(stderr, "Usage: normal-dir early-dir late-dir\n"); ++ exit(1); ++ } ++ ++ conf_init(); ++ s = conf_get_str("general", "pipefs-directory"); ++ if (!s) ++ exit(0); ++ if (strlen(s) == strlen(RPC_PIPEFS_DEFAULT) && ++ strcmp(s, RPC_PIPEFS_DEFAULT) == 0) ++ exit(0); ++ ++ if (is_non_pipefs_mountpoint(s)) ++ exit(1); ++ ++ ret = generate_target(s, argv[1]); ++ exit(ret); ++} +diff --git a/systemd/rpc-svcgssd.service b/systemd/rpc-svcgssd.service +index 41177b6..a3a555c 100644 +--- a/systemd/rpc-svcgssd.service ++++ b/systemd/rpc-svcgssd.service +@@ -1,8 +1,7 @@ + [Unit] + Description=RPC security service for NFS server + DefaultDependencies=no +-Requires=var-lib-nfs-rpc_pipefs.mount +-After=var-lib-nfs-rpc_pipefs.mount local-fs.target ++After=local-fs.target + PartOf=nfs-server.service + PartOf=nfs-utils.service + +diff --git a/systemd/rpc_pipefs.target b/systemd/rpc_pipefs.target +new file mode 100644 +index 0000000..01d4d27 +--- /dev/null ++++ b/systemd/rpc_pipefs.target +@@ -0,0 +1,3 @@ ++[Unit] ++Requires=var-lib-nfs-rpc_pipefs.mount ++After=var-lib-nfs-rpc_pipefs.mount +diff --git a/systemd/systemd.c b/systemd/systemd.c +new file mode 100644 +index 0000000..17820d4 +--- /dev/null ++++ b/systemd/systemd.c +@@ -0,0 +1,133 @@ ++/* ++ * Helper functions for systemd generators in nfs-utils. ++ * ++ * Currently just systemd_escape(). ++ */ ++ ++#include ++#include ++#include ++#include ++ ++static const char hex[16] = ++{ ++ '0', '1', '2', '3', '4', '5', '6', '7', ++ '8', '9', 'a', 'b', 'c', 'd', 'e', 'f', ++}; ++ ++/* ++ * determine length of the string that systemd_escape() needs to allocate ++ */ ++static int systemd_len(char *path) ++{ ++ char *p; ++ int len = 0; ++ ++ p = path; ++ while (*p == '/') ++ /* multiple leading "/" are ignored */ ++ p++; ++ ++ if (!*p) ++ /* root directory "/" becomes is encoded as a single "-" */ ++ return 1; ++ ++ if (*p == '.') ++ /* ++ * replace "." with "\x2d" escape sequence if ++ * it's the first character in escaped path ++ * */ ++ len += 4; ++ ++ while (*p) { ++ unsigned char c = *p++; ++ ++ if (c == '/') { ++ /* multiple non-trailing slashes become '-' */ ++ while (*p == '/') ++ p++; ++ if (*p) ++ len++; ++ } else if (isalnum(c) || c == ':' || c == '.' || c == '_') ++ /* these characters are not replaced */ ++ len++; ++ else ++ /* replace with "\x2d" escape sequence */ ++ len += 4; ++ } ++ ++ return len; ++} ++ ++/* ++ * convert c to "\x2d" escape sequence and append to string ++ * at position p, advancing p ++ */ ++static char *hexify(unsigned char c, char *p) ++{ ++ *p++ = '\\'; ++ *p++ = 'x'; ++ *p++ = hex[c >> 4]; ++ *p++ = hex[c & 0xf]; ++ return p; ++} ++ ++/* ++ * convert a path to a unit name according to the logic in systemd.unit(5): ++ * ++ * Basically, given a path, "/" is replaced by "-", and all other ++ * characters which are not ASCII alphanumerics are replaced by C-style ++ * "\x2d" escapes (except that "_" is never replaced and "." is only ++ * replaced when it would be the first character in the escaped path). ++ * The root directory "/" is encoded as single dash, while otherwise the ++ * initial and ending "/" are removed from all paths during ++ * transformation. ++ * ++ * NB: Although the systemd.unit(5) doesn't mention it, the ':' character ++ * is not escaped. ++ */ ++char *systemd_escape(char *path, char *suffix) ++{ ++ char *result; ++ char *p; ++ int len; ++ ++ len = systemd_len(path); ++ result = malloc(len + strlen(suffix) + 1); ++ p = result; ++ while (*path == '/') ++ /* multiple leading "/" are ignored */ ++ path++; ++ if (!*path) { ++ /* root directory "/" becomes is encoded as a single "-" */ ++ *p++ = '-'; ++ goto out; ++ } ++ if (*path == '.') ++ /* ++ * replace "." with "\x2d" escape sequence if ++ * it's the first character in escaped path ++ * */ ++ p = hexify(*path++, p); ++ ++ while (*path) { ++ unsigned char c = *path++; ++ ++ if (c == '/') { ++ /* multiple non-trailing slashes become '-' */ ++ while (*path == '/') ++ path++; ++ if (*path) ++ *p++ = '-'; ++ } else if (isalnum(c) || c == ':' || c == '.' || c == '_') ++ /* these characters are not replaced */ ++ *p++ = c; ++ else ++ /* replace with "\x2d" escape sequence */ ++ p = hexify(c, p); ++ } ++ ++out: ++ sprintf(p, "%s", suffix); ++ return result; ++} +diff --git a/systemd/systemd.h b/systemd/systemd.h +new file mode 100644 +index 0000000..25235ec +--- /dev/null ++++ b/systemd/systemd.h +@@ -0,0 +1,6 @@ ++#ifndef SYSTEMD_H ++#define SYSTEMD_H ++ ++char *systemd_escape(char *path, char *suffix); ++ ++#endif /* SYSTEMD_H */ +diff --git a/utils/blkmapd/blkmapd.man b/utils/blkmapd/blkmapd.man +index 914b80f..4b3d3f0 100644 +--- a/utils/blkmapd/blkmapd.man ++++ b/utils/blkmapd/blkmapd.man +@@ -43,9 +43,24 @@ Performs device discovery only then exits. + Runs + .B blkmapd + in the foreground and sends output to stderr (as opposed to syslogd) ++.SH CONFIGURATION FILE ++The ++.B blkmapd ++daemon recognizes the following value from the ++.B [general] ++section of the ++.I /etc/nfs.conf ++configuration file: ++.TP ++.B pipefs-directory ++Tells ++.B blkmapd ++where to look for the rpc_pipefs filesystem. The default value is ++.IR /var/lib/nfs/rpc_pipefs . + .SH SEE ALSO + .BR nfs (5), +-.BR dmsetup (8) ++.BR dmsetup (8), ++.BR nfs.conf (5) + .sp + RFC 5661 for the NFS version 4.1 specification. + .br +diff --git a/utils/blkmapd/device-discovery.c b/utils/blkmapd/device-discovery.c +index b010628..a419947 100644 +--- a/utils/blkmapd/device-discovery.c ++++ b/utils/blkmapd/device-discovery.c +@@ -50,19 +50,36 @@ + #include + #include + ++#ifdef HAVE_CONFIG_H ++#include "config.h" ++#endif /* HAVE_CONFIG_H */ ++ + #include "device-discovery.h" ++#include "xcommon.h" ++#include "nfslib.h" ++#include "conffile.h" + + #define EVENT_SIZE (sizeof(struct inotify_event)) + #define EVENT_BUFSIZE (1024 * EVENT_SIZE) + +-#define BL_PIPE_FILE "/var/lib/nfs/rpc_pipefs/nfs/blocklayout" +-#define NFSPIPE_DIR "/var/lib/nfs/rpc_pipefs/nfs" + #define RPCPIPE_DIR "/var/lib/nfs/rpc_pipefs" + #define PID_FILE "/var/run/blkmapd.pid" + ++#define CONF_SAVE(w, f) do { \ ++ char *p = f; \ ++ if (p != NULL) \ ++ (w) = p; \ ++} while (0) ++ ++static char bl_pipe_file[PATH_MAX]; ++static char nfspipe_dir[PATH_MAX]; ++static char rpcpipe_dir[PATH_MAX]; ++ + struct bl_disk *visible_disk_list; + int bl_watch_fd, bl_pipe_fd, nfs_pipedir_wfd, rpc_pipedir_wfd; + int pidfd = -1; ++char *conf_path = NULL; ++ + + struct bl_disk_path *bl_get_path(const char *filepath, + struct bl_disk_path *paths) +@@ -357,8 +374,8 @@ static void bl_rpcpipe_cb(void) + continue; + if (event->mask & IN_CREATE) { + BL_LOG_WARNING("nfs pipe dir created\n"); +- bl_watch_dir(NFSPIPE_DIR, &nfs_pipedir_wfd); +- bl_pipe_fd = open(BL_PIPE_FILE, O_RDWR); ++ bl_watch_dir(nfspipe_dir, &nfs_pipedir_wfd); ++ bl_pipe_fd = open(bl_pipe_file, O_RDWR); + } else if (event->mask & IN_DELETE) { + BL_LOG_WARNING("nfs pipe dir deleted\n"); + inotify_rm_watch(bl_watch_fd, nfs_pipedir_wfd); +@@ -371,7 +388,7 @@ static void bl_rpcpipe_cb(void) + continue; + if (event->mask & IN_CREATE) { + BL_LOG_WARNING("blocklayout pipe file created\n"); +- bl_pipe_fd = open(BL_PIPE_FILE, O_RDWR); ++ bl_pipe_fd = open(bl_pipe_file, O_RDWR); + if (bl_pipe_fd < 0) + BL_LOG_ERR("open %s failed: %s\n", + event->name, strerror(errno)); +@@ -437,6 +454,19 @@ int main(int argc, char **argv) + int opt, dflag = 0, fg = 0, ret = 1; + struct stat statbuf; + char pidbuf[64]; ++ char *xrpcpipe_dir = NULL; ++ ++ strncpy(rpcpipe_dir, RPCPIPE_DIR, sizeof(rpcpipe_dir)); ++ conf_path = NFS_CONFFILE; ++ conf_init(); ++ CONF_SAVE(xrpcpipe_dir, conf_get_str("general", "pipefs-directory")); ++ if (xrpcpipe_dir != NULL) ++ strlcpy(rpcpipe_dir, xrpcpipe_dir, sizeof(rpcpipe_dir)); ++ ++ strncpy(nfspipe_dir, rpcpipe_dir, sizeof(nfspipe_dir)); ++ strlcat(nfspipe_dir, "/nfs", sizeof(nfspipe_dir)); ++ strncpy(bl_pipe_file, rpcpipe_dir, sizeof(bl_pipe_file)); ++ strlcat(bl_pipe_file, "/nfs/blocklayout", sizeof(bl_pipe_file)); + + while ((opt = getopt(argc, argv, "hdf")) != -1) { + switch (opt) { +@@ -501,12 +531,12 @@ int main(int argc, char **argv) + } + + /* open pipe file */ +- bl_watch_dir(RPCPIPE_DIR, &rpc_pipedir_wfd); +- bl_watch_dir(NFSPIPE_DIR, &nfs_pipedir_wfd); ++ bl_watch_dir(rpcpipe_dir, &rpc_pipedir_wfd); ++ bl_watch_dir(nfspipe_dir, &nfs_pipedir_wfd); + +- bl_pipe_fd = open(BL_PIPE_FILE, O_RDWR); ++ bl_pipe_fd = open(bl_pipe_file, O_RDWR); + if (bl_pipe_fd < 0) +- BL_LOG_ERR("open pipe file %s failed: %s\n", BL_PIPE_FILE, strerror(errno)); ++ BL_LOG_ERR("open pipe file %s failed: %s\n", bl_pipe_file, strerror(errno)); + + while (1) { + /* discover device when needed */ +diff --git a/utils/gssd/gssd.c b/utils/gssd/gssd.c +index c5c03fb..10d50d3 100644 +--- a/utils/gssd/gssd.c ++++ b/utils/gssd/gssd.c +@@ -857,6 +857,10 @@ read_gss_conf(void) + s = conf_get_str("gssd", "pipefs-directory"); + if (!s) + s = conf_get_str("general", "pipefs-directory"); ++ else ++ printerr(0, "WARNING: Specifying pipefs-directory in the [gssd] " ++ "section of %s is deprecated. Use the [general] " ++ "section instead.", NFS_CONFFILE); + if (s) + pipefs_path = s; + s = conf_get_str("gssd", "keytab-file"); +diff --git a/utils/gssd/gssd.man b/utils/gssd/gssd.man +index 87eef02..e620f0d 100644 +--- a/utils/gssd/gssd.man ++++ b/utils/gssd/gssd.man +@@ -335,10 +335,6 @@ Equivalent to + Equivalent to + .BR -t . + .TP +-.B pipefs-directory +-Equivalent to +-.BR -p . +-.TP + .B keytab-file + Equivalent to + .BR -k . +@@ -350,6 +346,14 @@ Equivalent to + .B preferred-realm + Equivalent to + .BR -R . ++.P ++In addtion, the following value is recognized from the ++.B [general] ++section: ++.TP ++.B pipefs-directory ++Equivalent to ++.BR -p . + + .SH SEE ALSO + .BR rpc.svcgssd (8), +diff --git a/utils/idmapd/idmapd.c b/utils/idmapd/idmapd.c +index f55d2e1..03efbea 100644 +--- a/utils/idmapd/idmapd.c ++++ b/utils/idmapd/idmapd.c +@@ -166,7 +166,7 @@ static uid_t nobodyuid; + static gid_t nobodygid; + + /* Used by conffile.c in libnfs.a */ +-char *conf_path; ++char *conf_path = NULL; + + static int + flush_nfsd_cache(char *path, time_t now) +@@ -220,7 +220,6 @@ main(int argc, char **argv) + int ret; + char *progname; + +- conf_path = _PATH_IDMAPDCONF; + nobodyuser = NFS4NOBODY_USER; + nobodygroup = NFS4NOBODY_GROUP; + strlcpy(pipefsdir, PIPEFS_DIR, sizeof(pipefsdir)); +@@ -234,8 +233,11 @@ main(int argc, char **argv) + #define GETOPTSTR "hvfd:p:U:G:c:CS" + opterr=0; /* Turn off error messages */ + while ((opt = getopt(argc, argv, GETOPTSTR)) != -1) { +- if (opt == 'c') ++ if (opt == 'c') { ++ warnx("-c is deprecated and may be removed in the " ++ "future. See idmapd(8)."); + conf_path = optarg; ++ } + if (opt == '?') { + if (strchr(GETOPTSTR, optopt)) + warnx("'-%c' option requires an argument.", optopt); +@@ -247,17 +249,33 @@ main(int argc, char **argv) + } + optind = 1; + +- if (stat(conf_path, &sb) == -1 && (errno == ENOENT || errno == EACCES)) { +- warn("Skipping configuration file \"%s\"", conf_path); +- conf_path = NULL; ++ if (conf_path) { /* deprecated -c option was specified */ ++ if (stat(conf_path, &sb) == -1 && (errno == ENOENT || errno == EACCES)) { ++ warn("Skipping configuration file \"%s\"", conf_path); ++ conf_path = NULL; ++ } else { ++ conf_init(); ++ verbose = conf_get_num("General", "Verbosity", 0); ++ cache_entry_expiration = conf_get_num("General", ++ "Cache-Expiration", DEFAULT_IDMAP_CACHE_EXPIRY); ++ CONF_SAVE(xpipefsdir, conf_get_str("General", "Pipefs-Directory")); ++ if (xpipefsdir != NULL) ++ strlcpy(pipefsdir, xpipefsdir, sizeof(pipefsdir)); ++ CONF_SAVE(nobodyuser, conf_get_str("Mapping", "Nobody-User")); ++ CONF_SAVE(nobodygroup, conf_get_str("Mapping", "Nobody-Group")); ++ } + } else { ++ conf_path = NFS_CONFFILE; + conf_init(); +- verbose = conf_get_num("General", "Verbosity", 0); +- cache_entry_expiration = conf_get_num("General", +- "Cache-Expiration", DEFAULT_IDMAP_CACHE_EXPIRY); + CONF_SAVE(xpipefsdir, conf_get_str("General", "Pipefs-Directory")); + if (xpipefsdir != NULL) + strlcpy(pipefsdir, xpipefsdir, sizeof(pipefsdir)); ++ ++ conf_path = _PATH_IDMAPDCONF; ++ conf_init(); ++ verbose = conf_get_num("General", "Verbosity", 0); ++ cache_entry_expiration = conf_get_num("General", ++ "cache-expiration", DEFAULT_IDMAP_CACHE_EXPIRY); + CONF_SAVE(nobodyuser, conf_get_str("Mapping", "Nobody-User")); + CONF_SAVE(nobodygroup, conf_get_str("Mapping", "Nobody-Group")); + } +diff --git a/utils/idmapd/idmapd.man b/utils/idmapd/idmapd.man +index b9200c7..fb5fc1e 100644 +--- a/utils/idmapd/idmapd.man ++++ b/utils/idmapd/idmapd.man +@@ -50,11 +50,28 @@ The default value is \&"/var/lib/nfs/rpc_pipefs\&". + .It Fl c Ar path + Use configuration file + .Ar path . ++This option is deprecated. + .It Fl C + Client-only: perform no idmapping for any NFS server, even if one is detected. + .It Fl S + Server-only: perform no idmapping for any NFS client, even if one is detected. + .El ++.Sh CONFIGURATION FILES ++.Nm ++recognizes the following value from the ++.Sy [general] ++section of the ++.Pa /etc/nfs.conf ++configuration file: ++.Bl -tag -width Ds_imagedir ++.It Sy pipefs-directory ++Equivalent to ++.Sy -p . ++.El ++.Pp ++All other settings related to id mapping are found in the ++.Pa /etc/idmapd.conf ++configuration file. + .Sh EXAMPLES + .Cm rpc.idmapd -f -vvv + .Pp +@@ -71,9 +88,11 @@ messages to console, and with a verbosity level of 3. + .\" This next request is for sections 1, 6, 7 & 8 only. + .\" .Sh ENVIRONMENT + .Sh FILES +-.Pa /etc/idmapd.conf ++.Pa /etc/idmapd.conf , ++.Pa /etc/nfs.conf + .Sh SEE ALSO + .Xr idmapd.conf 5 , ++.Xr nfs.conf 5 , + .Xr nfsidmap 8 + .\".Sh SEE ALSO + .\".Xr nylon.conf 4 +diff --git a/utils/mountd/cache.c b/utils/mountd/cache.c +index 3bc13ca..f23fb5a 100644 +--- a/utils/mountd/cache.c ++++ b/utils/mountd/cache.c +@@ -31,6 +31,7 @@ + #include "mountd.h" + #include "fsloc.h" + #include "pseudoflavors.h" ++#include "xcommon.h" + + #ifdef USE_BLKID + #include "blkid/blkid.h" diff --git a/SOURCES/nfs-utils-1.3.0-systemd-gssproxy-restart.patch b/SOURCES/nfs-utils-1.3.0-systemd-gssproxy-restart.patch new file mode 100644 index 0000000..498e50a --- /dev/null +++ b/SOURCES/nfs-utils-1.3.0-systemd-gssproxy-restart.patch @@ -0,0 +1,13 @@ +diff -up nfs-utils-1.3.0/systemd/nfs-server.service.orig nfs-utils-1.3.0/systemd/nfs-server.service +--- nfs-utils-1.3.0/systemd/nfs-server.service.orig 2017-12-12 10:16:47.164190963 -0500 ++++ nfs-utils-1.3.0/systemd/nfs-server.service 2017-12-12 10:54:16.671323896 -0500 +@@ -25,8 +25,8 @@ EnvironmentFile=-/run/sysconfig/nfs-util + Type=oneshot + RemainAfterExit=yes + ExecStartPre=-/usr/sbin/exportfs -r +-ExecStartPre=-/bin/sh -c '/bin/kill -HUP `cat /run/gssproxy.pid`' + ExecStart=/usr/sbin/rpc.nfsd $RPCNFSDARGS ++ExecStartPost=-/bin/sh -c 'if systemctl -q is-active gssproxy; then systemctl restart gssproxy ; fi' + ExecStop=/usr/sbin/rpc.nfsd 0 + ExecStopPost=/usr/sbin/exportfs -au + ExecStopPost=/usr/sbin/exportfs -f diff --git a/SOURCES/nfs-utils-1.3.0-systemd-nfs-man.patch b/SOURCES/nfs-utils-1.3.0-systemd-nfs-man.patch new file mode 100644 index 0000000..22bc0ed --- /dev/null +++ b/SOURCES/nfs-utils-1.3.0-systemd-nfs-man.patch @@ -0,0 +1,43 @@ +diff -up nfs-utils-1.3.0/systemd/nfs.systemd.man.orig nfs-utils-1.3.0/systemd/nfs.systemd.man +--- nfs-utils-1.3.0/systemd/nfs.systemd.man.orig 2018-07-21 06:10:06.938288975 -0400 ++++ nfs-utils-1.3.0/systemd/nfs.systemd.man 2018-07-21 06:10:18.888434798 -0400 +@@ -79,7 +79,7 @@ unit should be enabled. + Several other units which might be considered to be optional, such as + .I rpc-gssd.service + are careful to only start if the required configuration file exists. +-.I rpc-gsdd.service ++.I rpc-gssd.service + will not start if the + .I krb5.keytab + file does not exist (typically in +@@ -120,10 +120,11 @@ be needed to reduce system load to an ab + attack surface by not running daemons that are not absolutely + required. + .PP +-Two particular services which this can apply to are +-.I rpcbind ++Three particular services which this can apply to are ++.IR rpcbind , ++.IR idmapd , + and +-.IR idmapd . ++.IR rpc-gssd . + .I rpcbind + is not part of the + .I nfs-utils +@@ -155,6 +156,15 @@ is not needed and not wanted, it can be + .RS + .B systemctl mask idmapd + .RE ++.I rpc-gssd ++is assumed to be needed if the ++.I krb5.keytab ++file is present. If a site needs this file present but does not want ++.I rpc-gssd ++running, it can be masked with ++.RS ++.B systemctl mask rpc-gssd ++.RE + .SH FILES + /etc/nfs.conf + .br diff --git a/SOURCES/nfs-utils_env.sh b/SOURCES/nfs-utils_env.sh index 246e894..40ee80f 100644 --- a/SOURCES/nfs-utils_env.sh +++ b/SOURCES/nfs-utils_env.sh @@ -11,6 +11,15 @@ if test -r $nfs_config; then . $nfs_config fi +[ -n "$LOCKDARG" ] && /sbin/modprobe lockd $LOCKDARG +if [ -n "$LOCKD_TCPPORT" -o -n "$LOCKD_UDPPORT" ]; then + [ -z "$LOCKDARG" ] && /sbin/modprobe lockd $LOCKDARG + [ -n "$LOCKD_TCPPORT" ] && \ + /sbin/sysctl -w fs.nfs.nlm_tcpport=$LOCKD_TCPPORT >/dev/null 2>&1 + [ -n "$LOCKD_UDPPORT" ] && \ + /sbin/sysctl -w fs.nfs.nlm_udpport=$LOCKD_UDPPORT >/dev/null 2>&1 +fi + if [ -n "$MOUNTD_PORT" ]; then RPCMOUNTDOPTS="$RPCMOUNTDOPTS -p $MOUNTD_PORT" fi diff --git a/SOURCES/nfs.sysconfig b/SOURCES/nfs.sysconfig index 7e0c827..23c0ac2 100644 --- a/SOURCES/nfs.sysconfig +++ b/SOURCES/nfs.sysconfig @@ -1,10 +1,15 @@ - # +# Note: For new values to take effect the nfs-config service +# has to be restarted with the following command: +# systemctl restart nfs-config # -# To set lockd kernel module parameters please see -# /etc/modprobe.d/lockd.conf +# Optional arguments passed to in-kernel lockd +#LOCKDARG= +# TCP port rpc.lockd should listen on. +#LOCKD_TCPPORT=32803 +# UDP port rpc.lockd should listen on. +#LOCKD_UDPPORT=32769 # - # Optional arguments passed to rpc.nfsd. See rpc.nfsd(8) RPCNFSDARGS="" # Number of nfs server processes to be started. diff --git a/SPECS/nfs-utils.spec b/SPECS/nfs-utils.spec index 7b83227..c58e8ec 100644 --- a/SPECS/nfs-utils.spec +++ b/SPECS/nfs-utils.spec @@ -2,7 +2,7 @@ Summary: NFS utilities and supporting clients and daemons for the kernel NFS ser Name: nfs-utils URL: http://sourceforge.net/projects/nfs Version: 1.3.0 -Release: 0.48%{?dist}.3 +Release: 0.61%{?dist} Epoch: 1 # group all 32bit related archs @@ -126,12 +126,33 @@ Patch095: nfs-utils-1.3.0-mount-use-minor-default.patch Patch096: nfs-utils-1.3.0-mount-restore-econn.patch Patch097: nfs-utils-1.3.0-exportfs-path-comp.patch # -# RHEL7.4-Z +# RHEL7.5 # -Patch098: nfs-utils-1.3.0-mount-addressfailed.patch -Patch099: nfs-utils-1.3.0-mount-eacces.patch -Patch100: nfs-utils-1.3.0-mount-minorversion.patch -Patch101: nfs-utils-1.3.0-mount-t-nfs4.patch +Patch098: nfs-utils-1.3.0-mount-eacces.patch +Patch099: nfs-utils-1.3.0-mount-minorversion.patch +Patch100: nfs-utils-1.3.0-mountstats-shebang.patch +Patch101: nfs-utils-1.3.0-nfsdcltrack-warning01.patch +Patch102: nfs-utils-1.3.0-mount-addressfailed.patch +Patch103: nfs-utils-1.3.0-mount-nfsvers.patch +Patch104: nfs-utils-1.3.0-server-chgrpcpipefs.patch +Patch105: nfs-utils-1.3.0-nfsdcltrack-invalops.patch +Patch106: nfs-utils-1.3.0-nfs-man-v2.patch +Patch107: nfs-utils-1.3.0-nfs-iostat-no-dev.patch +Patch108: nfs-utils-1.3.0-mount-t-nfs4.patch +# +# RHEL7.6 +# +Patch109: nfs-utils-1.3.0-mountstats-rdma.patch +Patch110: nfs-utils-1.3.0-systemd-gssproxy-restart.patch +Patch111: nfs-utils-1.3.0-nfsd-defautvers.patch +Patch112: nfs-utils-1.3.0-exportfs-rwro-display.patch +Patch113: nfs-utils-1.3.0-nfsclient-getopt.patch +Patch114: nfs-utils-1.3.0-nfsmountconf-typo.patch +Patch115: nfs-utils-1.3.0-rpcgssd-16bits.patch +Patch116: nfs-utils-1.3.0-systemd-nfs-man.patch +Patch117: nfs-utils-1.3.0-mount-clientaddr.patch +Patch118: nfs-utils-1.3.0-mount-turnoffv4.patch +Patch119: nfs-utils-1.3.0-nfsconf-disable-v4.patch Patch1000: nfs-utils-1.2.1-statdpath-man.patch Patch1001: nfs-utils-1.2.1-exp-subtree-warn-off.patch @@ -383,14 +404,50 @@ This package also contains the mount.nfs and umount.nfs program. %patch096 -p1 # 1389046 Pacemaker node fenced out due to redundant export... %patch097 -p1 -# 1498959 - RHEL7.4: service nfs-server start fails the first time... +# 1479573 - RHEL7.4: NFS mount to DELL/EMC Isilon servers fails... %patch098 -p1 -# 1518718 - RHEL7.4: NFS mount to DELL/EMC Isilon servers fails... +# 1489262 - nfs-utils: minorversion can't work %patch099 -p1 -# 1547681 - nfs-utils: minorversion can't work +# 987031 - nfs-utils - shebang with /usr/bin/env %patch100 -p1 -# 1551927 - Incorrect NFS version string reported for NFSv4.2 mounts +# 1475462 - nfsdcltrack -d should log to syslog without... %patch101 -p1 +# 1450528 - RHEL7.4: service nfs-server start fails the first... +%patch102 -p1 +# 1496822 - mount.nfs calls mount() with nfsvers setting from... +%patch103 -p1 +# 1358333 - nfs-server: Possibility to change rpc_pipefs mount point +%patch104 -p1 +# 1461349 - nfsdcltrack should return error code instead of 0.... +%patch105 -p1 +# 1452461 - NFSv2 is supported at RHEL 7 nfs server end after making... +%patch106 -p1 +# 1508046 - nfsiostat errors on 'no device mounted on /sys/kernel/debug... +%patch107 -p1 +# 1547506 - Incorrect NFS version string reported for NFSv4.2 mounts +%patch108 -p1 +# 1527938 - mountstats: Use correct RDMA terminology +%patch109 -p1 +# 1527653 - nfs-server.service should use systemctl rather than.... +%patch110 -p1 +# 1436977 - [nfsd] cannot enable minor version 4.1 4.2 by... +%patch111 -p1 +# 1532688 - Varying ro/rw in NFS export based on security flavor doesn't work +%patch112 -p1 +# 1551903 - nfsdcltrack fails to initialize the database in ... +%patch113 -p1 +# 1592235 - Typo in /etc/nfsmount.conf +%patch114 -p1 +# 1602836 - Kerberos-enabled NFSv4 doesn't work on armv7hl +%patch115 -p1 +# 1334510 - nfs v4 mounts with sec=sys are slow to succeed... +%patch116 -p1 +# 1592915 - Do sanity checking of clientaddr user input during mount processing +%patch117 -p1 +# 1596138 - [rpc.nfsd] Setting version failed: errno 22 (Invalid argument)... +%patch118 -p1 +# 1625032 - [nfsd] fail to disable major NFS version 4 using "vers4=n"... +%patch119 -p1 %patch1000 -p1 %patch1001 -p1 @@ -635,6 +692,7 @@ fi %{_unitdir}/* %attr(755,root,root) /usr/lib/systemd/scripts/nfs-utils_env.sh %{_prefix}/lib/systemd/system-generators/nfs-server-generator +%{_prefix}/lib/systemd/system-generators/rpc-pipefs-generator %attr(4755,root,root) /sbin/mount.nfs /sbin/mount.nfs4 @@ -642,17 +700,56 @@ fi /sbin/umount.nfs4 %changelog -* Wed Mar 14 2018 Steve Dickson 1.3.0-0.48_4.3 -- mount: move handling of "-t nfs4" into nfs_nfs_version() (bz 1551927) +* Wed Sep 26 2018 Steve Dickson 1.3.0-0.61 +- nfs.conf: fail to disable major NFS version 4 using "vers4=n" (bz 1625032) + +* Mon Aug 20 2018 Steve Dickson 1.3.0-0.60 +- Updated: nfsd: Allow the caller to turn off NFSv4.0 (bz 1596138) + +* Thu Aug 9 2018 Steve Dickson 1.3.0-0.59 +- nfsd: Allow the caller to turn off NFSv4.0 (bz 1596138) + +* Tue Jul 31 2018 Steve Dickson 1.3.0-0.58 +- mount.nfs: Add check of clientaddr argument (bz 1592915) + +* Sat Jul 21 2018 Steve Dickson 1.3.0-0.57 +- rpc.gssd: truncates 32-bit UIDs/GIDs to 16 bits architectures (bz 1602836) +- Added back lockd vars to nfs-utils_env.sh and sysconfig (bz 1413272) +- Document nfs v4 mounts will use Kerberos we available (bz 1334510) -* Thu Feb 22 2018 Steve Dickson 1.3.0-0.48_4.2 -- mount: Fix problems with parsing minorversion= (bz 1547681) +* Tue Jul 10 2018 Steve Dickson 1.3.0-0.56 +- exportfs: move ro/rw option back to secinfo_flag_displaymap table (bz 1532688) +- nfsdcltrack: getopt_long() fails on a non x86_64 archs (bz 1551903) +- Fixed typo in nfsmount.conf (bz 1592235) -* Thu Nov 30 2017 Steve Dickson 1.3.0-0.48_4.1 -- mount: handle EACCES during version negotiation (bz 1518718) +* Mon Jun 11 2018 Steve Dickson 1.3.0-0.55 +- mountstats: use correct RDMA terminology (bz 1527938) +- nfs-server: restart gssproxy when the server is restarted. (bz 1527653) +- nfsd: Set default minor versions (bz 1436977) -* Fri Oct 6 2017 Steve Dickson 1.3.0-0.48_4 +* Thu Feb 22 2018 Steve Dickson 1.3.0-0.54 +- mount: move handling of "-t nfs4" into nfs_nfs_version() (bz 1547506) + +* Tue Jan 2 2018 Steve Dickson 1.3.0-0.53 +- nfs(5): updated mount information to say 4.1 (bz 1452461) + +* Fri Nov 3 2017 Steve Dickson 1.3.0-0.52 +- nfs(5): update some version information (bz 1452461) +- nfsiostat: avoid parsing "no device mounted ..." line (bz 1508046) + +* Thu Oct 12 2017 Steve Dickson 1.3.0-0.51 +- systemd: add a generator for the rpc_pipefs mountpoint (bz 1358333) +- nfsdcltrack: return an non-zero value for invalid options (bz 1461349) + +* Thu Oct 5 2017 Steve Dickson 1.3.0-0.50 - rpc.nfsd: Do not fail when all address families are not support (bz 1450528) +- mount.nfs: merge in vers= and nfsvers= options (bz 1496822) + +* Tue Sep 19 2017 Steve Dickson 1.3.0-0.49 +- mount: handle EACCES during version negotiation (bz 1479573) +- mount: Fix problems with parsing minorversion= (bz 1489262) +- mountstats: Remove a shebang (bz 987031) +- nfsdcltrack: remove a warning (bz 1475462) * Mon Jun 19 2017 Steve Dickson 1.3.0-0.48 - exportfs: fix path comparison in unexportfs_parsed() (bz 1389046)