+2003-07-18 NeilBrown <neilb@cse.unsw.edu.au>
+
+ 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 <neilb@cse.unsw.edu.au>
* utils/mountd/mountd.c(main): getopt string fix for 'o'
# The nfs-utils version
-VERSION="1.0.4"
+VERSION="1.0.5"
# Check whether --with-release or --without-release was given.
AC_PREFIX_DEFAULT(/usr)
# The nfs-utils version
-VERSION="1.0.4"
+VERSION="1.0.5"
AC_SUBST(VERSION)
dnl *************************************************************
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
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);
}
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);
.\" exportfs(8)
.\"
.\" Copyright (C) 1995 Olaf Kirch <okir@monad.swb.de>
-.\" Modifications 1999 Neil Brown <neilb@cse.unsw.edu.au>
-.TH exportfs 8 "7 Sep 1999"
+.\" Modifications 1999-2003 Neil Brown <neilb@cse.unsw.edu.au>
+.TH exportfs 8 "18 July 2003"
.SH NAME
exportfs \- maintain list of NFS exported file systems
.SH SYNOPSIS
.br
.BI "/usr/sbin/exportfs [-v]
.br
+.BI "/usr/sbin/exportfs -f"
+.br
.SH DESCRIPTION
The
.B exportfs
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 .
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
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;
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"); */
.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