svn commit: r223003 - stable/8/sbin/umount

Rick Macklem rmacklem at FreeBSD.org
Sun Jun 12 02:05:59 UTC 2011


Author: rmacklem
Date: Sun Jun 12 02:05:59 2011
New Revision: 223003
URL: http://svn.freebsd.org/changeset/base/223003

Log:
  MFC: r222466
  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.

Modified:
  stable/8/sbin/umount/umount.c
Directory Properties:
  stable/8/sbin/umount/   (props changed)

Modified: stable/8/sbin/umount/umount.c
==============================================================================
--- stable/8/sbin/umount/umount.c	Sun Jun 12 01:48:31 2011	(r223002)
+++ stable/8/sbin/umount/umount.c	Sun Jun 12 02:05:59 2011	(r223003)
@@ -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();
 


More information about the svn-src-stable-8 mailing list