diff options
author | Rick Macklem <rmacklem@FreeBSD.org> | 2011-05-29 21:13:53 +0000 |
---|---|---|
committer | Rick Macklem <rmacklem@FreeBSD.org> | 2011-05-29 21:13:53 +0000 |
commit | b37ce15446f9d79222d8f0ab9957f482b0e96b6a (patch) | |
tree | cf338a51fbac087d012ae952518a8f4abf9b3ce8 /sbin | |
parent | 15ede7603127899e832145440fbec63660a918b4 (diff) | |
download | src-b37ce15446f9d79222d8f0ab9957f482b0e96b6a.tar.gz src-b37ce15446f9d79222d8f0ab9957f482b0e96b6a.zip |
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
Notes
Notes:
svn path=/head/; revision=222466
Diffstat (limited to 'sbin')
-rw-r--r-- | sbin/umount/umount.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/sbin/umount/umount.c b/sbin/umount/umount.c index 911666f16a43..9b7544962bad 100644 --- a/sbin/umount/umount.c +++ b/sbin/umount/umount.c @@ -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(); |