From: neilbrown Date: Thu, 17 Jul 2003 23:41:19 +0000 (+0000) Subject: Release 1.0.5 X-Git-Tag: nfs-utils-1-0-5^0 X-Git-Url: https://git.decadent.org.uk/gitweb/?p=nfs-utils.git;a=commitdiff_plain;h=bce6f6871f481087890674497b4b2154dc4825fc Release 1.0.5 --- diff --git a/ChangeLog b/ChangeLog index 8763854..5b82257 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,23 @@ +2003-07-18 NeilBrown + + Release 1.0.5: + 1.0.4 was a bit of a brown-paper-bag-release because of the extra + 'free' in auth.c. So I'm releasing this just a few days later. + + * support/nfs/cacheio.c(cache_flush): Correct test for 'open + failed' + * utils/exportfs/exportfs.c(main): If "-f" given as lone option, + check if new_cache is enabled, error if not, flush and exit if it + is. + * utils/exportfs/exportfs.man: Explain -f option and explain the + two different modes that exportfs can work in. + * utils/mountd/mountd.c: Do not change RLIMIT_NOFILE if the -o + option wasn't given. + * utils/mountd/mountd.man: Record the change if default behaviour + for RLIMIT_NOFILE. + * configure.in, nfs-utils.spec: update version to 1.0.5 and + run autoconf + 2003-07-15 NeilBrown * utils/mountd/mountd.c(main): getopt string fix for 'o' diff --git a/configure b/configure index 0922048..b077c1f 100755 --- a/configure +++ b/configure @@ -539,7 +539,7 @@ fi # The nfs-utils version -VERSION="1.0.4" +VERSION="1.0.5" # Check whether --with-release or --without-release was given. diff --git a/configure.in b/configure.in index 017e795..f726549 100644 --- a/configure.in +++ b/configure.in @@ -4,7 +4,7 @@ AC_INIT(rules.mk) AC_PREFIX_DEFAULT(/usr) # The nfs-utils version -VERSION="1.0.4" +VERSION="1.0.5" AC_SUBST(VERSION) dnl ************************************************************* diff --git a/nfs-utils.spec b/nfs-utils.spec index 3b89f31..f98ed59 100644 --- a/nfs-utils.spec +++ b/nfs-utils.spec @@ -6,7 +6,7 @@ Summary: NFS utlilities and supporting daemons for the kernel NFS server. Name: nfs-utils -Version: 1.0.4 +Version: 1.0.5 Release: 1 Source0: ftp://nfs.sourceforge.net/pub/nfs/%{name}-%{version}.tar.gz Group: System Environment/Daemons diff --git a/support/nfs/cacheio.c b/support/nfs/cacheio.c index 77facb1..ff5b028 100644 --- a/support/nfs/cacheio.c +++ b/support/nfs/cacheio.c @@ -260,7 +260,7 @@ cache_flush(int force) int fd; sprintf(path, "/proc/net/rpc/%s/flush", cachelist[c]); fd = open(path, O_RDWR); - if (fd) { + if (fd >= 0) { write(fd, stime, strlen(stime)); close(fd); } diff --git a/utils/exportfs/exportfs.c b/utils/exportfs/exportfs.c index fe0f6ba..cbb0aa9 100644 --- a/utils/exportfs/exportfs.c +++ b/utils/exportfs/exportfs.c @@ -91,16 +91,22 @@ main(int argc, char **argv) fprintf(stderr, "exportfs: -r and -u are incompatible.\n"); return 1; } + new_cache = check_new_cache(); if (optind == argc && ! f_all) { if (force_flush) { - cache_flush(1); + if (new_cache) + cache_flush(1); + else { + fprintf(stderr, "exportfs: -f: only available with new cache controls: mount /proc/fs/nfs first\n"); + exit(1); + } + return 0; } else { xtab_export_read(); dump(f_verbose); return 0; } } - new_cache = check_new_cache(); if (f_export && ! f_ignore) export_read(_PATH_EXPORTS); diff --git a/utils/exportfs/exportfs.man b/utils/exportfs/exportfs.man index 510c48f..7d18509 100644 --- a/utils/exportfs/exportfs.man +++ b/utils/exportfs/exportfs.man @@ -2,8 +2,8 @@ .\" exportfs(8) .\" .\" Copyright (C) 1995 Olaf Kirch -.\" Modifications 1999 Neil Brown -.TH exportfs 8 "7 Sep 1999" +.\" Modifications 1999-2003 Neil Brown +.TH exportfs 8 "18 July 2003" .SH NAME exportfs \- maintain list of NFS exported file systems .SH SYNOPSIS @@ -15,6 +15,8 @@ exportfs \- maintain list of NFS exported file systems .br .BI "/usr/sbin/exportfs [-v] .br +.BI "/usr/sbin/exportfs -f" +.br .SH DESCRIPTION The .B exportfs @@ -39,7 +41,30 @@ without modifying using .BR exportfs . .P -Any export requests which identify a specific host (rather than a +.B exportfs +and it's partner program +.B mountd +work in one of two modes, a legacy mode which applies to 2.4 and +earlier versions of the Linux kernel, and a new mode which applies to +2.6 and later versions providing the +.B nfsd +virtual filesystem has been mounted at +.BR /proc/fs/nfs . +If this filesystem is not mounted in 2.6, the legacy mode is used. +.P +In the new mode, +.B exportfs +does not give any information to the kernel but only provides it to +.B mountd +through the +.B /var/lib/nfs/xtab +file. +.B mountd +will listen to requests from the kernel and will provide information +as needed. +.P +In the legacy mode, +any export requests which identify a specific host (rather than a subnet or netgroup etc) are entered directly into the kernel's export table as well as being written to .BR /var/lib/nfs/xtab . @@ -71,10 +96,15 @@ with /etc/exports. It removes entries in /var/lib/nfs/xtab which are deleted from /etc/exports, and remove any entries from the kernel export table which are no longer valid. .TP -.TP .B -u Unexport one or more directories. .TP +.B -f +In 'new' mode, flush everything out of the kernels export table. Any +clients that are active will get new entries added by +.B mountd +when they make their next request. +.TP .B -v Be verbose. When exporting or unexporting, show what's going on. When displaying the current export list, also display the list of export diff --git a/utils/mountd/mountd.c b/utils/mountd/mountd.c index ae5daa1..d0d8103 100644 --- a/utils/mountd/mountd.c +++ b/utils/mountd/mountd.c @@ -431,7 +431,7 @@ main(int argc, char **argv) char *export_file = _PATH_EXPORTS; int foreground = 0; int port = 0; - int descriptors = 256; + int descriptors = 0; int c; struct sigaction sa; struct rlimit rlim; @@ -498,19 +498,20 @@ main(int argc, char **argv) exit(1); } - if (getrlimit (RLIMIT_NOFILE, &rlim) != 0) { - fprintf(stderr, "%s: getrlimit (RLIMIT_NOFILE) failed: %s\n", - argv [0], strerror(errno)); - exit(1); - } + if (descriptors) { + if (getrlimit (RLIMIT_NOFILE, &rlim) != 0) { + fprintf(stderr, "%s: getrlimit (RLIMIT_NOFILE) failed: %s\n", + argv [0], strerror(errno)); + exit(1); + } - rlim.rlim_cur = descriptors; - if (setrlimit (RLIMIT_NOFILE, &rlim) != 0) { - fprintf(stderr, "%s: setrlimit (RLIMIT_NOFILE) failed: %s\n", - argv [0], strerror(errno)); - exit(1); + rlim.rlim_cur = descriptors; + if (setrlimit (RLIMIT_NOFILE, &rlim) != 0) { + fprintf(stderr, "%s: setrlimit (RLIMIT_NOFILE) failed: %s\n", + argv [0], strerror(errno)); + exit(1); + } } - /* Initialize logging. */ /* xlog_open("mountd"); */ diff --git a/utils/mountd/mountd.man b/utils/mountd/mountd.man index 77f4e26..6e79529 100644 --- a/utils/mountd/mountd.man +++ b/utils/mountd/mountd.man @@ -74,7 +74,7 @@ Display usage message. .TP .B \-o num " or " \-\-descriptors num Set the limit of the number of open file descriptors to num. The -default is 256. +default is to leave the limit unchanged. .TP .B \-N " or " \-\-no-nfs-version This option can be used to request that