From: Chuck Lever Date: Wed, 13 Oct 2010 17:55:10 +0000 (-0400) Subject: umount.nfs: Distinguish between nfs4 and nfs mounts X-Git-Tag: nfs-utils-1-2-4-rc1~2 X-Git-Url: https://git.decadent.org.uk/gitweb/?a=commitdiff_plain;ds=sidebyside;h=dc08c702a6c7f824f317af561f491635ee898a71;hp=dc08c702a6c7f824f317af561f491635ee898a71;p=nfs-utils.git umount.nfs: Distinguish between nfs4 and nfs mounts 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 Signed-off-by: Steve Dickson ---