| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
| |
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>
|
|
|
|
| |
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>
|
|
|
|
| |
Signed-off-by: Steve Dickson <steved@redhat.com>
|
|
|
|
|
|
| |
the nfs(5) man page
Signed-off-by: Steve Dickson <steved@redhat.com>
|
|
|
|
|
|
| |
mount options to be set in a configuration file
Signed-off-by: Steve Dickson <steved@redhat.com>
|
|
|
|
|
|
| |
and parse them into comma separated mount options.
Signed-off-by: Steve Dickson <steved@redhat.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
server's hostname from the export path in the mounted on device name,
like this:
mount server:/export /mounted/on/dir
The server's hostname is "server" and the export path is "/export".
You can also substitute a specific IPv4 network address for the server
hostname, like this:
mount 192.168.0.55:/export /mounted/on/dir
Raw IPv6 addresses present a problem, however, because they look something
like this:
fe80::200:5aff:fe00:30b
Note the use of colons.
To get around the presence of colons, copy the Solaris convention used for
raw NFS server IPv6 addresses, which is to wrap the raw IPv6 address with
square brackets. This is also suggested in RFC 4038.
Introduce a new device name parser that can support traditional device
names and square brackets. Place the parser in a separate source file
so both the mount and umount paths can derive the server's hostname and
export pathname the same way.
Bonus points: add a check for NFS URLs and display an appropriate error
message in that case. This is cleaner than failing with "unknown host:
nfs".
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Signed-off-by: Steve Dickson <steved@redhat.com>
|
|
|
|
|
|
|
| |
header file which allows the code to be shared
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Signed-off-by: Steve Dickson <steved@redhat.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Adapt a parsing trick used by Python.
Parse mount option strings into an abstract data type so we don't have to
copy and/or tokenize the whole option string multiple times while trying
to manipulate the mount options. Then, just before calling the mount(2)
system call, convert the object back into a C string.
One major advantage of this approach is that we can copy the final version
of the mount options into /etc/mtab when we're done, instead of copying in
the original mount options that the user specified. Any fallback from NFS
v3 to NFS v2 or TCP to UDP that was done by mount.nfs will be reflected in
/etc/mtab.
This patch adds methods for creating and manipulating mount option data
objects.
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Signed-off-by: Neil Brown <neilb@suse.de>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
To quote the strtok(3) man page: "Avoid using these functions."
OK. We've created our own. The main reason for this is that strtok(3)
doesn't handle quoted delimiters at all. We need to handle this:
context="foo,bar"
where 'context' is a single mount option that sets a token string that
possibly uses the same delimiter that the mount command uses to separate
options (that is, a comma).
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Signed-off-by: Neil Brown <neilb@suse.de>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Introduce support files which contain code that builds string mount
options and passes them to the kernel. This is a pre-requisite for
actually enabling /sbin/mount.nfs to do text-based mounts.
This is only partially complete at the moment, but is presented so that
folks can start banging on the kernel mount option string parsing code.
There are clearly still parts that are not implemented quite yet, such
as bg and retry support, but it should be enough to get going.
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Signed-off-by: Neil Brown <neilb@suse.de>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The file support/nfs/fstab.c, which is linked into libnfs.a, depends on the
global variable "verbose." This variable is defined and used only in the
mount command, and the functions in fstab.c are used only by the mount
command.
Move fstab.c and support/include/fstab.h to utils/mount. This file
placement is also consistent with at least one other mount helper,
mount.ocfs2.
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Signed-off-by: Neil Brown <neilb@suse.de>
|
|
|
|
|
|
|
|
| |
Separate network oriented functions from filesystem oriented
functions, for general cleanliness.
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Signed-off-by: Neil Brown <neilb@suse.de>
|
|
|
|
|
|
|
| |
Clean up, and pre-requisite for subsequent fixes.
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Signed-off-by: Neil Brown <neilb@suse.de>
|
|
|
|
| |
Also fix a few bugs that came up in initial testing.
|
| |
|
|
|
|
|
|
| |
This patch is now hard-coded in the Makefile.am and cannot
be changed by configure. But as it needs to match what
util-linux does, that is probably a good thing.
|
|
|
|
|
|
|
| |
Merge utils/mount/nfsmount.x and support/export/mount.x into support/export/mount.x.
Signed-off-by: Amit Gud <agud@redhat.com>
Signed-off-by: Steve Dickson <steved@redhat.com>
|
| |
|
|
Adds the mount directory and the code to mount and umount the NFS file system.
Signed-off-by: Amit Gud <agud@redhat.com>
Signed-off-by: Steve Dickson <steved@redhat.com>
|