From owner-freebsd-fs@FreeBSD.ORG Sun May 29 21:44:59 2011 Return-Path: Delivered-To: freebsd-fs@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 06FB3106564A for ; Sun, 29 May 2011 21:44:59 +0000 (UTC) (envelope-from jdc@koitsu.dyndns.org) Received: from qmta07.westchester.pa.mail.comcast.net (qmta07.westchester.pa.mail.comcast.net [76.96.62.64]) by mx1.freebsd.org (Postfix) with ESMTP id A9FFD8FC16 for ; Sun, 29 May 2011 21:44:58 +0000 (UTC) Received: from omta15.westchester.pa.mail.comcast.net ([76.96.62.87]) by qmta07.westchester.pa.mail.comcast.net with comcast id pZh41g0011swQuc57Zkycc; Sun, 29 May 2011 21:44:58 +0000 Received: from koitsu.dyndns.org ([67.180.84.87]) by omta15.westchester.pa.mail.comcast.net with comcast id pZkx1g00A1t3BNj3bZkxTi; Sun, 29 May 2011 21:44:58 +0000 Received: by icarus.home.lan (Postfix, from userid 1000) id A6251102C19; Sun, 29 May 2011 14:44:55 -0700 (PDT) Date: Sun, 29 May 2011 14:44:55 -0700 From: Jeremy Chadwick To: rmacklem@freebsd.org Message-ID: <20110529214455.GA61419@icarus.home.lan> References: <201105292120.p4TLKAB8055239@freefall.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201105292120.p4TLKAB8055239@freefall.freebsd.org> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: freebsd-fs@FreeBSD.org Subject: Re: kern/157365: commit references a PR X-BeenThere: freebsd-fs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Filesystems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 29 May 2011 21:44:59 -0000 On Sun, May 29, 2011 at 09:20:10PM +0000, dfilter service wrote: > The following reply was made to PR kern/157365; it has been noted by GNATS. > > From: dfilter@FreeBSD.ORG (dfilter service) > To: bug-followup@FreeBSD.org > Cc: > Subject: Re: kern/157365: commit references a PR > Date: Sun, 29 May 2011 21:14:07 +0000 (UTC) > > 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(); IMHO: the "60-second" behaviour needs to be documented in umount(8). Administrators who are issuing "umount -f" will (understandably) expect the unmount to happen immediately. If umount(8) blocks for 60 seconds while an unmount of an NFS mount happens, that may be more reasonable, but I imagine most administrators are going to Ctrl-C the umount citing "it wasn't doing anything". Since printing a message during "umount -f" is not ideal (the implications may break system scripts, etc.), the behaviour should really be documented in the man page. -- | Jeremy Chadwick jdc@parodius.com | | Parodius Networking http://www.parodius.com/ | | UNIX Systems Administrator Mountain View, CA, USA | | Making life hard for others since 1977. PGP 4BD6C0CB |