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
This commit is contained in:
Rick Macklem 2011-05-29 21:13:53 +00:00
parent 15ede76031
commit b37ce15446
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=222466

View File

@ -90,9 +90,6 @@ main(int argc, char *argv[])
struct statfs *mntbuf, *sfs;
struct addrinfo hints;
/* Start disks transferring immediately. */
sync();
all = errs = 0;
while ((ch = getopt(argc, argv, "AaF:fh:t:v")) != -1)
switch (ch) {
@ -127,6 +124,10 @@ main(int argc, char *argv[])
argc -= optind;
argv += optind;
/* Start disks transferring immediately. */
if ((fflag & MNT_FORCE) == 0)
sync();
if ((argc == 0 && !all) || (argc != 0 && all))
usage();