| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
| |
Remove a unnecessary newline in an error message.
Signed-off-by: Steve Dickson <steved@redhat.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
With recent changes to the /etc/hosts file, the 'localhost'
host name is now multiply defined as both an IPv4 address (127.0.01)
and an IPv6 address (::1). This causes first address returned
by getaddrinfo('localhost') to be the IPv6 address instead of
the IPv4 address.
The change in the default 'localhost' address type causes
existing exports using '127.0.0.1' to fail, because the
'::1' address is tried first and fails. The problem is
not all the addresses in the address list are being tried.
So this patch allows that address list to continue to be
process when a 'EACCES' error is returned by the server.
Signed-off-by: Steve Dickson <steved@redhat.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
When the NFS version isn't specified in the mount options, mount.nfs
attempts V4 first and appends 'vers=4' to the extra_options string in
the mount options. If the server isn't immediately reachable, this
attempt fails. However, if the background option is specified and the
server comes up later on, the extra_options are used again for all
further attempts and thus they fail if the server only supports
vers<4.
Fix this by only amending extra_options on a successful vers=4 mount.
This is now Debian bug #690181 and has apparently been around for
ages.
Reviewed-by: Chuck Lever <chuck.lever@oracle.com>
Signed-off-by: Wolfram Gloger <bugzilla1@malloc.de>
Signed-off-by: Steve Dickson <steved@redhat.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The mount option "proto=" actually set the "transport" which in
netconfig usage is the pairing of a protocol (e.g. UDP, TCP) with
a protocol family (e.g. INET, INET6).
This can cause confusion if people naively except "proto=udp" to work
equally well on IPv6.
So add some text to both nfs(5) and nfsmount.conf(5) to hopefully
clarify this.
Acked-by: Chuck Lever <chuck.lever@oracle.com>
Signed-off-by: NeilBrown <neilb@suse.de>
Signed-off-by: Steve Dickson <steved@redhat.com>
|
|
|
|
| |
Signed-off-by: Steve Dickson <steved@redhat.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
is_vers4 in mount_libmount.c is based on nfs_umount_is_vers4
in nfsumount.c, except the return values are reversed.
The result of this is:
- a MOUNT_UMNT call is not sent when an NFSv3 or NFSv2
filesystem is unmounted
- a MOUNT_UMNT call *is* sent when and 'nfs4' filesystem
is unmounted (but not when an 'nfs -o vers=4 filesystem
is unmounted, as that is checked elsewhere).
Signed-off-by: NeilBrown <neilb@suse.de>
Signed-off-by: Steve Dickson <steved@redhat.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
# umount.nfs /boot; echo $?
umount.nfs: /boot: device is busy
32
expected and fixed behavior:
# umount.nfs /boot; echo $?
# umount.nfs: /boot: is not an NFS filesystem
1
Note that the function mnt_context_set_fstype_pattern() has never
been used for mtab/fstab evaluation. It's usable only for "umount -a"
and for "mount -t" operations.
Reported-by: NeilBrown <neilb@suse.de>
Signed-off-by: Karel Zak <kzak@redhat.com>
Signed-off-by: Steve Dickson <steved@redhat.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
If nfs-utils is built without --enable-libmount-mount, then
an unmount that failed due to the filesystem being busy will
exit with '16' - EX_FILEIO.
Autofs apparently relies on this.
When built with --enable-libmount-mount, the same case will
exit with '32' - EX_FAIL. Normally this is reserved for
internal errors.
This patch restores the use of EX_FILEIO for errors from umount.
Reviewed-by: Karel Zak <kzak@redhat.com>
Signed-off-by: NeilBrown <neilb@suse.de>
Signed-off-by: Steve Dickson <steved@redhat.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
If a NFS mount attempt fails with an ETIMEDOUT error, the mount.nfs code
doesn't currently attempt the next address in the list. For a NFSv4
mount the initial mount() call almost always ends up going over
NFS_DEF_FG_TIMEOUT_MINUTES and the mount is never retried.
For a v3 mount, it ends up continually retrying against the same IPv6
address, and never tries the IPv4 address. Eventually it gives up once
it hits the NFS_DEF_FG_TIMEOUT_MINUTES timeout.
It's possible that a server is just unreachable via IPv6 (due to a
routing misconfiguration for instance), or is dropping IPv6 frames on
the floor. In that situation, it might still be reachable via IPv4 and
trying the next address could have allowed the mount to succeed.
Fix this by treating ETIMEDOUT in a similar fashion to ECONNREFUSED.
Have the client try the next address in the list before giving up and
returning an error.
Our QA folks noticed this after a routing problem in one of our test
labs. I was able to reproduce it by having the server drop incoming
IPv6 frames from the client's address.
With this patch, the mount eventually succeeds over IPv4 instead of
returning an error.
Cc: Chuck Lever <chuck.lever@oracle.com>
Signed-off-by: Jeff Layton <jlayton@redhat.com>
Signed-off-by: Steve Dickson <steved@redhat.com>
|
|
|
|
| |
Signed-off-by: Steve Dickson <steved@redhat.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
high-speed links
* Using NFS over UDP on high-speed links such as Gigabit can cause
silent data corruption.
* The man page text was written by Olaf Kirch and committed to (but not
upstream):
https://build.opensuse.org/package/view_file?file=warn-nfs-udp.patch&package=nfs-utils&project=openSUSE%3AFactory&rev=8e3e60c70e8270cd4afa036e13f6b2bb
Signed-off-by: Harshula Jayasuriya <harshula@redhat.com>
Acked-by: Chuck Lever <chuck.lever@oracle.com>
Signed-off-by: Olaf Kirch <okir@suse.com>
Signed-off-by: Steve Dickson <steved@redhat.com>
|
|
|
|
|
|
|
|
|
| |
The point of background mounts is to have the mount
retried if the mount fails. This patch allows the v2/v3
background mount to proceed in the case when the server
is down by not making EOPNOTSUPP a permanent error.
Signed-off-by: Steve Dickson <steved@redhat.com>
|
|
|
|
|
| |
Signed-off-by: Simo Sorce <simo@redhat.com>
Signed-off-by: Steve Dickson <steved@redhat.com>
|
|
|
|
|
| |
Signed-off-by: Simo Sorce <simo@redhat.com>
Signed-off-by: Steve Dickson <steved@redhat.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This patch is essentially the same as the previous version, but has
been respun to fix up some merge conflicts with some of Chuck's
recent changes.
When we first added tirpc support, we took a "big hammer" approach, and
had it add libtirpc to $LIBS. That had the effect of making it so that
that library was linked into every binary. That's unnecessary, and
wasteful with memory.
Don't let AC_CHECK_LIB add -ltirpc to $LIBS. Instead, have the autoconf
tests set $(LIBTIRPC) in the makefiles, and have the programs that
need it explicitly include that library. In the event that we're not
using libtirpc, then set $LIBTIRPC to a blank string.
This necessitates a change to the bindresvport_sa check too. Since that
library is no longer included in $LIBS, we need to convert that check
to use AC_CHECK_LIB instead of AC_CHECK_FUNCS.
This patch also fixes a subtle bug. If the library was usable, but the
includes were not, the test would set $enable_tirpc to "no", but
HAVE_LIBTIRPC would still be true. That configuration would likely
fail to build.
Signed-off-by: Jeff Layton <jlayton@redhat.com>
Signed-off-by: Steve Dickson <steved@redhat.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The libmount (as well as mount(8)) ignores mount options from command
line if running in restricted mode (suid, non-root-user) and all
options are read from fstab only.
It means that all options are replaced with stuff from fstab,
including mount options from nfsmount.conf. This is bug.
We have to apply fstab and then nfsmount.conf.
Signed-off-by: Karel Zak <kzak@redhat.com>
Signed-off-by: Steve Dickson <steved@redhat.com>
|
|
|
|
|
|
|
|
|
| |
Mounting with the "-o v3,bg,proto=udp" options will
fail, instead of retrying, when the server is down.
The reason being nfs_rewrite_pmap_mount_options()
does not interrupt RPC timeouts correctly.
Signed-off-by: Steve Dickson <steved@redhat.com>
|
|
|
|
|
|
|
|
|
| |
We should only try next address family if we meet ECONNREFUSED or
EHOSTUNREACH for v4 or ECONNREFUSED or EOPNOTSUPP or EHOSTUNREACH for v3v2.
Before, only a break in swich can not make the program out of for loop.
Signed-off-by: Yang Bai <hamo.by@gmail.com>
Signed-off-by: Steve Dickson <steved@redhat.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The groff macros for filling (word-wrapping) and tabulation control are
lower-case, but are written in upper-case here and so have been ignored.
Change the .NF and .FI lines to lower-case.
Change the .TA lines to lower-case and fix the tab stops to work both
on a terminal and in Postscript output.
Signed-off-by: Luk Claes <luk@debian.org>
Signed-off-by: Steve Dickson <steved@redhat.com>
|
|
|
|
|
|
|
|
|
|
|
| |
nfsumount.c: In function nfs_umount_is_vers4:
nfsumount.c:164: warning: conversion to int from size_t may alter its value
nfsumount.c:173: warning: conversion to ?size_t? from int may change the sign of the result
Introduced by commit 3564ebbf.
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Signed-off-by: Steve Dickson <steved@redhat.com>
|
|
|
|
|
|
|
|
| |
If NFS port (2049) is supplied explicitly, don't ignore this setting
by requesting it to portmapper again.
Signed-off-by: Luk Claes <luk@debian.org>
Signed-off-by: Steve Dickson <steved@redhat.com>
|
|
|
|
|
|
|
|
|
| |
NFS/TCP does linear backoff then retransmiting - the manpage
was mistakenly asserting the "no backoff" theory.
Signed-off-by: Max Matveev <makc@redhat.com>
Signed-off-by: Jim Rees <rees@umich.edu>
Signed-off-by: Steve Dickson <steved@redhat.com>
|
|
|
|
|
|
|
|
|
|
|
|
| |
License texts contain multiple address for FSF, some wrong.
So update them and replace COPYING file with
http://www.gnu.org/licenses/gpl-2.0.txt
which has a few changes to preamble and commentary.
Also remove extra COPYING file from utils/statd/
Signed-off-by: NeilBrown <neilb@suse.de>
Signed-off-by: Steve Dickson <steved@redhat.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
From: Ian Kent <ikent@redhat.com>
nfs_umount_is_vers4() doesn't take acount of the escaping of characters
seen in /proc/mounts and /etc/mtab as the functions in fstab.c do. This
leads to an inability to umount a mount containing any of these escaped
characters (like spaces).
This patch changes nfs_umount_is_vers4() to use functions in fstab.c and
adds a function to fstab.c to read /proc/mounts specifically, as it was
used for the check in nfs_umount_is_vers4() previously.
Signed-off-by: Ian Kent <ikent@redhat.com>
Signed-off-by: Steve Dickson <steved@redhat.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The groff macros for filling (word-wrapping) and tabulation control are
lower-case, but are written in upper-case here and so have been ignored.
Change the .NF and .FI lines to lower-case.
Change the .TA lines to lower-case and fix the tab stops to work both
on a terminal and in Postscript output.
Delete the .SP line where .sp would be redundant.
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
Signed-off-by: Luk Claes <luk@debian.org>
Signed-off-by: Steve Dickson <steved@redhat.com>
|
|
|
|
|
|
|
|
| |
Fix "macro `local_lock=flock'.' not defined" by avoiding to put a quote
at the beginning of the line.
Signed-off-by: Luk Claes <luk@debian.org>
Signed-off-by: Steve Dickson <steved@redhat.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Consider a setup where mountd on the server is controlled via
tcp_wrappers (usual RHEL setup) and will not process calls from a
particular client because of something in /etc/hosts.deny.
When such client attempts to do v3 mount, the error message printed
by mount.nfs is misleading.
This patch changes that error message from:
mount.nfs: Argument list too long
to
mount.nfs: access denied by server while mounting server:/export
Signed-off-by: Steve Dickson <steved@redhat.com>
|
|
|
|
|
|
|
|
| |
The function mnt_fs_set_fs_options() has been removed from the final
version of the libmount API.
Signed-off-by: Karel Zak <kzak@redhat.com>
Signed-off-by: Steve Dickson <steved@redhat.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
mount.nfs segfaults if kernel version number does not contain
at least 3 components delimited with a dot.
Avoid this by matching up to three unsigned integers inialised
to zero, separated by dots.
A version that does not start with an integer is probably a future
version where the versioning evolved to another scheme.
Return UINT_MAX which is guaranteed to be higher than existing
versions. This would also make it possible to easily identify
versions that do not start with an integer.
Signed-off-by: Luk Claes <luk@debian.org>
Signed-off-by: Steve Dickson <steved@redhat.com>
|
|
|
|
|
|
|
| |
commit 30ebf047 failed to include these changes that breaks mount.nfs.
mount.nfs will continue to work fine with these changes
Signed-off-by: Steve Dickson <steved@redhat.com>
|
|
|
|
| |
Signed-off-by: Steve Dickson <steved@redhat.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Currently souce and destination parameters should be passed as first and
second paramter while using mount.nfs. This patch allows them to be passed
anywhere while mounting.
Current functionality is
mount.nfs source destn -o <options>
This patch will allow to do this
mount.nfs -o <options> source destn
or
mount.nfs -o <options> source -o <options> destn
Signed-off-by: Prem Karat <prem.karat@linux.vnet.ibm.com>
Signed-off-by: Steve Dickson <steved@redhat.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
As mount.nfs can run setuid it must be careful about how the user can
interact with in. In particular it needs to ensure it does not
respond badly to any signals that the user might be able to generate.
This is particularly an issue while updating /etc/mtab (when that is
not linked to /proc/mounts). If the user can generate a signal which
kills mount.nfs while /etc/mtab is locked, then it will leave the file
locked, and could possibly corrupt mtab (particularly if 'ulimit 1'
was previously issued).
Currently lock_mtab does set some handlers for signals, but not
enough. It arranges for every signal up to (but not including)
SIGCHLD to cause mount.nfs to unlock mdadm promptly exit ... even if
the default behaviour would be to ignore the signal. SIGALRM is
handled specially, and signals after SIGCHLD are left with their
default behaviour. This includes for example SIGXFSZ which can be
generated by the user running "ulimit 1".
So: change this so that some signals are left unchanged, SIGALRM is
handled as required, and all signals that the user can generate are
explicitly ignored.
The remainder still cause mount.nfs to print a message, unlock mtab, and
exit.
Signed-off-by: NeilBrown <neilb@suse.de>
Signed-off-by: Steve Dickson <steved@redhat.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This patch allows to link mount.nfs with libmount from util-linux >=
v2.19. The new libmount based code is enabled by CONFIG_LIBMOUNT and
is stored in mount_libmount.c. The old code is not affected by this
change.
The libmount does not have officially stable API yet, so the
--enable-libmount-mount is marked as experimental in the configure
help output.
The ./configure option is the same as we use in util-linux to enable
support for libmount in mount(8).
The addr= (and some other options necessary for remount/umount) are
stored to /etc/mtab or to /dev/.mount/utab. The utab file is *private*
libmount file. It's possible that some mount options (for example
user=) will be moved to kernel, so the utab will not be necessary.
About libmount:
* supports systems without and with regular /etc/mtab
* does not store VFS and FS mount options in userspace
* manages user= option and evaluate permissions
* parses VFS mount options and generate MS_* flags
* parses /etc/{fstab,mtab}, /proc/mounts or /proc/self/mountinfo
* long-term goal is to use the same code in all mount.<type> helpers
Note, use
LIBMOUNT_DEBUG=0xffff mount.nfs foo:/path /path
to debug the library.
On systems with util-linux v2.19 the findmnt(8) command uses libmount
to list all/selected mount points:
$ findmnt /path
$ findmnt --mtab /path
the --mtab appends userspace mount options (e.g. user=) to the output.
CC: Chuck Lever <chuck.lever@oracle.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
Signed-off-by: Steve Dickson <steved@redhat.com>
|
|
|
|
|
|
|
|
|
| |
Move generic code that could be shared between standard mount.nfs and
libmount version to utils.c and network.c.
CC: Chuck Lever <chuck.lever@oracle.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
Signed-off-by: Steve Dickson <steved@redhat.com>
|
|
|
|
|
|
|
|
|
|
| |
Ensure the test socket is always closed before nfs_ca_sockname()
returns. Otherwise it's orphaned.
BugLink: https://bugzilla.linux-nfs.org/show_bug.cgi?id=197
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Signed-off-by: Steve Dickson <steved@redhat.com>
|
|
|
|
|
|
|
| |
The following changes are needed to remove compile warnings when
MOUNT_CONFIG is not defined
Signed-off-by: Steve Dickson <steved@redhat.com>
|
|
|
|
|
|
|
|
|
|
| |
While zero is not a valid IP port number, zero does represent a valid
value for "port=". It means "query rpcbind to discover the actual
non-zero port number to use". So the parsing functions that handle
"port=" should not flag zero as an invalid value.
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Signed-off-by: Steve Dickson <steved@redhat.com>
|
|
|
|
|
|
|
| |
stropts.c:740:6: warning: 'ret' may be used uninitialized in this function
stropts.c:653:6: warning: 'ret' may be used uninitialized in this function
Signed-off-by: Steve Dickson <steved@redhat.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
It appears that, for a long while, NFS "remount" mounts have
completely wiped the existing mount options in /etc/mtab for a given
mount point. This is a problem for umount.nfs, since it reads its
options out of /etc/mtab to find out how to do the unmount.
The mount(8) command provides the NFS mount subcommand with the mount
options to perform the remount. There are four cases to consider:
1. Both the device and mount directory are specified on the
command line, and the target mount point is in /etc/fstab
2. Only one of the device and mount directory is specified on
the command line, and the target mount point is in
/etc/fstab
3. Both the device and mount directory are specified on the
command line, and the target mount point is not in /etc/fstab
4. Only one of the device and mount directory is specified on
the command line, and the target mount point is not in
/etc/fstab
Currently only case 4 works correctly. In that case, mount(8)
provides the correct set of mount options to the mount.nfs
subcommand and it can update /etc/mtab correctly.
Cases 1 and 3 replace all mount options in /etc/mtab with the options
provided on the command line during a remount. Case 2 replaces the
mount options in /etc/mtab with a mix of options from /etc/fstab and
/etc/mtab.
Cases 1 and 3 are historical behavior. Basically this is a formal
interface to allow administrators to replace the mount options in
/etc/mtab completely, instead of merging in new ones. The present
patch documents that behavior in nfs(5), and provides best practice
for remounting NFS mount points.
There are near-term plans to address case 2 by fixing mount(8)
(provided by utils-linux-ng in most distributions).
This is a partial fix for:
https://bugzilla.linux-nfs.org/show_bug.cgi?id=188
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Signed-off-by: Steve Dickson <steved@redhat.com>
|
|
|
|
|
|
|
|
| |
Clean up grammar and style issues introduced by recent updates. Also,
I'm not certain inappropriate options are always ignored.
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Signed-off-by: Steve Dickson <steved@redhat.com>
|
|
|
|
|
|
|
|
|
|
|
| |
Clean up.
No need to pass constant zeros to add_mtab() from its only call site.
Ensure that initialization of a struct mntent is consistent in both
places that it is done.
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Signed-off-by: Steve Dickson <steved@redhat.com>
|
|
|
|
|
|
|
|
| |
This appears to have been left behind by last year's adjustments to
how the extra_opts string is constructed.
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Signed-off-by: Steve Dickson <steved@redhat.com>
|
|
|
|
|
|
|
|
|
|
|
|
| |
stropts.c: In function nfs_parse_retry_option:
stropts.c:131: warning: conversion to unsigned int from long int may
alter its value
Make it more clear what the second argument is for, and flag the
switch fallthrough case.
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Signed-off-by: Steve Dickson <steved@redhat.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
It was reported that, if only "lo" is up,
mount.nfs 127.0.0.1:/export /mount
fails with "Name or service not known".
"man 3 getaddrinfo" says this:
If hints.ai_flags includes the AI_ADDRCONFIG flag, then IPv4
addresses are returned in the list pointed to by res only if the
local system has at least one IPv4 address configured, and IPv6
addresses are only returned if the local system has at least
one IPv6 address configured.
The man page oversimplifies here. A review of glibc shows that
getaddrinfo(3) explicitly ignores loopback addresses when deciding
whether an IPv4 or IPv6 address is configured.
This behavior around loopback is a problem not just for mount.nfs,
but also for RPC daemons that have to start up before a system's
networking is fully configured and started. Given the history of
other problems with AI_ADDRCONFIG and the unpredictable behavior it
introduces, let's just remove it everywhere in nfs-utils.
This fix addresses:
https://bugzilla.linux-nfs.org/show_bug.cgi?id=191
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Signed-off-by: Steve Dickson <steved@redhat.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
See the MS_NOMTAB macro in utils-linux-ng/mount/mount.c.
Note that mount(8) has MS_USERS and MS_USER in the "nomtab" category
as well, but mount.nfs needs to record those values so that unmounting
a user-mounted NFS file system can work.
While we're here, fix some white space damage in fix_opts_string().
This is a partial fix for:
https://bugzilla.linux-nfs.org/show_bug.cgi?id=188
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Signed-off-by: Steve Dickson <steved@redhat.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Neil Brown reports that umount.nfs is still confused by "-t nfs -o
vers=4" mounts.
/etc/mtab can be confused. /proc/mounts is authoritative on the
fstype of a mount. Have umount.nfs consult it to determine which
mechanism to use for unmounting. The code to read /proc/mounts was
lifted from the nfsstat command.
The code introduced by this patch may look like belt-n-suspenders, but
we have two use cases to consider:
1. Old kernels don't support the "vers=4" mount option, so
umount.nfs must look for the "nfs4" fstype
2. Upcoming kernels may eliminate support the "nfs4" fstype, so
umount.nfs must look for the "vers=4" mount option
Thus this logic checks for "nfs4" first then looks for the NFS version
setting.
Note that we could handle unmounting entirely in the kernel, but that
won't help older kernels that have this issue.
See:
https://bugzilla.linux-nfs.org/show_bug.cgi?id=189
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Signed-off-by: Steve Dickson <steved@redhat.com>
|
|
|
|
|
|
|
|
|
|
|
| |
Clean up. Our client does not support the MNT protocol on RDMA.
nfs_mount_protocol() isn't invoked for RDMA mounts (they are shunted
off before nfs_options2pmap() is invoked). But in case it ever is,
it should return the expected response.
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Signed-off-by: Steve Dickson <steved@redhat.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Clean up.
network.c: In function get_socket:
network.c:431: warning: dereferencing type-punned pointer might break
strict-aliasing rules
network.c: In function probe_bothports:
network.c:759: warning: dereferencing type-punned pointer might break
strict-aliasing rules
network.c:762: warning: dereferencing type-punned pointer might break
strict-aliasing rules
network.c: In function nfs_probe_statd:
network.c:775: warning: dereferencing type-punned pointer might break
strict-aliasing rules
network.c: In function nfs_call_umount:
network.c:904: warning: dereferencing type-punned pointer might break
strict-aliasing rules
network.c: In function nfs_ca_sockname:
network.c:1106: warning: dereferencing type-punned pointer might break
strict-aliasing rules
network.c:1112: warning: dereferencing type-punned pointer might break
strict-aliasing rules
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Signed-off-by: Steve Dickson <steved@redhat.com>
|
|
|
|
|
|
|
|
|
|
|
|
| |
parse_opt.c: In function po_rightmost:
parse_opt.c:517: warning: conversion to int from unsigned int may
change the sign of the result
"i" contains the function's result value, so it should be defined as
the same type as the function's return type.
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Signed-off-by: Steve Dickson <steved@redhat.com>
|