From owner-svn-src-head@FreeBSD.ORG Sun May 29 21:13:53 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C4F86106566B; Sun, 29 May 2011 21:13:53 +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 B58B78FC16; Sun, 29 May 2011 21:13:53 +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 p4TLDrrH046888; Sun, 29 May 2011 21:13:53 GMT (envelope-from rmacklem@svn.freebsd.org) Received: (from rmacklem@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p4TLDrA3046886; Sun, 29 May 2011 21:13:53 GMT (envelope-from rmacklem@svn.freebsd.org) Message-Id: <201105292113.p4TLDrA3046886@svn.freebsd.org> From: Rick Macklem Date: Sun, 29 May 2011 21:13:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r222466 - head/sbin/umount X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 29 May 2011 21:13:53 -0000 Author: rmacklem Date: Sun May 29 21:13:53 2011 New Revision: 222466 URL: http://svn.freebsd.org/changeset/base/222466 Log: 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 Modified: head/sbin/umount/umount.c Modified: head/sbin/umount/umount.c ============================================================================== --- head/sbin/umount/umount.c Sun May 29 21:03:40 2011 (r222465) +++ head/sbin/umount/umount.c Sun May 29 21:13:53 2011 (r222466) @@ -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();