NetBSD Problem Report #427

From gnats  Sun Aug 21 00:24:37 1994
Received: from excalibur.entropic.com (root@excalibur.entropic.com [192.86.164.105]) by sun-lamp.cs.berkeley.edu (8.6.9/8.6.9) with ESMTP id AAA02294 for <gnats-bugs@sun-lamp.cs.berkeley.edu>; Sun, 21 Aug 1994 00:24:24 -0700
Message-Id: <199408210725.DAA01618@excalibur.entropic.com>
Date: Sun, 21 Aug 1994 03:25:22 -0400
From: Ken Hornstein <kenh@excalibur.entropic.com>
Reply-To: kenh@wrl.epi.com
To: gnats-bugs@sun-lamp.cs.berkeley.edu
Subject: System hangs during shutdown if a NQNFS mounted filesystem is busy
X-Send-Pr-Version: 3.2

>Number:         427
>Category:       kern
>Synopsis:       System hangs during shutdown if a NQNFS mounted filesystem is busy
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    gnats-admin
>State:          closed
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sun Aug 21 00:35:03 +0000 1994
>Closed-Date:    Tue Sep 03 01:44:12 +0000 1996
>Last-Modified:  Tue Sep 03 01:49:07 +0000 1996
>Originator:     Ken Hornstein
>Release:        
>Organization:
Entropic Research Lab
"	"
>Environment:

System: NetBSD excalibur 1.0_BETA NetBSD 1.0_BETA (EXCALIBUR) #16: Thu Aug 11 01:27:41 EDT 1994 kenh@excalibur:/usr/src/sys/arch/i386/compile/EXCALIBUR i386


>Description:
Normally if you kill an NQNFS helper daemon, the filesystem associated with
that daemon is unmounted.  If the filesystem busy however, then the system
hangs.  It looks like the nqnfs_clientd() function is looping.  While normally
I'd classify this as a feature, it makes life awfully difficult when it comes
time to shutdown your machine gracefully.
>How-To-Repeat:
Mount a filesystem using NQNFS.  cd into it.  Either shutdown or kill off
the NQNFS daemon.

>Fix:
While this is almost certainly the wrong thing to do, the following patch fixes
the problem for shutdown, at least.

--- nfs/nfs_nqlease.c.old	Sun Aug 21 02:30:53 1994
+++ nfs/nfs_nqlease.c	Sun Aug 21 03:07:54 1994
@@ -1064,7 +1064,17 @@
 		    error = tsleep((caddr_t)&nmp->nm_authstr, PSOCK | PCATCH,
 			"nqnfstimr", hz / 3);
 		    if (error == EINTR || error == ERESTART)
-			(void) dounmount(nmp->nm_mountp, 0, p);
+			/*
+			 * If dounmount fails because a filesystem is busy,
+			 * wait 10 seconds, try to unmount again, then force
+			 * an unmount.
+			 */
+			if (dounmount(nmp->nm_mountp, 0, p) == EBUSY) {
+			   tsleep((caddr_t)&nmp->nm_mountp, PSOCK,
+				 "nqnnfsumnt", hz * 10);
+			   if (dounmount(nmp->nm_mountp, 0, p) == EBUSY)
+			      dounmount(nmp->nm_mountp, MNT_FORCE, p);
+			}
 	    }
 	}
 	free((caddr_t)nmp, M_NFSMNT);
>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->closed 
State-Changed-By: mycroft 
State-Changed-When: Mon Sep 2 21:44:12 EDT 1996 
State-Changed-Why:  
Fixed on 1994/12/13, by always using MNT_FORCE when shutting down. 
>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.39 2013/11/01 18:47:49 spz Exp $
$NetBSD: gnats_config.sh,v 1.8 2006/05/07 09:23:38 tsutsui Exp $
Copyright © 1994-2007 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.