From nobody@FreeBSD.org  Fri May 27 08:06:04 2011
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 0EBDB106566C
	for <freebsd-gnats-submit@FreeBSD.org>; Fri, 27 May 2011 08:06:04 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from red.freebsd.org (red.freebsd.org [IPv6:2001:4f8:fff6::22])
	by mx1.freebsd.org (Postfix) with ESMTP id F37718FC17
	for <freebsd-gnats-submit@FreeBSD.org>; Fri, 27 May 2011 08:06:03 +0000 (UTC)
Received: from red.freebsd.org (localhost [127.0.0.1])
	by red.freebsd.org (8.14.4/8.14.4) with ESMTP id p4R863qn022345
	for <freebsd-gnats-submit@FreeBSD.org>; Fri, 27 May 2011 08:06:03 GMT
	(envelope-from nobody@red.freebsd.org)
Received: (from nobody@localhost)
	by red.freebsd.org (8.14.4/8.14.4/Submit) id p4R863WE022344;
	Fri, 27 May 2011 08:06:03 GMT
	(envelope-from nobody)
Message-Id: <201105270806.p4R863WE022344@red.freebsd.org>
Date: Fri, 27 May 2011 08:06:03 GMT
From: "Eugene M. Zheganin" <eugene@zhegan.in>
To: freebsd-gnats-submit@FreeBSD.org
Subject: [nfs] cannot umount an nfs from dead server
X-Send-Pr-Version: www-3.1
X-GNATS-Notify:

>Number:         157365
>Category:       kern
>Synopsis:       [nfs] cannot umount an nfs from dead server
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-fs
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Fri May 27 08:10:09 UTC 2011
>Closed-Date:    Fri Jun 17 18:28:13 UTC 2011
>Last-Modified:  Fri Jun 17 18:28:13 UTC 2011
>Originator:     Eugene M. Zheganin
>Release:        8.2-RELEASE
>Organization:
Norma LLC.
>Environment:
FreeBSD omega.norman-neva.spb.ru 8.2-RELEASE FreeBSD 8.2-RELEASE #2: Fri Apr 22 10:40:22 MSD 2011     emz@omega.norman-neva.spb.ru:/usr/obj/usr/src/sys/SPB-HA  amd64
>Description:
cannot umount an nfs from dead server.

umount hangs indefinitely. so does umount -f.
>How-To-Repeat:
Mount an FNS resource, disconnect the server from the network, try to
umount resource.
>Fix:
Bring the server back from the dead or simply go back in time. Or reboot.
Sometimes going back in time is more likely since reboot is not even
possible.

>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-bugs->freebsd-fs 
Responsible-Changed-By: linimon 
Responsible-Changed-When: Fri May 27 14:05:12 UTC 2011 
Responsible-Changed-Why:  
Over to maintainer(s). 

http://www.freebsd.org/cgi/query-pr.cgi?pr=157365 

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 20:55:36 +0000 (UTC)

 Author: rmacklem
 Date: Sun May 29 20:55:23 2011
 New Revision: 222464
 URL: http://svn.freebsd.org/changeset/base/222464
 
 Log:
   Add a check for MNTK_UNMOUNTF at the beginning of nfs_sync()
   in the old NFS client so that a forced dismount doesn't
   get stuck in the VFS_SYNC() call that happens before
   VFS_UNMOUNT() in dounmount(). Analagous to r222329 for the new NFS client.
   An additional change is needed before forced dismounts will work.
   
   PR:		kern/157365
   MFC after:	2 weeks
 
 Modified:
   head/sys/nfsclient/nfs_vfsops.c
 
 Modified: head/sys/nfsclient/nfs_vfsops.c
 ==============================================================================
 --- head/sys/nfsclient/nfs_vfsops.c	Sun May 29 20:46:53 2011	(r222463)
 +++ head/sys/nfsclient/nfs_vfsops.c	Sun May 29 20:55:23 2011	(r222464)
 @@ -1408,10 +1408,20 @@ nfs_sync(struct mount *mp, int waitfor)
  
  	td = curthread;
  
 +	MNT_ILOCK(mp);
 +	/*
 +	 * If a forced dismount is in progress, return from here so that
 +	 * the umount(2) syscall doesn't get stuck in VFS_SYNC() before
 +	 * calling VFS_UNMOUNT().
 +	 */
 +	if ((mp->mnt_kern_flag & MNTK_UNMOUNTF) != 0) {
 +		MNT_IUNLOCK(mp);
 +		return (EBADF);
 +	}
 +
  	/*
  	 * Force stale buffer cache information to be flushed.
  	 */
 -	MNT_ILOCK(mp);
  loop:
  	MNT_VNODE_FOREACH(vp, mp, mvp) {
  		VI_LOCK(vp);
 _______________________________________________
 svn-src-all@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/svn-src-all
 To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org"
 

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();
  
 _______________________________________________
 svn-src-all@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/svn-src-all
 To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org"
 
State-Changed-From-To: open->feedback 
State-Changed-By: rmacklem 
State-Changed-When: Sun May 29 21:23:22 UTC 2011 
State-Changed-Why:  

The commits r222464, r222466 should fix the old/regular NFS 
client w.r.t. doinf forced dismounts against a dead server. 
They will be MFC'd to stable/8 in 2 weeks. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=157365 
State-Changed-From-To: feedback->closed 
State-Changed-By: rmacklem 
State-Changed-When: Fri Jun 17 18:27:01 UTC 2011 
State-Changed-Why:  

The changes that allow a "umount -f" to work on an 
NFS mount point against an unresponsive NFS server are 
now in stable/8. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=157365 
>Unformatted:
