summaryrefslogtreecommitdiffstats
path: root/utils/mount/mount_libmount.c
Commit message (Collapse)AuthorAgeFilesLines
* umount: use correct return value for is_vers4.NeilBrown2012-08-061-3/+3
| | | | | | | | | | | | | | 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: ignore non-nfs filesystemsKarel Zak2012-08-011-2/+9
| | | | | | | | | | | | | | | | | | | | # 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>
* mount.nfs: restore correct error status when umount failsNeilBrown2012-07-161-5/+4
| | | | | | | | | | | | | | | | | 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>
* mount.nfs: don't overwrite mount options from /etc/nfsmount.confKarel Zak2012-01-051-0/+15
| | | | | | | | | | | | | | 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>
* pdate addres for Free Software FoundationNeilBrown2011-08-291-2/+2
| | | | | | | | | | | | 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>
* mount: fix for libmount from util-linux >= 2.20Karel Zak2011-08-031-3/+12
| | | | | | | | 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: add --enable-libmount-mountKarel Zak2011-04-061-0/+413
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>