From owner-svn-src-all@FreeBSD.ORG Sun Jun 12 02:05:59 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CFFFC106564A; Sun, 12 Jun 2011 02:05:59 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 86FAF8FC0A; Sun, 12 Jun 2011 02:05:59 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p5C25x9L003480; Sun, 12 Jun 2011 02:05:59 GMT (envelope-from rmacklem@svn.freebsd.org) Received: (from rmacklem@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5C25xoO003478; Sun, 12 Jun 2011 02:05:59 GMT (envelope-from rmacklem@svn.freebsd.org) Message-Id: <201106120205.p5C25xoO003478@svn.freebsd.org> From: Rick Macklem Date: Sun, 12 Jun 2011 02:05:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r223003 - stable/8/sbin/umount X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 12 Jun 2011 02:05:59 -0000 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();