summaryrefslogtreecommitdiffstats
path: root/utils/mount
Commit message (Collapse)AuthorAgeFilesLines
...
* mount.nfs: Support double-wide characters in printed stringsChuck Lever2007-08-045-44/+54
| | | | | | | | | | | Previous NLS changes missed a spot or two. This patch tries to get most of them, but probably misses a few more. In errors.c:mount_errors() I've removed a period at the end of the error messages; this is consistent with other error messages I've examined. Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Neil Brown <neilb@suse.de>
* Fix more 'prototype' warnings and other warnings.Neil Brown2007-07-301-1/+2
| | | | Signed-off-by: Neil Brown <neilb@suse.de>
* mount.nfs: clean up a couple of printfs in fstab.cChuck Lever2007-07-301-9/+12
| | | | | | | Clean up for consistent use. Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Neil Brown <neilb@suse.de>
* libnfs.a: eliminate another dependency on a global variableChuck Lever2007-07-303-2/+587
| | | | | | | | | | | | | | 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>
* libnfs.a: eliminate conn.c and conn.hChuck Lever2007-07-305-5/+20
| | | | | | | conn.[ch] are now no longer needed. Clean them out and delete them. Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Neil Brown <neilb@suse.de>
* mount.nfs: use nfs_error instead of fprintf in get_socket()Chuck Lever2007-07-301-47/+53
| | | | | | | | | Use nfs_error() where appropriate. I used "goto" here to reduce string splitting and indenting past the point of readability. Gee, it would be nice if C had proper exception handling... Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Neil Brown <neilb@suse.de>
* libnfs.a: move get_socket() function to utils/mount/network.cChuck Lever2007-07-301-0/+73
| | | | | | | | | | Now we can address the real problem: that get_socket() depends on the global variable "verbose" which is only available in the mount command. Move get_socket() into utils/mount/network.c, and make it static. Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Neil Brown <neilb@suse.de>
* libnfs.a: move clnt_ping() to utils/mountChuck Lever2007-07-303-0/+83
| | | | | | | | | | Continue clean up of mount functionality in libnfs.a by moving clnt_ping() to utils/mount/network.c. Note that socklen_t is an unsigned int... the i386 gcc compiler threw a signedness warning about the 3rd argument of getsockname(). Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Neil Brown <neilb@suse.de>
* libnfs.a: move more mount-only functions out of libnfs.aChuck Lever2007-07-302-0/+36
| | | | | | | Continue clean-up with nfsvers_to_mnt() and mntvers_to_nfs(). Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Neil Brown <neilb@suse.de>
* libnfs.a: move mnt_{open, close}clnt calls to utils/mount/network.cChuck Lever2007-07-302-0/+53
| | | | | | | | | | | | | | | | | It turns out that get_socket() accesses a global variable, "verbose," that is only available in the mount command; yet it's in libnfs.a. This creates an undocumented API dependency that will bite someone someday. This mount-specific functionality doesn't really belong in libnfs.a anyway. The simplest way to resolve this is to move all of the functions in support/nfs/conn.c into utils/mount. network.c seems like the logical place to put these. An added benefit is we eventually get to make get_socket() static. Let's start with the mnt_{open,close}clnt functions. Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Neil Brown <neilb@suse.de>
* mount.nfs: clean up getport() functionChuck Lever2007-07-301-19/+28
| | | | | | | | Mostly comment clarification. Also replace some naked undocumented integers with macros, and make getport() static. Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Neil Brown <neilb@suse.de>
* mount.nfs: fix hang when getport() uses TCP against unavailable serversChuck Lever2007-07-301-2/+17
| | | | | | | | | If get_socket() can't get us an open TCP socket, we know the server is down, so make getport() exit early instead of hanging. This logic is copied from clnt_ping(). Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Neil Brown <neilb@suse.de>
* umount.nfs: eliminate a nearly empty header file.Chuck Lever2007-07-306-14/+2
| | | | | | | | Clean-up: move nfsumount() global declaration to nfs_mount.h, and remove nfsumount.h. Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Neil Brown <neilb@suse.de>
* umount.nfs: Pass return codes from do_nfs_umount backChuck Lever2007-07-301-3/+4
| | | | | | | Do we really care about these return codes? Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Neil Brown <neilb@suse.de>
* umount.nfs: Make do_nfs_mount use conventional EX_ style return codesChuck Lever2007-07-301-12/+26
| | | | | | | | | do_nfs_mount() should return EX_ style return codes and not 1 or 0 in order to distinguish between usage errors and other problems (such as EX_FILEIO or RPC errors). Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Neil Brown <neilb@suse.de>
* umount.nfs: make _nfsumount() staticChuck Lever2007-07-301-3/+3
| | | | | | | | | | | _nfsumount() is never called outside of nfsumount.c. Also give it a more conventional name. Note that it's return code is ignored. That will be addressed in a subsequent patch. Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Neil Brown <neilb@suse.de>
* umount.nfs: make del_mtab() a static functionChuck Lever2007-07-301-1/+1
| | | | | | | Clean-up: del_mtab() isn't used outside of nfsumount.c. Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Neil Brown <neilb@suse.de>
* Make sure nfs_call_umount's callers are handling its return code correctlyChuck Lever2007-07-301-7/+20
| | | | | | | | umount.nfs is treating nfs_call_umount's return code like a standard mount return code (EX_SOMETHING) when its really an RPC return code. Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Neil Brown <neilb@suse.de>
* umount.nfs: move nfs_call_umount to network.cChuck Lever2007-07-304-44/+36
| | | | | | | | | nfs_call_umount() is shared by nfsmount.c and nfsumount.c, and manages a network function (building the RPC umount call to the server's MNT daemon). So move it to network.c with other network-related functions. Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Neil Brown <neilb@suse.de>
* umount.nfs: make umount_usage() staticChuck Lever2007-07-303-8/+7
| | | | | | | No good reason to export umount_usage. Make it static. Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Neil Brown <neilb@suse.de>
* umount.nfs: make umount.nfs use UDP by defaultChuck Lever2007-07-301-1/+0
| | | | | | | | mount.nfs currently uses UDP by default when calling a MNT server. Make umount.nfs do the same. Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Neil Brown <neilb@suse.de>
* umount.nfs: some umount.nfs error return codes are confusingChuck Lever2007-07-301-5/+5
| | | | | | | | | | umount.nfs should return the standard EX_ mount return codes. At some point in the past, it was returning 0 for failure and 1 for success, and some of these have been changed and some haven't. See if we can rectify this. Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Neil Brown <neilb@suse.de>
* mount.nfs: fix more nits with error messagesChuck Lever2007-07-303-11/+16
| | | | | | | Catch-all. Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Neil Brown <neilb@suse.de>
* Add -Wstrict-prototypes to compiler args, and fix warnings caused.Neil Brown2007-07-294-4/+4
|
* mount.nfs: White space clean upChuck Lever2007-07-205-32/+42
| | | | | Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Neil Brown <neilb@suse.de>
* mount.nfs: Use nfs_error in nfsmount.c, nfsumount.c, and nfs4mount.cChuck Lever2007-07-203-64/+56
| | | | | | | Clean up. - fprintf becomes nfs_error Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Neil Brown <neilb@suse.de>
* mount.nfs: Error handling clean-upChuck Lever2007-07-202-24/+33
| | | | | | | | | o Use nfs_error( _() ) instead of fprintf(stderr, o Use the mount return code macros instead of bare integers o Free mount_point after it has been canonicalized Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Neil Brown <neilb@suse.de>
* mount.nfs: When -v is set and the mount succeeds, print the mount infoChuck Lever2007-07-201-0/+15
| | | | | | | Add a bit of logic that appears to be in other mount helpers. Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Neil Brown <neilb@suse.de>
* Remove the running_bg parameterChuck Lever2007-07-205-7/+7
| | | | | | | | Clean up: when nfsmount and nfs4mount are called, running_bg is always set to zero. Remove the parameter from the call. Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Neil Brown <neilb@suse.de>
* mount.nfs: Change *flags to flagsChuck Lever2007-07-205-9/+9
| | | | | | | | | It's not necessary to treat the *flags parameter to nfsmount and nfs4mount as an output parameter. Nothing is passed back. Replace it with a normal call-by-value. Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Neil Brown <neilb@suse.de>
* mount.nfs: No need to return nfs_mount_data structsChuck Lever2007-07-205-31/+24
| | | | | | | | | | | | | | | | Refactor mount processing slightly to remove an output parameter and an unnecessary type cast. The mount syscall is now made from inside nfs_mount or nfs4mount, rather than in common code after those are called. Code review suggests that EX_BG was never returned by mount.nfs because the logic I just replaced was always returning EX_FAIL. The new logic should properly return EX_BG when appropriate. However, it is unclear whether /bin/mount handles backgrounding the mount request, or whether mount.nfs should. Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Neil Brown <neilb@suse.de>
* mount.nfs: Move MS_DUMMY and friends to header fileChuck Lever2007-07-202-5/+12
| | | | | | | | | We move the definitions of MS_USER and friends to our local copy of mount_constants.h. These will need to be available in nfsmount.c and nfs4mount.c when we move the mount system call out of mount.c. Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Neil Brown <neilb@suse.de>
* mount.nfs: Move start_statd into nfs_mountChuck Lever2007-07-205-64/+65
| | | | | | | | | | | | | | Move start_startd into network.c, and move the call inside of nfs_mount, instead of immediately after - conceptually a better place for it. Also fix a minor nit: Since the mount actually fails if start_statd doesn't work, cause mount.nfs to exit with a status of EX_FAIL. Still need to do something about "running_bg" in nfsmount.c:nfsmount(). Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Neil Brown <neilb@suse.de>
* mount.nfs: Move network functions into a common source moduleChuck Lever2007-07-206-274/+354
| | | | | | | | 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>
* mount.nfs: Eliminate some C macros that use implicit argumentsChuck Lever2007-07-201-78/+81
| | | | | | | | Get rid of nfs_probelist, mnt_probelist, and proto_probelist in order to remove the use of HAVE_RELIABLE_TCP, MAX_NFSPROT, and MAX_MNTPROT. Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Neil Brown <neilb@suse.de>
* mount.nfs: Always preset nfs_mount_versionChuck Lever2007-07-203-72/+64
| | | | | | | | | | | | nfs_mount_version is a global integer that is set based on a guess about which nfs_mount_data version is appropriate for the kernel we're running on. Make it always available and have the correct value before calling mount and unmount so they don't have to worry about setting it themselves. Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Neil Brown <neilb@suse.de>
* mount.nfs: Create a common source module for reporting mount errorsChuck Lever2007-07-208-183/+277
| | | | | | | 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>
* mount.nfs: clean-up add_mtabChuck Lever2007-07-201-24/+28
| | | | | | | | | | Clean up add_mtab(), and make /sbin/mount.nfs[4] return a proper error if it fails. Also include an unbalanced unlock_mtab() noticed by Steve D. Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Neil Brown <neilb@suse.de>
* mount.nfs: /bin/mount already handles --bind & friendsChuck Lever2007-07-201-30/+0
| | | | | | | | | | | | | Clean-up: remove logic to handle --bind and other such command-line options from mount.nfs[4]. These options are already handled in /bin/mount, and the logic for handling them in the NFS helper is currently disabled. Other helpers such as mount.ocfs2 appear not to support --bind (ie. they rely on /bin/mount to do it). Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Neil Brown <neilb@suse.de>
* mount.nfs: Remove support for "-t" optionChuck Lever2007-07-201-36/+26
| | | | | | | | /bin/mount will never pass "-t" to a mount helper, since it passes the fs-type in the name of the program it is executing. Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Neil Brown <neilb@suse.de>
* mount.nfs: Simplify generation of prognameChuck Lever2007-07-201-7/+2
| | | | | | | Use basename() instead of our own majick. Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Neil Brown <neilb@suse.de>
* Fix umount.nfs exit statusSteinar H. Gunderson2007-07-161-1/+1
| | | | | | | | | | | | | | | | Hi, As per a bug report from a user: mount.c seems to assume that nfsumount() uses standard C true/false return values, and inverts them for the exit status (where 0 is traditionally considered success). However, nfsumount() consistently seems to use 0 for success, and thus a success gets returned as exit status 1 and a failure as exit status 0. This confuses at least the GNOME drive manager applet, and probably others as well. Signed-off-by: Steinar H. Gunderson <sesse@debian.org> Signed-off-by: Neil Brown <neilb@suse.de>
* Added missing unlock_mtab() call in the add_mtab()Steve Dickson2007-07-161-0/+1
| | | | | | routine. Signed-off-by: Steve Dickson <steved@redhat.com>
* move pseudoflavor information to common codeJ. Bruce Fields2007-07-102-35/+4
| | | | | | | | I'd like to be able to use the same pseudoflavor data in exportfs and mountd; so move it to nfslib and a common include. Signed-off-by: "J. Bruce Fields" <bfields@citi.umich.edu> Signed-off-by: Neil Brown <neilb@suse.de>
* fix warnings in mount.cJ. Bruce Fields2007-07-101-1/+1
| | | | | | | | The compiler is warning because we aren't properly specifying the type of the chk_mountpoint argument. Signed-off-by: "J. Bruce Fields" <bfields@citi.umich.edu> Signed-off-by: Neil Brown <neilb@suse.de>
* mount.nfs: Add the mount option "nosharecache"Trond Myklebust2007-07-105-4/+50
| | | | | | | | | | | | | | | | | | | | | | Prior to David Howell's mount changes in 2.6.18, users who mounted different directories which happened to be from the same filesystem on the server would get different super blocks, and hence could choose different mount options. As long as there were no hard linked files that crossed from one subtree to another, this was quite safe. Post the changes, if the two directories are on the same filesystem (have the same 'fsid'), they will share the same super block, and hence the same mount options. Add a flag to allow users to elect not to share the NFS super block with another mount point, even if the fsids are the same. This will allow users to set different mount options for the two different super blocks, as was previously possible. It is still up to the user to ensure that there are no cache coherency issues when doing this, however the default behaviour will be to share super blocks whenever two paths result in the same fsid. Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com> Signed-off-by: Neil Brown <neilb@suse.de>
* mount.nfs - NFSv4 mounts give wrong error message when server denies the mountSteve Dickson2007-05-171-5/+35
| | | | | | | | | | When nfs4 mount fail because the exported directory does not exist, the mount command claims the local mount point does not exist which is wrong. This patch fixes that problem as well as makes the v4 mount failures look like v3/v2 failures. Signed-off-by: Steve Dickson <steved@redhat.com> Signed-off-by: Neil Brown <neilb@suse.de>
* mount.nfs4: Remove checks for idmapd and gssd running.Neil Brown2007-05-111-0/+5
| | | | | | While it is nice to have the checks, nothing in this package creates the files that are checked, so we shouldn't check them yet.
* mount.nfs - nordirplus optionSteve Dickson2007-03-293-0/+11
| | | | | | | | | | From: Steve Dickson <steved@redhat.com> Adds the -o nordirplus mount option that will disable NFS clients from using the READDIRPLUS RPC. Signed-off-by: Steve Dickson <steved@redhat.com> Signed-off-by: Neil Brown <neilb@suse.de>
* mount.nfs.man - Use nolocks for /, /usr, /varNeil Brown2007-03-291-5/+12
| | | | | | | Make it clear in manpage for mount.nfs that using nolock is appropriate for /, /usr and /var. Signed-off-by: Neil Brown <neilb@suse.de>