From 859b4d5faa75619a7a0b091a340d96827fe4be0d Mon Sep 17 00:00:00 2001 From: kzak Date: Wed, 20 Sep 2006 14:26:00 +0000 Subject: [PATCH] remove obsolete NFS from mount code (we use mount.nfs from nfs-utils) --- util-linux-2.13-mount-man-bugs.patch | 13 -- util-linux-2.13-mount-man-nfs.patch | 84 ++++++++++++ util-linux-2.13-mount-man-nfs4.patch | 106 +++++++++++++++ util-linux-2.13-mount-nonfs.patch | 196 +++++++++++++++++++++++++++ util-linux.spec | 51 ++----- 5 files changed, 400 insertions(+), 50 deletions(-) create mode 100644 util-linux-2.13-mount-man-nfs.patch create mode 100644 util-linux-2.13-mount-man-nfs4.patch create mode 100644 util-linux-2.13-mount-nonfs.patch diff --git a/util-linux-2.13-mount-man-bugs.patch b/util-linux-2.13-mount-man-bugs.patch index 79c3b0f..59f8c8f 100644 --- a/util-linux-2.13-mount-man-bugs.patch +++ b/util-linux-2.13-mount-man-bugs.patch @@ -1,16 +1,3 @@ ---- util-linux-2.13-pre7/mount/nfs.5.bugs 2006-03-30 21:37:53.000000000 +0200 -+++ util-linux-2.13-pre7/mount/nfs.5 2006-03-30 21:38:13.000000000 +0200 -@@ -443,3 +443,10 @@ - .P - The umount command should notify the server - when an NFS filesystem is unmounted. -+.P -+Checking files on NFS filesystem referenced by file descriptors (i.e. the -+.BR fcntl -+and -+.BR ioctl -+families of functions) may lead to inconsistent result due to the lack of -+consistency check in kernel even if noac is used. --- util-linux-2.13-pre7/mount/mount.8.bugs 2006-03-30 21:36:56.000000000 +0200 +++ util-linux-2.13-pre7/mount/mount.8 2006-03-30 21:37:35.000000000 +0200 @@ -2047,6 +2047,23 @@ diff --git a/util-linux-2.13-mount-man-nfs.patch b/util-linux-2.13-mount-man-nfs.patch new file mode 100644 index 0000000..4c24f6c --- /dev/null +++ b/util-linux-2.13-mount-man-nfs.patch @@ -0,0 +1,84 @@ +--- util-linux-2.12p/mount/mount.8.nfsdoc 2005-05-10 11:46:25.119592000 -0400 ++++ util-linux-2.12p/mount/mount.8 2005-10-07 09:46:13.374277000 -0400 +@@ -1339,29 +1339,17 @@ For details, see + + Especially useful options include + .TP +-.B rsize=8192,wsize=8192 +-This will make your nfs connection faster than with the default +-buffer size of 4096. (NFSv2 does not work with larger values of +-.B rsize +-and +-.BR wsize .) +-.TP +-.B hard +-The program accessing a file on a NFS mounted file system will hang +-when the server crashes. The process cannot be interrupted or +-killed unless you also specify +-.BR intr . +-When the NFS server is back online the program will continue undisturbed +-from where it was. This is probably what you want. +-.TP +-.B soft +-This option allows the kernel to time out if the nfs server is not +-responding for some time. The time can be +-specified with +-.BR timeo=time . +-This option might be useful if your nfs server sometimes doesn't respond +-or will be rebooted while some process tries to get a file from the server. +-Usually it just causes lots of trouble. ++.B rsize=32768,wsize=32768 ++This causes the NFS client to try to negotiate a buffer size ++up to the size specified. ++A large buffer size does improve performance, but both the ++server and client have to support it. ++In the case where one of these does not support the size specified, ++the size negotiated will be the largest that both support. ++.TP ++.B intr ++This will allow NFS operations (on hard mounts) to be ++interrupted while waiting for a response from the server. + .TP + .B nolock + Do not use locking. Do not start lockd. +@@ -1408,30 +1396,16 @@ For details, see + Especially useful options include + .TP + .B rsize=32768,wsize=32768 +-This will make your NFS connection faster than with the default +-buffer size of 4096. +-.TP +-.B hard +-The program accessing a file on a NFS mounted file system will hang +-when the server crashes. The process cannot be interrupted or +-killed unless you also specify +-.BR intr . +-When the NFS server is back online the program will continue undisturbed +-from where it was. This is probably what you want. +-.TP +-.B soft +-This option allows the kernel to time out if the NFS server is not +-responding for some time. The time can be +-specified with +-.BR timeo=time . +-This timeout value is expressed in tenths of a second. +-The +-.BR soft +-option might be useful if your NFS server sometimes doesn't respond +-or will be rebooted while some process tries to get a file from the server. +-Avoid using this option with +-.BR proto=udp +-or with a short timeout. ++This causes the NFS4 client to try to negotiate a buffer size ++up to the size specified. ++A large buffer size does improve performance, but both the ++server and client have to support it. ++In the case where one of these does not support the size specified, ++the size negotiated will be the largest that both support. ++.TP ++.B intr ++This will allow NFS4 operations (on hard mounts) to be ++interrupted while waiting for a response from the server. + + .SH "Mount options for ntfs" + .TP diff --git a/util-linux-2.13-mount-man-nfs4.patch b/util-linux-2.13-mount-man-nfs4.patch new file mode 100644 index 0000000..98807d8 --- /dev/null +++ b/util-linux-2.13-mount-man-nfs4.patch @@ -0,0 +1,106 @@ +--- util-linux-2.13-pre2/mount/mount.8.nfsv4 2005-08-02 19:34:16.000000000 +0200 ++++ util-linux-2.13-pre2/mount/mount.8 2005-08-17 10:44:06.000000000 +0200 +@@ -384,6 +384,7 @@ + .IR msdos , + .IR ncpfs , + .IR nfs , ++.IR nfs4 , + .IR ntfs , + .IR proc , + .IR qnx4 , +@@ -421,7 +422,7 @@ + program has to do is issue a simple + .IR mount (2) + system call, and no detailed knowledge of the filesystem type is required. +-For a few types however (like nfs, smbfs, ncpfs) ad hoc code is ++For a few types however (like nfs, nfs4, smbfs, ncpfs) ad hoc code is + necessary. The nfs ad hoc code is built in, but smbfs and ncpfs + have a separate mount program. In order to make it possible to + treat all types in a uniform way, mount will execute the program +@@ -449,9 +450,10 @@ + All of the filesystem types listed there will be tried, + except for those that are labeled "nodev" (e.g., + .IR devpts , +-.I proc ++.IR proc , ++.IR nfs , + and +-.IR nfs ). ++.IR nfs4 ). + If + .I /etc/filesystems + ends in a line with a single * only, mount will read +@@ -1373,6 +1375,73 @@ + .B nolock + Do not use locking. Do not start lockd. + ++.SH "Mount options for nfs4" ++Instead of a textual option string, parsed by the kernel, the ++.I nfs4 ++file system expects a binary argument of type ++.IR "struct nfs4_mount_data" . ++The program ++.B mount ++itself parses the following options of the form `tag=value', ++and puts them in the structure mentioned: ++.BI rsize= n, ++.BI wsize= n, ++.BI timeo= n, ++.BI retrans= n, ++.BI acregmin= n, ++.BI acregmax= n, ++.BI acdirmin= n, ++.BI acdirmax= n, ++.BI actimeo= n, ++.BI retry= n, ++.BI port= n, ++.BI proto= n, ++.BI clientaddr= n, ++.BI sec= n. ++The option ++.BI addr= n ++is accepted but ignored. ++Also the following Boolean options, possibly preceded by ++.B no ++are recognized: ++.BR bg , ++.BR fg , ++.BR soft , ++.BR hard , ++.BR intr , ++.BR cto , ++.BR ac , ++For details, see ++.BR nfs (5). ++ ++Especially useful options include ++.TP ++.B rsize=32768,wsize=32768 ++This will make your NFS connection faster than with the default ++buffer size of 4096. ++.TP ++.B hard ++The program accessing a file on a NFS mounted file system will hang ++when the server crashes. The process cannot be interrupted or ++killed unless you also specify ++.BR intr . ++When the NFS server is back online the program will continue undisturbed ++from where it was. This is probably what you want. ++.TP ++.B soft ++This option allows the kernel to time out if the NFS server is not ++responding for some time. The time can be ++specified with ++.BR timeo=time . ++This timeout value is expressed in tenths of a second. ++The ++.BR soft ++option might be useful if your NFS server sometimes doesn't respond ++or will be rebooted while some process tries to get a file from the server. ++Avoid using this option with ++.BR proto=udp ++or with a short timeout. ++ + .SH "Mount options for ntfs" + .TP + .BI iocharset= name diff --git a/util-linux-2.13-mount-nonfs.patch b/util-linux-2.13-mount-nonfs.patch new file mode 100644 index 0000000..e2ccb2b --- /dev/null +++ b/util-linux-2.13-mount-nonfs.patch @@ -0,0 +1,196 @@ +--- util-linux-2.13-pre6/mount/Makefile.am.nonfs 2006-09-20 12:45:50.000000000 +0200 ++++ util-linux-2.13-pre6/mount/Makefile.am 2006-09-20 12:46:51.000000000 +0200 +@@ -1,15 +1,12 @@ + include $(top_srcdir)/config/include-Makefile.am + +-AM_CPPFLAGS += -DHAVE_NFS +- + bin_PROGRAMS = mount umount + sbin_PROGRAMS = losetup swapon +-man_MANS = fstab.5 nfs.5 mount.8 swapoff.8 swapon.8 umount.8 losetup.8 ++man_MANS = fstab.5 mount.8 swapoff.8 swapon.8 umount.8 losetup.8 + + mount_SOURCES = mount.c fstab.c sundries.c xmalloc.c realpath.c mntent.c \ + get_label_uuid.c mount_by_label.c mount_blkid.c mount_guess_fstype.c \ + getusername.c \ +- nfsmount.c nfsmount_xdr.c nfsmount_clnt.c \ + lomount.c + + mount_LDADD = $(top_srcdir)/lib/libenv.a $(top_srcdir)/lib/libsetproctitle.a +--- util-linux-2.13-pre6/mount/sundries.c.nonfs 2006-09-20 12:53:09.000000000 +0200 ++++ util-linux-2.13-pre6/mount/sundries.c 2006-09-20 12:53:13.000000000 +0200 +@@ -15,7 +15,6 @@ + #include "fstab.h" + #include "sundries.h" + #include "realpath.h" +-#include "nfsmount.h" + #include "nls.h" + + char * +--- util-linux-2.13-pre6/mount/umount.c.nonfs 2006-09-20 12:51:11.000000000 +0200 ++++ util-linux-2.13-pre6/mount/umount.c 2006-09-20 12:52:26.000000000 +0200 +@@ -20,15 +20,6 @@ + #include "env.h" + #include "nls.h" + +-#include +-#include +-#include +-#include +-#include +-#include +-#include "nfsmount.h" +-#include +- + #if defined(MNT_FORCE) && !defined(__sparc__) && !defined(__arm__) + /* Interesting ... it seems libc knows about MNT_FORCE and presumably + about umount2 as well -- need not do anything */ +@@ -144,98 +135,6 @@ + return 0; + } + +-static int xdr_dir(XDR *xdrsp, char *dirp) +-{ +- return (xdr_string(xdrsp, &dirp, MNTPATHLEN)); +-} +- +-static int +-nfs_umount_rpc_call(const char *spec, const char *opts) +-{ +- register CLIENT *clp; +- struct sockaddr_in saddr; +- struct timeval pertry, try; +- enum clnt_stat clnt_stat; +- int port = 0; +- int so = RPC_ANYSOCK; +- struct hostent *hostp; +- char *hostname; +- char *dirname; +- char *p; +- +- if (spec == NULL || (p = strchr(spec,':')) == NULL) +- return 0; +- hostname = xstrndup(spec, p-spec); +- dirname = xstrdup(p+1); +-#ifdef DEBUG +- printf(_("host: %s, directory: %s\n"), hostname, dirname); +-#endif +- +- if (opts && (p = strstr(opts, "addr="))) { +- char *q; +- +- free(hostname); +- p += 5; +- q = p; +- while (*q && *q != ',') q++; +- hostname = xstrndup(p,q-p); +- } +- +- if (opts && (p = strstr(opts, "mountport=")) && isdigit(*(p+10))) +- port = atoi(p+10); +- +- if (hostname[0] >= '0' && hostname[0] <= '9') +- saddr.sin_addr.s_addr = inet_addr(hostname); +- else { +- if ((hostp = gethostbyname(hostname)) == NULL) { +- fprintf(stderr, _("umount: can't get address for %s\n"), +- hostname); +- return 1; +- } +- if (hostp->h_length > sizeof(struct in_addr)) { +- fprintf(stderr, _("umount: got bad hostp->h_length\n")); +- hostp->h_length = sizeof(struct in_addr); +- } +- memcpy(&saddr.sin_addr, hostp->h_addr, hostp->h_length); +- } +- +- saddr.sin_family = AF_INET; +- saddr.sin_port = htons(port); +- pertry.tv_sec = 3; +- pertry.tv_usec = 0; +- if (opts && (p = strstr(opts, "tcp"))) { +- /* possibly: make sure option is not "notcp" +- possibly: try udp if tcp fails */ +- if ((clp = clnttcp_create(&saddr, MOUNTPROG, MOUNTVERS, +- &so, 0, 0)) == NULL) { +- clnt_pcreateerror("Cannot MOUNTPROG RPC (tcp)"); +- return 1; +- } +- } else { +- if ((clp = clntudp_create(&saddr, MOUNTPROG, MOUNTVERS, +- pertry, &so)) == NULL) { +- clnt_pcreateerror("Cannot MOUNTPROG RPC"); +- return 1; +- } +- } +- clp->cl_auth = authunix_create_default(); +- try.tv_sec = 20; +- try.tv_usec = 0; +- clnt_stat = clnt_call(clp, MOUNTPROC_UMNT, +- (xdrproc_t) xdr_dir, dirname, +- (xdrproc_t) xdr_void, (caddr_t) 0, +- try); +- +- if (clnt_stat != RPC_SUCCESS) { +- clnt_perror(clp, "Bad UMNT RPC"); +- return 1; +- } +- auth_destroy(clp->cl_auth); +- clnt_destroy(clp); +- +- return 0; +-} +- + /* complain about a failed umount */ + static void complain(int err, const char *dev) { + switch (err) { +@@ -289,11 +188,6 @@ + if (check_special_umountprog(spec, node, type, &status)) + return status; + +- /* Ignore any RPC errors, so that you can umount the filesystem +- if the server is down. */ +- if (strcasecmp(type, "nfs") == 0) +- nfs_umount_rpc_call(spec, opts); +- + umnt_err = umnt_err2 = 0; + if (lazy) { + res = umount2 (node, MNT_DETACH); +--- util-linux-2.13-pre6/mount/mount.c.nonfs 2006-09-20 12:48:48.000000000 +0200 ++++ util-linux-2.13-pre6/mount/mount.c 2006-09-20 12:48:33.000000000 +0200 +@@ -966,19 +966,6 @@ + goto out; + } + +- /* +- * Also nfs requires a separate program, but it is built in. +- */ +- if (!fake && types && streq (types, "nfs")) { +-retry_nfs: +- mnt_err = nfsmount (spec, node, &flags, &extra_opts, &mount_opts, +- &nfs_mount_version, bg); +- if (mnt_err) { +- res = mnt_err; +- goto out; +- } +- } +- + block_signals (SIG_BLOCK); + + if (!fake) { +@@ -1018,15 +1005,6 @@ + + block_signals (SIG_UNBLOCK); + +- if (mnt_err && types && streq (types, "nfs")) { +- if (nfs_mount_version == 4 && mnt_err != EBUSY && mnt_err != ENOENT) { +- if (verbose) +- printf(_("mount: failed with nfs mount version 4, trying 3..\n")); +- nfs_mount_version = 3; +- goto retry_nfs; +- } +- } +- + /* Mount failed, complain, but don't die. */ + + if (types == 0) { diff --git a/util-linux.spec b/util-linux.spec index 09a100d..216e449 100644 --- a/util-linux.spec +++ b/util-linux.spec @@ -9,7 +9,7 @@ Summary: A collection of basic system utilities. Name: util-linux Version: 2.13 -Release: 0.41 +Release: 0.42 License: distributable Group: System Environment/Base @@ -109,13 +109,8 @@ Patch160: raw-handle-nonpresent-devs.patch Patch164: util-linux-2.12j-113790-hotkeys.patch -# patches required for NFSv4 support -Patch170: util-linux-2.13-nfsv4.patch -Patch171: util-linux-2.12a-mount-proto.patch -Patch172: util-linux-2.12a-nfsmount-overflow.patch -Patch173: util-linux-2.12a-nfsmount-reservp.patch -Patch174: util-linux-2.12p-nfsmount-rollback.patch - +# Info about NFS4 +Patch170: util-linux-2.13-mount-man-nfs4.patch # Makeing /var/log/lastlog (#151635) Patch180: util-linux-2.12p-login-lastlog.patch # Improved /etc/mtab lock (#143118) @@ -124,8 +119,6 @@ Patch181: util-linux-2.12p-mtab-lock.patch Patch182: util-linux-2.12p-ipcs-typo.patch # 154498 - util-linux login & pam session Patch183: util-linux-2.12a-pamsession.patch -# 155293 - man 5 nfs should include vers as a mount option -Patch184: util-linux-2.12p-nfsman.patch # 76467 - At boot time, fsck chokes on LVs listed by label in fstab Patch185: util-linux-2.12p-lvm2dupes-76467.patch # add note about ATAPI IDE floppy to fdformat.8 @@ -149,7 +142,7 @@ Patch206: util-linux-2.13-arch.patch # 165863 - swsusp swaps should be reinitialized Patch210: util-linux-2.13-swapon-suspend.patch # 170110 - Documentation for 'rsize' and 'wsize' NFS mount options is misleading -Patch211: util-linux-2.12p-nfs-manupdate.patch +Patch211: util-linux-2.13-mount-man-nfs.patch # 169628 - /usr/bin/floppy doesn't work with /dev/fd0 Patch212: util-linux-2.12p-floppy-generic.patch # 168436 - login will attempt to run if it has no read/write access to its terminal @@ -183,15 +176,6 @@ Patch225: util-linux-2.13-schedutils-man.patch Patch226: util-linux-2.13-login-pam-acct.patch # 177523 - umount -a should not unmount sysfs Patch227: util-linux-2.13-umount-sysfs.patch -# 169042 - Changed nfsmount to try udp before using tcp when rpc-ing -# the remote rpc.mountd (iff -o tcp is not specified). -Patch229: util-linux-2.13-nfsmount-mountd-udp.patch -# 151549 - Added 'noacl' mount flag -Patch230: util-linux-2.13-nfs-noacl.patch -# 183713 - foreground nfs mount timeout options to get hard mount semantic -Patch231: util-linux-2.13-nfsmount-retry.patch -# Adds syslog logging to background mounts -Patch232: util-linux-2.13-nfsmount-syslog.patch # 187014 - umount segfaults for normal user Patch233: util-linux-2.13-mount-uuid.patch # 183446 - cal not UTF-8-aware @@ -217,12 +201,8 @@ Patch241: util-linux-2.13-fdisk-isfull.patch Patch242: util-linux-2.12a-raw-man-dd.patch # Don't use asm/page.h Patch243: util-linux-2.13-swap-page.patch -# Don't use linux/posix_types.h or asm/posix_types.h -Patch244: util-linux-2.13-nfs4-posix_types.patch # IPv6 support to login command Patch245: util-linux-2.13-login-ipv6.patch -# fscache bits for NFS mounts -Patch246: util-linux-2.13-nfsmount-fsc.patch # 176494 - last -i returns strange IP addresses Patch247: util-linux-2.13-login-timeval.patch # 199745 - Non-existant simpleinit(8) mentioned in ctrlaltdel(8) @@ -231,6 +211,8 @@ Patch248: util-linux-2.13-ctrlaltdel-man.patch Patch249: util-linux-2.13-mount-sloppy.patch # 188193 - util-linux should provide plugin infrastructure for HAL Patch250: util-linux-2.13-mount-uhelper.patch +# Removes obsolete NFS code (we use /sbin/[u]mount.nfs[4] from nfs-utils) +Patch251: util-linux-2.13-mount-nonfs.patch # When adding patches, please make sure that it is easy to find out what bug # the # patch fixes. @@ -272,16 +254,12 @@ cp %{SOURCE8} %{SOURCE9} . %patch160 -p1 %endif %patch164 -p1 + %patch170 -p1 -%patch171 -p1 -%patch172 -p1 -%patch173 -p1 -%patch174 -p1 %patch180 -p1 %patch181 -p1 %patch182 -p1 %patch183 -p1 -%patch184 -p1 %patch185 -p1 %patch186 -p1 %patch187 -p1 @@ -310,10 +288,6 @@ cp %{SOURCE8} %{SOURCE9} . %patch225 -p1 %patch226 -p1 %patch227 -p1 -%patch229 -p1 -%patch230 -p1 -%patch231 -p1 -%patch232 -p1 %patch233 -p1 %patch234 -p1 %patch235 -p1 @@ -325,13 +299,12 @@ cp %{SOURCE8} %{SOURCE9} . %patch241 -p1 %patch242 -p1 %patch243 -p1 -%patch244 -p1 %patch245 -p1 -%patch246 -p1 %patch247 -p1 %patch248 -p1 %patch249 -p1 -%patch250 -p1 -b .uhelper +%patch250 -p1 +%patch251 -p1 %build unset LINGUAS || : @@ -727,7 +700,6 @@ exit 0 /sbin/swapon /sbin/swapoff %{_mandir}/man5/fstab.5* -%{_mandir}/man5/nfs.5* %{_mandir}/man8/mount.8* %{_mandir}/man8/swapoff.8* %{_mandir}/man8/swapon.8* @@ -736,6 +708,11 @@ exit 0 /sbin/losetup %changelog +* Wed Sep 20 2006 Karel Zak 2.13-0.42 +- remove obsolete NFS code and patches (we use /sbin/mount.nfs + and /sbin/umount.nfs from nfs-utils now) +- move nfs.5 to nfs-utils + * Fri Sep 15 2006 Karel Zak 2.13-0.41 - fix #205038 - mount not allowing sloppy option (exports "-s" to external /sbin/mount.nfs(4) calls)