History log of /freebsd-10.0-release/sbin/umount/
Revision Date Author Comments
(<<< Hide modified files)
(Show modified files >>>)
259065 07-Dec-2013 gjb

- Copy stable/10 (r259064) to releng/10.0 as part of the
10.0-RELEASE cycle.
- Update __FreeBSD_version [1]
- Set branch name to -RC1

[1] 10.0-CURRENT __FreeBSD_version value ended at '55', so
start releng/10.0 at '100' so the branch is started with
a value ending in zero.

Approved by: re (implicit)
Sponsored by: The FreeBSD Foundation

256281 10-Oct-2013 gjb

Copy head (r256279) to stable/10 as part of the 10.0-RELEASE cycle.

Approved by: re (implicit)
Sponsored by: The FreeBSD Foundation


243082 15-Nov-2012 eadler

Fix memory leak in umount.c

PR: bin/172553
Submitted by: Erik Cederstrand <erik@cederstrand.dk>
Approved by: cperciva
MFC after: 3 days


227081 04-Nov-2011 ed

Add missing static keywords for global variables to tools in sbin/.

These tools declare global variables without using the static keyword,
even though their use is limited to a single C-file, or without placing
an extern declaration of them in the proper header file.


224040 14-Jul-2011 mckusick

When using -A option (unmount all mounted filesystems), do not attempt
to unmount /dev as it will always fail.


222541 31-May-2011 rmacklem

Add a sentence to the umount.8 man page to clarify the behaviour
for forced dismount when used on an NFS mount point. Requested by
Jeremy Chadwick.
This is a content change.

MFC after: 2 weeks


222466 29-May-2011 rmacklem

Modify the umount(8) command so that it doesn't do
a sync(2) syscall before unmount(2) for the "-f" case.
This avoids a forced dismount from getting stuck for
an NFS mountpoint in sync() when the server is not
responsive. With this commit, forced dismounts should
normally work for the NFS clients, but can take up to
about 1minute to complete.

PR: kern/157365
Reviewed by: kib
MFC after: 2 weeks


219955 24-Mar-2011 ru

It's possible to unmount multiple items at once, make it clear.


203490 04-Feb-2010 ume

Introduce '[ipaddr]:path' notation.
Since the existing implementation searches ':' backward, a path which
includes ':' could not be mounted. You can now mount such path by
enclosing an IP address by '[]'.
Though we should change to search ':' forward, it will break
'ipv6addr:path' which is currently working. So, it still searches ':'
backward, at least for now.

MFC after: 2 weeks


201252 30-Dec-2009 ed

Let umount build with -Wold-style-definition.


201135 28-Dec-2009 delphij

Make umount(8) WARNS=6 clean:
- Cast delimiter width to integer [1]
- Solve name conflicts against system header
- Constify parameters to avoid qualifier conflict

PR: bin/140017 [1]
Submitted by: Ulrich Spörlein <uqs spoerlein net> [1]
MFC after: 1 month
Sponsored by: iXsystems, Inc


196287 17-Aug-2009 pjd

Be more precise how to get fsids - 'mount -v' doesn't show fsids unless is run
by root.

Approved by: re (kib)


194880 24-Jun-2009 dfr

Don't use sys/nfs/rpcv2.h - it is part of the old kernel RPC implementation
and will be removed.


141611 10-Feb-2005 ru

Sync program's usage() with manpage's SYNOPSIS.


128073 09-Apr-2004 markm

Remove advertising clause from University of California Regent's license,
per letter dated July 22, 1999.

Approved by: core, imp


126569 04-Mar-2004 brueffer

s/considred/considered/


126178 23-Feb-2004 johan

style.Makefile(5):
Use WARNS?= instead of WARNS=.


123160 05-Dec-2003 iedowse

Don't include the file system ID in the output of `mount -v' if it
is all zeros. The kernel now consistently zeroes FSIDs for non-root
users, so there's no point in printing these. Also fix a misspelling
in a comment.

Submitted by: Rudolf Cejka <cejkar@fit.vutbr.cz>
Approved by: re (scottl)


122804 16-Nov-2003 iedowse

If the unmount by file system ID fails, don't warn before retrying
a non-fsid unmount if the file system ID is all zeros. This is a
temporary workaround for warnings that occur in the vfs.usermount=1
case because non-root users get a zeroed filesystem ID. I have a
more complete fix in the works, but I won't get it done for 5.2.


121692 29-Oct-2003 iedowse

When removing trailing slashes, don't remove the first character
of the name if it is '/'. Also fix a comparison between signed and
unsigned quantities (pointed out by trhodes).


117794 20-Jul-2003 iedowse

Take advantage of the use of file system IDs to simplify umount(8)
and make it work more reliably in a number of cases that have
traditionally been troublesome. The new behaviour is:
1) If the filesystem can be determined by the fsid or device,
or uniquely identified by the mountpoint, then just go ahead
and call unmount(2) using the file system ID.
2) Otherwise use fstatfs(2) to resolve the path into a file system
ID (checking with stat(2) that it is a filesystem root directory).

Case 2 can potentially block if an NFS server is down, but it can
always be avoided by using an unambiguous specification. It handles
all the hard cases such as symlinks and mismatches between the mount
list and reality. For example, if a filesystem was mounted as /mnt
inside a chroot, it will show up in the mount list as /mnt, but now
you can unmount it from outside the chroot with "umount /chroot_path/mnt".


117742 18-Jul-2003 iedowse

When mount(8) is invoked with the `-v' flag, display the filesystem
ID for each file system in addition to the normal information.

In umount(8), accept filesystem IDs as well as the usual device and
path names. This makes it possible to unambiguously specify which
file system is to be unmounted even when two or more file systems
share the same device and mountpoint names (e.g. NFS mounts from
the same export into different chroots).

Suggested by: Dan Nelson <dnelson@allantgroup.com>


117720 18-Jul-2003 iedowse

Since checkmntlist() and getmntentry() return a struct statfs that
includes the filesystem type name, remove the "type" output parameter.


117712 18-Jul-2003 iedowse

When the file system to unmount is specified by device name instead
of by mount point, umount had to take care not to unmount the wrong
file system if another file system was covering the requested one.
Now that the file system to unmount is specified to the kernel using
the filesystem ID, this confusion cannot occur, so remove the code
that checked for it.


117132 01-Jul-2003 iedowse

Add a new mount flag MNT_BYFSID that can be used to unmount a file
system by specifying the file system ID instead of a path. Use this
by default in umount(8). This avoids the need to perform any vnode
operations to look up the mount point, so it makes it possible to
unmount a file system whose root vnode cannot be looked up (e.g.
due to a dead NFS server, or a file system that has become detached
from the hierarchy because an underlying file system was unmounted).
It also provides an unambiguous way to specify which file system is
to be unmunted.

Since the ability to unmount using a path name is retained only for
compatibility, that case now just uses a simple string comparison
of the supplied path against f_mntonname of each mounted file system.

Discussed on: freebsd-arch
mdoc help from: ru


115162 19-May-2003 ru

mdoc(7) fixes: Fix the markup in the recently added ENVIRONMENT section.


113234 07-Apr-2003 mdodd

Bump the date for recent commits.


113224 07-Apr-2003 mdodd

Clarify the behavior of PATH_FSTAB with regard to 'tainted' execution.

Requested by: ru


113220 07-Apr-2003 mdodd

Implement the '-F' option for mount & umount which allows the user to
specify an alternate fstab file.


113216 07-Apr-2003 mdodd

Quiet warning.


111307 23-Feb-2003 johan

Remove one of two WARNS=0.


108533 01-Jan-2003 schweikh

Correct typos, mostly s/ a / an / where appropriate. Some whitespace cleanup,
especially in troff files.


102231 21-Aug-2002 trhodes

s/filesystem/file system/g as discussed on -developers


101651 10-Aug-2002 mux

- Introduce a new struct xvfsconf, the userland version of struct vfsconf.
- Make getvfsbyname() take a struct xvfsconf *.
- Convert several consumers of getvfsbyname() to use struct xvfsconf.
- Correct the getvfsbyname.3 manpage.
- Create a new vfs.conflist sysctl to dump all the struct xvfsconf in the
kernel, and rewrite getvfsbyname() to use this instead of the weird
existing API.
- Convert some {set,get,end}vfsent() consumers to use the new vfs.conflist
sysctl.
- Convert a vfsload() call in nfsiod.c to kldload() and remove the useless
vfsisloadable() and endvfsent() calls.
- Add a warning printf() in vfs_sysctl() to tell people they are using
an old userland.

After these changes, it's possible to modify struct vfsconf without
breaking the binary compatibility. Please note that these changes don't
break this compatibility either.

When bp will have updated mount_smbfs(8) with the patch I sent him, there
will be no more consumers of the {set,get,end}vfsent(), vfsisloadable()
and vfsload() API, and I will promptly delete it.


99503 06-Jul-2002 charnier

The .Nm utility.


96707 16-May-2002 trhodes

more file system > filesystem


87325 04-Dec-2001 obrien

Default to WARNS=2.
Binary builds that cannot handle this must explicitly set WARNS=0.

Reviewed by: mike


84868 13-Oct-2001 iedowse

Oops, fix a missing condition that broke umount's `-h' option. I
had somehow removed an error check in revision 1.26, causing errx()
to be called unconditionally in the -h case.


80146 22-Jul-2001 iedowse

Fix some bugs and general brain damage in mounttab:
- Declare mtabhead as an extern in mounttab.h and define it only in
mounttab.c.
- Remove shared global `verbose' and instead pass it as a parameter.
- Remove the `mtabp' argument to read_mtab(). It served no purpose
whatsoever, although read_mtab() did use it as a temporary local
variable.
- Don't check for impossible conditions when parsing mounttab, and
do detect zero-length fields.
- Correctly test for strtoul() failures - just testing ERANGE is wrong.
- Include a field name in syslog errors, and avoid passing NULL to
a syslog %s field.
- Don't test if arrays are NULL.
- If there are duplicates when writing out mounttab, keep the last
entry instead of the first, as it will have a later timestamp.
- Fix a few formatting issues.

Update rpc.umntall and umount to match the mounttab interface changes.


80118 22-Jul-2001 iedowse

Include the remote hostname in RPC-related warning messages. Exit
immediately if a host specified by the -h flag cannot be parsed
instead of attempting to unmount all NFS filesystems, which was
bad.

Add a missing return statement at the end of checkname(); this
could result in a non-zero exit status in some cases even if the
unmount succeeded.

Group two separate NFS-related operations into one block to make
it more obvious that a variable (hostp) is not dereferenced when
uninitialised. Initialise it to NULL anyway to avoid a warning.

Pass in the read_mtab()'s bogus argument as NULL instead of messing
with a local variable to achieve the same effect. A later commit
will clean up this mounttab interface.


79530 10-Jul-2001 ru

mdoc(7) police: removed HISTORY info from the .Os call.


77575 01-Jun-2001 ru

Remove vestiges of MFS.


74815 26-Mar-2001 ru

- Backout botched attempt to introduce MANSECT feature.
- MAN[1-9] -> MAN.


74531 20-Mar-2001 ru

Set the default manual section for sbin/ to 8.


74462 19-Mar-2001 alfred

Bring in a hybrid of SunSoft's transport-independent RPC (TI-RPC) and
associated changes that had to happen to make this possible as well as
bugs fixed along the way.

Bring in required TLI library routines to support this.

Since we don't support TLI we've essentially copied what NetBSD
has done, adding a thin layer to emulate direct the TLI calls
into BSD socket calls.

This is mostly from Sun's tirpc release that was made in 1994,
however some fixes were backported from the 1999 release (supposedly
only made available after this porting effort was underway).

The submitter has agreed to continue on and bring us up to the
1999 release.

Several key features are introduced with this update:
Client calls are thread safe. (1999 code has server side thread
safe)
Updated, a more modern interface.

Many userland updates were done to bring the code up to par with
the recent RPC API.

There is an update to the pthreads library, a function
pthread_main_np() was added to emulate a function of Sun's threads
library.

While we're at it, bring in NetBSD's lockd, it's been far too
long of a wait.

New rpcbind(8) replaces portmap(8) (supporting communication over
an authenticated Unix-domain socket, and by default only allowing
set and unset requests over that channel). It's much more secure
than the old portmapper.

Umount(8), mountd(8), mount_nfs(8), nfsd(8) have also been upgraded
to support TI-RPC and to support IPV6.

Umount(8) is also fixed to unmount pathnames longer than 80 chars,
which are currently truncated by the Kernel statfs structure.

Submitted by: Martin Blapp <mb@imp.ch>
Manpage review: ru
Secure RPC implemented by: wpaul


68960 20-Nov-2000 ru

mdoc(7) police: use the new features of the Nm macro.


65564 07-Sep-2000 des

Fix comment to match previous commit, as per bde.


65525 06-Sep-2000 des

Don't warn about unknown mount types, since they most likely simply mean
that the right module hasn't been loaded yet (and mount(8) will do so
when necessary).


63073 13-Jul-2000 dwmalone

Clarify "mount -a -t" example - it only unmounts stuff in /etc/fstab.
Fix a typo.

PR: 19438
Submitted by: Eoin Lawless <eoin@maths.tcd.ie>
Reviewed by: sheldon


53550 22-Nov-1999 dillon

Finish up umntall support. init now passed an argument to the
rundown script 'reboot' or 'single'. ISO support (which never
worked) has been removed from mount_nfs. mount_nfs and umount
now use mounttab, which allows umntall to work properly. The
rc scripts now call umntall as appropriate.

Submitted by: Martin Blapp <mb@imp.ch>


52622 29-Oct-1999 green

Fix a logic problem that broke umount -a.

Reported by: Martin Blapp <mb@imp.ch>


52440 23-Oct-1999 green

Small bugfixes (point not getting marked in one case, string not NUL and
wrong size in the other.)

Submitted by: Martin Blapp <mb@imp.ch>


52374 18-Oct-1999 green

Fix a few things. Unbogosify a free(), {,UN}MARK with correct args, and
fix count checks.

Submitted by: Martin Blapp <mb@imp.ch>


52340 17-Oct-1999 green

quoting << Martin_Blapp

- Completly changed the internals of umount(8). We do three
checks now to see if 'argv' is in the mounttable. It they
all fail, we return to main and print a warning.

- fixed the umount mount-order. The checks are rather complex
to do this. Cause umount(8) should also be able to unmount
several devices at once ('umount -a', 'umount -A',
'umount /mnt /mnt2'), the mount-order get's important.
I added checks to mark and unmark already unmounted devices.

- Various fixes with nfs-unmounts (no rpc-calls were done,
or they were done although there was an existing mount).
Since we allow overlay-mounts, we should also handle them
properly.

- Translate the deprecated nfs-syntax with '@' to ':' like
mount_nfs does. The ':' syntax has now precedence, but '@'
still works.

- 'umount -v' is now fixed for all cases and doesn't print
garbage like two times the mountpoint etc.

- removed non documented and useless umount '-F'.

- hanged nfsmounts can now unmounted 'without' any problems.
I've removed stat() and realpath() checks on the mountpoint.
Instead we just do a realpath() on the basedir of the
mountpath and add the dirname again.
Implemented this as an idea from phk. But there are still
vfs-restrictions if the nfs_mount is busy. If there are
unwritten metadata on a hanged nfs-mount, and we modify
nfs_vfsops.c to not return EBUSY, we get a deadlock :(
The problem has now moved from userland to kernel.

- removed the BUGS part from the umount(8) manpage.

- Converted it to ANSI C (more than 60% of the code have
changed).

Martin_Blapp

Fixed PR's
----------

o [1999/02/03] bin/9893 NFS umount of regular file impossible

s [1995/11/27] bin/841 stale nfs mounts cannot be umounted

o [1999/08/01] bin/12911 alfred NFS umounts are not properly done
if just the mountpoint gets umounted

Only partially solved:
----------------------

The problem is now in kernel:

o [1999/04/07] bin/11005 `umount -f' does not work if the
NFS-server is down.

PR: bin/9893 bin/841 bin/12911 bin/11005
Submitted by: Martin Blapp <mb@imp.ch>


52037 08-Oct-1999 n_hibma

Fix -Wall warnings

Submitted-By: Martin Blapp <mblapp@kassiopeja.lan.attic.ch>


50476 28-Aug-1999 peter

$Id$ -> $FreeBSD$


38041 03-Aug-1998 charnier

Use errx() instead of err() for malloc failures. -Wall. Do not dot
terminate errx() string. Remove unused #includes. Use .Tn for NFS.


35939 11-May-1998 peter

Fix PR 1607, hopefully without breaking the PR 5208 fixes.

umount() was trying to stat() the mountpoint, this would fail if the
mountpoint was a NFS mountpoint, and the fallback code would try and pass
a hostname:/dir path as the mountpoint to unmount(2), which would fail.

This whole stat() of the name supplied on the command line business is
trouble as it'll wedge on a hung NFS mount.

I'm not entirely sure why we are not simply looking up both arguments
in the mount table and doing the right thing without accessing the
filesystem. It seems that we're going to a lot of trouble to allow
mountpoints on symlinks and other wierd things.

PR: 1607


33038 03-Feb-1998 bde

Fixed the previous fix. The original path was annulled when it
was a directory, so the error message for attempting to unmount
an unmounted-on directory was more broken than before.


32645 20-Jan-1998 bde

Removed definition of _NEW_VFSCONF. The new vfsconf interface is now
the default.


32626 19-Jan-1998 bde

mount(8) only uses realpath() for the mountpoint, so don't look up the
real path here for the mount device (or path). This fixes difficulties
unmounting devices that are actually symlinks to real devices.

Also, print the original path instead of the real path in early error
messages. nfs path handling and later error messages may still be wrong,
probably only in silly cases where the original path is both a symlink
and a remote path.

PR: 5208


32008 26-Dec-1997 imp

style(9) corrections
Submitted by: bde


31959 24-Dec-1997 imp

Be extra paranoid about trusting the length of the data returned by
gethostbyaddr.
Submitted by: Julian Assange


28458 20-Aug-1997 steve

Fix a typo and while here cleanup the use of the .Nm macro.

PR: docs/4339
Submitted by: Matthew Hunt <mph@pobox.com>


26742 19-Jun-1997 charnier

Sync usage string according to man page.


26683 16-Jun-1997 bde

Merge from Lite2.
- use new getvfsbyname() interface.
- new -A option, like -a except only mounted file systems are unmounted.

All non-cosmetic FreeBSD changes in umount.c, except ignoring of
realpath() failures, went away because they are done better in Lite2.
realpath() failures must be ignored so that non-pathnames like
"<above>:/foo" and "host:/bar" get as far as mount(2).

Reviewed by: dfr


25852 16-May-1997 dfr

Generalise the previous change so that only NFS hostnames are looked up.

PR: bin/3588
Suggested by: Joerg Wunsch <joerg_wunsch@uriah.heep.sax.de>


25277 29-Apr-1997 dfr

Don't try to look up unionfs' <above>, <below> keywords as hostnames.


24359 29-Mar-1997 imp

compare return value from getopt against -1 rather than EOF, per the final
posix standard on the topic.


8871 30-May-1995 rgrimes

Remove trailing whitespace.


7744 10-Apr-1995 wollman

Fix initialization error that caused `mount -vat' to behave unexpectedly
in certain circumstances. Fixes PR #182.

Submitted by: Andrew Atrens <atreand@statcan.ca>


4142 04-Nov-1994 dg

From njw@cs.city.ac.uk (Nick Williams):

/sbin/umount does not return the correct exit status due to incorrect
logic in its internals.

Further, because of the nature of the code, you *cannot* use it to
umount a directory from a union mountpoint. Well, you can sometimes,
it depends on if the directory is at the top of the union stack or not :)

Submitted by: njw@cs.city.ac.uk (Nick Williams)


1923 08-Aug-1994 wollman

Delete obsolete references to librpc.a.


1855 05-Aug-1994 wollman

Convert to our man installation style. Also fixed long-standing bug
in `fastboot'/`fasthalt' in which the interpreter would hang around
after `reboot' or `halt' is run, causing an irritating ``Killed'' message.


1559 26-May-1994 rgrimes

This commit was generated by cvs2svn to compensate for changes in r1558,
which included commits to RCS files with non-trunk default branches.