diff options
author | rmacklem <rmacklem@FreeBSD.org> | 2011-05-29 21:13:53 +0000 |
---|---|---|
committer | rmacklem <rmacklem@FreeBSD.org> | 2011-05-29 21:13:53 +0000 |
commit | 7c714099c7a70ba36bc634e3f0d0dfa0227f4ebe (patch) | |
tree | cf338a51fbac087d012ae952518a8f4abf9b3ce8 /sbin | |
parent | 2c33480efee405ba67f6c56ca42ef7773445f470 (diff) | |
download | FreeBSD-src-7c714099c7a70ba36bc634e3f0d0dfa0227f4ebe.zip FreeBSD-src-7c714099c7a70ba36bc634e3f0d0dfa0227f4ebe.tar.gz |
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
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 911666f..9b75449 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(); |