2 Add basic nfsv4 support
6 util-linux-2.12-bfields/mount/Makefile | 2
7 util-linux-2.12-bfields/mount/fstab.5 | 1
8 util-linux-2.12-bfields/mount/mount.8 | 75 ++++++
9 util-linux-2.12-bfields/mount/mount.c | 13 +
10 util-linux-2.12-bfields/mount/nfs.5 | 200 +++++++++++++++++
11 util-linux-2.12-bfields/mount/nfs4_mount.h | 82 +++++++
12 util-linux-2.12-bfields/mount/nfs4mount.c | 335 +++++++++++++++++++++++++++++
13 util-linux-2.12-bfields/mount/nfsmount.c | 5
14 util-linux-2.12-bfields/mount/sundries.h | 2
15 util-linux-2.12-bfields/mount/umount.c | 3
16 10 files changed, 710 insertions(+), 8 deletions(-)
18 diff -puN mount/fstab.5~base-nfsv4 mount/fstab.5
19 --- util-linux-2.12/mount/fstab.5~base-nfsv4 2004-10-13 13:51:50.000000000 -0400
20 +++ util-linux-2.12-bfields/mount/fstab.5 2004-10-13 13:51:50.000000000 -0400
21 @@ -115,6 +115,7 @@ of filesystem types, such as
29 diff -puN mount/Makefile~base-nfsv4 mount/Makefile
30 --- util-linux-2.12/mount/Makefile~base-nfsv4 2004-10-13 13:51:50.000000000 -0400
31 +++ util-linux-2.12-bfields/mount/Makefile 2004-10-13 13:51:50.000000000 -0400
34 LO_OBJS = lomount.o $(LIB)/xstrncpy.o
35 CRYPT_OBJS = cryptsetup.o -lcryptsetup
36 -NFS_OBJS = nfsmount.o nfsmount_xdr.o
37 +NFS_OBJS = nfsmount.o nfsmount_xdr.o nfs4mount.o
38 GEN_FILES = nfsmount.h nfsmount_xdr.c nfsmount_clnt.c
41 diff -puN mount/mount.8~base-nfsv4 mount/mount.8
42 --- util-linux-2.12/mount/mount.8~base-nfsv4 2004-10-13 13:51:50.000000000 -0400
43 +++ util-linux-2.12-bfields/mount/mount.8 2004-10-13 13:51:50.000000000 -0400
44 @@ -370,6 +370,7 @@ currently supported are:
52 @@ -403,7 +404,7 @@ For most types all the
53 program has to do is issue a simple
55 system call, and no detailed knowledge of the filesystem type is required.
56 -For a few types however (like nfs, smbfs, ncpfs) ad hoc code is
57 +For a few types however (like nfs, nfs4, smbfs, ncpfs) ad hoc code is
58 necessary. The nfs ad hoc code is built in, but smbfs and ncpfs
59 have a separate mount program. In order to make it possible to
60 treat all types in a uniform way, mount will execute the program
61 @@ -451,9 +452,10 @@ or, if that does not exist,
62 All of the filesystem types listed there will be tried,
63 except for those that are labeled "nodev" (e.g.,
73 ends in a line with a single * only, mount will read
74 @@ -1243,6 +1245,73 @@ Usually it just causes lots of trouble.
76 Do not use locking. Do not start lockd.
78 +.SH "Mount options for nfs4"
79 +Instead of a textual option string, parsed by the kernel, the
81 +file system expects a binary argument of type
82 +.IR "struct nfs4_mount_data" .
85 +itself parses the following options of the form `tag=value',
86 +and puts them in the structure mentioned:
103 +is accepted but ignored.
104 +Also the following Boolean options, possibly preceded by
117 +Especially useful options include
119 +.B rsize=32768,wsize=32768
120 +This will make your NFS connection faster than with the default
121 +buffer size of 4096.
124 +The program accessing a file on a NFS mounted file system will hang
125 +when the server crashes. The process cannot be interrupted or
126 +killed unless you also specify
128 +When the NFS server is back online the program will continue undisturbed
129 +from where it was. This is probably what you want.
132 +This option allows the kernel to time out if the NFS server is not
133 +responding for some time. The time can be
136 +This timeout value is expressed in tenths of a second.
139 +option might be useful if your NFS server sometimes doesn't respond
140 +or will be rebooted while some process tries to get a file from the server.
141 +Avoid using this option with
143 +or with a short timeout.
145 .SH "Mount options for ntfs"
148 diff -puN mount/mount.c~base-nfsv4 mount/mount.c
149 --- util-linux-2.12/mount/mount.c~base-nfsv4 2004-10-13 13:51:50.000000000 -0400
150 +++ util-linux-2.12-bfields/mount/mount.c 2004-10-13 13:51:50.000000000 -0400
151 @@ -821,6 +821,19 @@ retry_nfs:
152 "without support for the type `nfs'"));
159 + if (!fake && types && streq (types, "nfs4")) {
160 + mnt_err = nfs4mount(spec, node, &flags, &extra_opts, &mount_opts, bg);
164 + die (EX_SOFTWARE, _("mount: this version was compiled "
165 + "without support for the type `nfs4'"));
169 block_signals (SIG_BLOCK);
171 diff -puN /dev/null mount/nfs4mount.c
172 --- /dev/null 2004-08-19 17:44:20.000000000 -0400
173 +++ util-linux-2.12-bfields/mount/nfs4mount.c 2004-10-13 13:52:38.000000000 -0400
176 + * nfs4mount.c -- Linux NFS mount
177 + * Copyright (C) 2002 Trond Myklebust <trond.myklebust@fys.uio.no>
179 + * This program is free software; you can redistribute it and/or modify
180 + * it under the terms of the GNU General Public License as published by
181 + * the Free Software Foundation; either version 2, or (at your option)
182 + * any later version.
184 + * This program is distributed in the hope that it will be useful,
185 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
186 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
187 + * GNU General Public License for more details.
189 + * Note: this file based on the original nfsmount.c
192 +#include "../defines.h" /* for HAVE_rpcsvc_nfs_prot_h and HAVE_inet_aton */
194 +#include <linux/posix_types.h>
195 +#include <asm/posix_types.h>
207 +#include <sys/socket.h>
208 +#include <sys/time.h>
209 +#include <sys/utsname.h>
210 +#include <sys/stat.h>
211 +#include <netinet/in.h>
212 +#include <arpa/inet.h>
214 +#include "sundries.h"
216 +#include "mount_constants.h"
217 +#include "nfs4_mount.h"
222 +#define NFS_PORT 2049
225 +static int parse_devname(char *hostdir, char **hostname, char **dirname)
229 + if (!(s = strchr(hostdir, ':'))) {
232 + "directory to mount not in host:dir format\n"));
235 + *hostname = hostdir;
238 + /* Ignore all but first hostname in replicated mounts
239 + until they can be fully supported. (mack@sgi.com) */
240 + if ((s = strchr(hostdir, ','))) {
243 + _("mount: warning: "
244 + "multiple hostnames not supported\n"));
249 +static int fill_ipv4_sockaddr(const char *hostname, struct sockaddr_in *addr)
251 + struct hostent *hp;
252 + addr->sin_family = AF_INET;
254 + if (inet_aton(hostname, &addr->sin_addr))
256 + if ((hp = gethostbyname(hostname)) == NULL) {
257 + fprintf(stderr, _("mount: can't get address for %s\n"),
261 + if (hp->h_length > sizeof(struct in_addr)) {
263 + _("mount: got bad hp->h_length\n"));
264 + hp->h_length = sizeof(struct in_addr);
266 + memcpy(&addr->sin_addr, hp->h_addr, hp->h_length);
270 +static int get_my_ipv4addr(char *ip_addr, int len)
273 + struct sockaddr_in myaddr;
275 + if (gethostname(myname, sizeof(myname))) {
276 + fprintf(stderr, _("mount: can't determine client address\n"));
279 + if (fill_ipv4_sockaddr(myname, &myaddr))
281 + snprintf(ip_addr, len, "%s", inet_ntoa(myaddr.sin_addr));
282 + ip_addr[len-1] = '\0';
286 +int nfs4mount(const char *spec, const char *node, int *flags,
287 + char **extra_opts, char **mount_opts,
290 + static struct nfs4_mount_data data;
291 + static char hostdir[1024];
292 + static char ip_addr[16] = "127.0.0.1";
293 + static struct sockaddr_in server_addr;
294 + static int pseudoflavour = 0;
296 + char *hostname, *dirname, *old_opts;
297 + char new_opts[1024];
301 + int bg, soft, intr;
307 + if (strlen(spec) >= sizeof(hostdir)) {
308 + fprintf(stderr, _("mount: "
309 + "excessively long host:dir argument\n"));
312 + strcpy(hostdir, spec);
313 + if (parse_devname(hostdir, &hostname, &dirname))
316 + if (fill_ipv4_sockaddr(hostname, &server_addr))
318 + if (get_my_ipv4addr(ip_addr, sizeof(ip_addr)))
321 + /* add IP address to mtab options for use when unmounting */
322 + s = inet_ntoa(server_addr.sin_addr);
323 + old_opts = *extra_opts;
326 + if (strlen(old_opts) + strlen(s) + 10 >= sizeof(new_opts)) {
327 + fprintf(stderr, _("mount: "
328 + "excessively long option argument\n"));
331 + snprintf(new_opts, sizeof(new_opts), "%s%saddr=%s",
332 + old_opts, *old_opts ? "," : "", s);
333 + *extra_opts = xstrdup(new_opts);
335 + /* Set default options.
336 + * rsize/wsize and timeo are left 0 in order to
337 + * let the kernel decide.
339 + memset(&data, 0, sizeof(data));
342 + data.acregmax = 60;
343 + data.acdirmin = 30;
344 + data.acdirmax = 60;
345 + data.proto = IPPROTO_TCP;
352 + retry = 10000; /* 10000 minutes ~ 1 week */
355 + * NFSv4 specifies that the default port should be 2049
357 + server_addr.sin_port = htons(NFS_PORT);
359 + /* parse options */
361 + for (opt = strtok(old_opts, ","); opt; opt = strtok(NULL, ",")) {
362 + if ((opteq = strchr(opt, '='))) {
363 + val = atoi(opteq + 1);
365 + if (!strcmp(opt, "rsize"))
367 + else if (!strcmp(opt, "wsize"))
369 + else if (!strcmp(opt, "timeo"))
371 + else if (!strcmp(opt, "retrans"))
372 + data.retrans = val;
373 + else if (!strcmp(opt, "acregmin"))
374 + data.acregmin = val;
375 + else if (!strcmp(opt, "acregmax"))
376 + data.acregmax = val;
377 + else if (!strcmp(opt, "acdirmin"))
378 + data.acdirmin = val;
379 + else if (!strcmp(opt, "acdirmax"))
380 + data.acdirmax = val;
381 + else if (!strcmp(opt, "actimeo")) {
382 + data.acregmin = val;
383 + data.acregmax = val;
384 + data.acdirmin = val;
385 + data.acdirmax = val;
387 + else if (!strcmp(opt, "retry"))
389 + else if (!strcmp(opt, "port"))
390 + server_addr.sin_port = htons(val);
391 + else if (!strcmp(opt, "proto")) {
392 + if (!strncmp(opteq+1, "tcp", 3))
393 + data.proto = IPPROTO_TCP;
394 + else if (!strncmp(opteq+1, "udp", 3))
395 + data.proto = IPPROTO_UDP;
397 + printf(_("Warning: Unrecognized proto= option.\n"));
398 + } else if (!strcmp(opt, "clientaddr")) {
399 + if (strlen(opteq+1) >= sizeof(ip_addr))
400 + printf(_("Invalid client address %s"),
402 + strncpy(ip_addr,opteq+1, sizeof(ip_addr));
403 + ip_addr[sizeof(ip_addr)-1] = '\0';
404 + } else if (!strcmp(opt, "sec")) {
405 + if (!strcmp(opteq+1, "krb5"))
406 + pseudoflavour = 390003;
407 + else if (!strcmp(opteq+1, "krb5i"))
408 + pseudoflavour = 390004;
409 + else if (!strcmp(opteq+1, "krb5p"))
410 + pseudoflavour = 390005;
411 + else if (!strcmp(opteq+1, "lipkey"))
412 + pseudoflavour = 390006;
413 + else if (!strcmp(opteq+1, "lipkey-i"))
414 + pseudoflavour = 390007;
415 + else if (!strcmp(opteq+1, "lipkey-p"))
416 + pseudoflavour = 390008;
417 + else if (!strcmp(opteq+1, "spkm3"))
418 + pseudoflavour = 390009;
419 + else if (!strcmp(opteq+1, "spkm3i"))
420 + pseudoflavour = 390010;
421 + else if (!strcmp(opteq+1, "spkm3p"))
422 + pseudoflavour = 390011;
424 + printf(_("unknown security type %s\n"),
428 + } else if (!strcmp(opt, "addr")) {
431 + printf(_("unknown nfs mount parameter: "
432 + "%s=%d\n"), opt, val);
437 + if (!strncmp(opt, "no", 2)) {
441 + if (!strcmp(opt, "bg"))
443 + else if (!strcmp(opt, "fg"))
445 + else if (!strcmp(opt, "soft"))
447 + else if (!strcmp(opt, "hard"))
449 + else if (!strcmp(opt, "intr"))
451 + else if (!strcmp(opt, "cto"))
453 + else if (!strcmp(opt, "ac"))
457 + printf(_("unknown nfs mount option: "
458 + "%s%s\n"), val ? "" : "no", opt);
465 + data.flags = (soft ? NFS4_MOUNT_SOFT : 0)
466 + | (intr ? NFS4_MOUNT_INTR : 0)
467 + | (nocto ? NFS4_MOUNT_NOCTO : 0)
468 + | (noac ? NFS4_MOUNT_NOAC : 0);
470 + if (pseudoflavour != 0) {
471 + data.auth_flavourlen = 1;
472 + data.auth_flavours = &pseudoflavour;
475 + data.client_addr.data = ip_addr;
476 + data.client_addr.len = strlen(ip_addr);
478 + data.mnt_path.data = dirname;
479 + data.mnt_path.len = strlen(dirname);
481 + data.hostname.data = hostname;
482 + data.hostname.len = strlen(hostname);
483 + data.host_addr = (struct sockaddr *)&server_addr;
484 + data.host_addrlen = sizeof(server_addr);
486 +#ifdef NFS_MOUNT_DEBUG
487 + printf("rsize = %d, wsize = %d, timeo = %d, retrans = %d\n",
488 + data.rsize, data.wsize, data.timeo, data.retrans);
489 + printf("acreg (min, max) = (%d, %d), acdir (min, max) = (%d, %d)\n",
490 + data.acregmin, data.acregmax, data.acdirmin, data.acdirmax);
491 + printf("port = %d, bg = %d, retry = %d, flags = %.8x\n",
492 + ntohs(server_addr.sin_port), bg, retry, data.flags);
493 + printf("soft = %d, intr = %d, nocto = %d, noac = %d\n",
494 + (data.flags & NFS4_MOUNT_SOFT) != 0,
495 + (data.flags & NFS4_MOUNT_INTR) != 0,
496 + (data.flags & NFS4_MOUNT_NOCTO) != 0,
497 + (data.flags & NFS4_MOUNT_NOAC) != 0);
498 + printf("proto = %s\n", (data.proto == IPPROTO_TCP) ? "tcp" : "udp");
501 + data.version = NFS4_MOUNT_VERSION;
503 + *mount_opts = (char *) &data;
510 diff -puN /dev/null mount/nfs4_mount.h
511 --- /dev/null 2004-08-19 17:44:20.000000000 -0400
512 +++ util-linux-2.12-bfields/mount/nfs4_mount.h 2004-10-13 13:51:50.000000000 -0400
514 +#ifndef _LINUX_NFS4_MOUNT_H
515 +#define _LINUX_NFS4_MOUNT_H
518 + * linux/include/linux/nfs4_mount.h
520 + * Copyright (C) 2002 Trond Myklebust
522 + * structure passed from user-space to kernel-space during an nfsv4 mount
526 + * WARNING! Do not delete or change the order of these fields. If
527 + * a new field is required then add it to the end. The version field
528 + * tracks which fields are present. This will ensure some measure of
529 + * mount-to-kernel version compatibility. Some of these aren't used yet
530 + * but here they are anyway.
532 +#define NFS4_MOUNT_VERSION 1
539 +struct nfs4_mount_data {
540 + int version; /* 1 */
545 + int retrans; /* 1 */
546 + int acregmin; /* 1 */
547 + int acregmax; /* 1 */
548 + int acdirmin; /* 1 */
549 + int acdirmax; /* 1 */
551 + /* see the definition of 'struct clientaddr4' in RFC3010 */
552 + struct nfs_string client_addr; /* 1 */
555 + struct nfs_string mnt_path; /* 1 */
557 + /* Server details */
558 + struct nfs_string hostname; /* 1 */
559 + /* Server IP address */
560 + unsigned int host_addrlen; /* 1 */
561 + struct sockaddr* host_addr; /* 1 */
563 + /* Transport protocol to use */
566 + /* Pseudo-flavours to use for authentication. See RFC2623 */
567 + int auth_flavourlen; /* 1 */
568 + int *auth_flavours; /* 1 */
571 +/* bits in the flags field */
572 +/* Note: the fields that correspond to existing NFSv2/v3 mount options
573 + * should mirror the values from include/linux/nfs_mount.h
576 +#define NFS4_MOUNT_SOFT 0x0001 /* 1 */
577 +#define NFS4_MOUNT_INTR 0x0002 /* 1 */
578 +#define NFS4_MOUNT_NOCTO 0x0010 /* 1 */
579 +#define NFS4_MOUNT_NOAC 0x0020 /* 1 */
580 +#define NFS4_MOUNT_STRICTLOCK 0x1000 /* 1 */
581 +#define NFS4_MOUNT_FLAGMASK 0xFFFF
583 +/* pseudoflavors: */
585 +#define RPC_AUTH_GSS_KRB5 390003
586 +#define RPC_AUTH_GSS_KRB5I 390004
587 +#define RPC_AUTH_GSS_KRB5P 390005
588 +#define RPC_AUTH_GSS_LKEY 390006
589 +#define RPC_AUTH_GSS_LKEYI 390007
590 +#define RPC_AUTH_GSS_LKEYP 390008
591 +#define RPC_AUTH_GSS_SPKM 390009
592 +#define RPC_AUTH_GSS_SPKMI 390010
593 +#define RPC_AUTH_GSS_SPKMP 390011
596 diff -puN mount/nfs.5~base-nfsv4 mount/nfs.5
597 --- util-linux-2.12/mount/nfs.5~base-nfsv4 2004-10-13 13:51:50.000000000 -0400
598 +++ util-linux-2.12-bfields/mount/nfs.5 2004-10-13 13:51:50.000000000 -0400
601 .TH NFS 5 "20 November 1993" "Linux 0.99" "Linux Programmer's Manual"
603 -nfs \- nfs fstab format and options
604 +nfs \- nfs and nfs4 fstab format and options
608 @@ -17,14 +17,51 @@ the local directory that is the mount po
609 and the NFS specific options that control
610 the way the filesystem is mounted.
612 -Here is an example from an \fI/etc/fstab\fP file from an NFS mount.
613 +Three different versions of the NFS protocol are
614 +supported by the Linux NFS client:
615 +NFS version 2, NFS version 3, and NFS version 4.
616 +To mount via NFS version 2, use the
618 +file system type and specify
620 +Version 2 is the default protocol version for the
622 +file system type when
624 +is not specified on the mount command.
625 +To mount via NFS version 3, use the
627 +file system type and specify
629 +To mount via NFS version 4, use the
634 +keyword is not supported for the
638 +These file system types share similar mount options;
639 +the differences are listed below.
641 +Here is an example from an \fI/etc/fstab\fP file for an NFSv2 mount
645 .ta 2.5i +0.75i +0.75i +1.0i
646 server:/usr/local/pub /pub nfs rsize=8192,wsize=8192,timeo=14,intr
649 +Here is an example for an NFSv4 mount over TCP using Kerberos
650 +5 mutual authentication.
653 +.ta 2.5i +0.75i +0.75i +1.0i
654 +server:/usr/local/pub /pub nfs4 proto=tcp,sec=krb5,hard,intr
658 +.SS Options for the nfs file system type
661 The number of bytes NFS uses when reading files from an NFS server.
662 @@ -208,6 +245,163 @@ is the default.
663 All of the non-value options have corresponding nooption forms.
664 For example, nointr means don't allow file operations to be
666 +.SS Options for the nfs4 file system type
669 +The number of bytes NFS uses when reading files from an NFS server.
670 +The default value is dependent on the kernel, currently 4096 bytes.
671 +(However, throughput is improved greatly by asking for
673 +This value is negotiated with the server.
676 +The number of bytes NFS uses when writing files to an NFS server.
677 +The default value is dependent on the kernel, currently 4096 bytes.
678 +(However, throughput is improved greatly by asking for
680 +This value is negotiated with the server.
683 +The value in tenths of a second before sending the
684 +first retransmission after an RPC timeout.
685 +The default value depends on whether
689 +is in effect (see below).
690 +The default value for UDP is 7 tenths of a second.
691 +The default value for TCP is 60 seconds.
692 +After the first timeout,
693 +the timeout is doubled after each successive timeout until a maximum
694 +timeout of 60 seconds is reached or the enough retransmissions
695 +have occured to cause a major timeout. Then, if the filesystem
696 +is hard mounted, each new timeout cascade restarts at twice the
697 +initial value of the previous cascade, again doubling at each
698 +retransmission. The maximum timeout is always 60 seconds.
701 +The number of minor timeouts and retransmissions that must occur before
702 +a major timeout occurs. The default is 5 timeouts for
706 +When a major timeout
707 +occurs, the file operation is either aborted or a "server not responding"
708 +message is printed on the console.
711 +The minimum time in seconds that attributes of a regular file should
712 +be cached before requesting fresh information from a server.
713 +The default is 3 seconds.
716 +The maximum time in seconds that attributes of a regular file can
717 +be cached before requesting fresh information from a server.
718 +The default is 60 seconds.
721 +The minimum time in seconds that attributes of a directory should
722 +be cached before requesting fresh information from a server.
723 +The default is 30 seconds.
726 +The maximum time in seconds that attributes of a directory can
727 +be cached before requesting fresh information from a server.
728 +The default is 60 seconds.
731 +Using actimeo sets all of
738 +There is no default value.
741 +The number of minutes to retry an NFS mount operation
742 +in the foreground or background before giving up.
743 +The default value is 10000 minutes, which is roughly one week.
746 +The numeric value of the port to connect to the NFS server on.
747 +If the port number is 0 (the default) then query the
748 +remote host's portmapper for the port number to use.
749 +If the remote host's NFS daemon is not registered with
750 +its portmapper, the standard NFS port number 2049 is
754 +Mount the NFS filesystem using a specific network protocol
755 +instead of the default UDP protocol.
756 +Many NFS version 4 servers only support TCP.
757 +Valid protocol types are
763 +On a multi-homed client, this
764 +causes the client to use a specific callback address when
765 +communicating with an NFS version 4 server.
766 +This option is currently ignored.
769 +Specify an advanced security mechanism for this file system.
770 +To use Kerberos 5 mutual authentication, specify
772 +Kerberos 5 integrity checking is specified with
774 +and Kerberos 5 privacy is specified with
776 +Other security mechanisms may become available in the future.
779 +If an NFS mount attempt times out, retry the mount
781 +After a mount operation is backgrounded, all subsequent mounts
782 +on the same NFS server will be backgrounded immediately, without
783 +first attempting the mount.
784 +A missing mount point is treated as a timeout,
785 +to allow for nested NFS mounts.
788 +If the first NFS mount attempt times out, retry the mount
790 +This is the complement of the
792 +option, and also the default behavior.
795 +If an NFS file operation has a major timeout then report an I/O error to
796 +the calling program.
797 +The default is to continue retrying NFS file operations indefinitely.
800 +If an NFS file operation has a major timeout then report
801 +"server not responding" on the console and continue retrying indefinitely.
802 +This is the default.
805 +If an NFS file operation has a major timeout and it is hard mounted,
806 +then allow signals to interupt the file operation and cause it to
807 +return EINTR to the calling program. The default is to not
808 +allow file operations to be interrupted.
811 +Suppress the retrieval of new attributes when creating a file.
814 +Disable attribute caching, and force synchronous writes.
816 +server performance penalty but it allows two different NFS clients
817 +to get reasonable good results when both clients are actively
818 +writing to common filesystem on the server.
820 +All of the non-value options have corresponding nooption forms.
821 +For example, nointr means don't allow file operations to be
826 diff -puN mount/nfsmount.c~base-nfsv4 mount/nfsmount.c
827 --- util-linux-2.12/mount/nfsmount.c~base-nfsv4 2004-10-13 13:51:50.000000000 -0400
828 +++ util-linux-2.12-bfields/mount/nfsmount.c 2004-10-13 13:51:50.000000000 -0400
829 @@ -706,7 +706,10 @@ static inline int
830 nfsmnt_check_compat(const struct pmap *nfs_pmap, const struct pmap *mnt_pmap)
832 if (nfs_pmap->pm_vers > MAX_NFSPROT) {
833 - fprintf(stderr, _("NFSv%ld not supported!\n"), nfs_pmap->pm_vers);
834 + if (nfs_pmap->pm_vers == 4)
835 + fprintf(stderr, _("'vers=4' is not supported. Use '-t nfs4' instead.\n"));
837 + fprintf(stderr, _("NFSv%ld not supported!\n"), nfs_pmap->pm_vers);
840 if (mnt_pmap->pm_vers > MAX_MNTPROT) {
841 diff -puN mount/sundries.h~base-nfsv4 mount/sundries.h
842 --- util-linux-2.12/mount/sundries.h~base-nfsv4 2004-10-13 13:51:50.000000000 -0400
843 +++ util-linux-2.12-bfields/mount/sundries.h 2004-10-13 13:51:50.000000000 -0400
844 @@ -37,6 +37,8 @@ void die (int errcode, const char *fmt,
846 int nfsmount (const char *spec, const char *node, int *flags,
847 char **orig_opts, char **opt_args, int *version, int running_bg);
848 +int nfs4mount (const char *spec, const char *node, int *flags,
849 + char **orig_opts, char **opt_args, int running_bg);
850 int nfsumount(const char *spec, const char *opts);
853 diff -puN mount/umount.c~base-nfsv4 mount/umount.c
854 --- util-linux-2.12/mount/umount.c~base-nfsv4 2004-10-13 13:51:50.000000000 -0400
855 +++ util-linux-2.12-bfields/mount/umount.c 2004-10-13 13:51:50.000000000 -0400
857 /* True if ruid != euid. */
860 +/* Needed by nfs4mount.c */
864 * check_special_umountprog()
865 * If there is a special umount program for this type, exec it.