From Tor.Egge@idt.ntnu.no  Tue Oct 15 09:19:49 1996
Received: from pat.idt.unit.no (pat.idt.unit.no [129.241.103.5])
          by freefall.freebsd.org (8.7.5/8.7.3) with ESMTP id JAA16965
          for <FreeBSD-gnats-submit@freebsd.org>; Tue, 15 Oct 1996 09:19:39 -0700 (PDT)
Received: from ikke.idt.unit.no (ikke.idt.unit.no [129.241.111.65]) by pat.idt.unit.no (8.7.5/8.7.3) with ESMTP id SAA06078 for <FreeBSD-gnats-submit@freebsd.org>; Tue, 15 Oct 1996 18:19:16 +0200 (MET DST)
Received: (from tegge@localhost) by ikke.idt.unit.no (8.7.6/8.7.3) id SAA25686; Tue, 15 Oct 1996 18:19:15 +0200 (MET DST)
Message-Id: <199610151619.SAA25686@ikke.idt.unit.no>
Date: Tue, 15 Oct 1996 18:19:15 +0200 (MET DST)
From: Tor Egge <Tor.Egge@idt.ntnu.no>
Reply-To: Tor.Egge@idt.ntnu.no
To: FreeBSD-gnats-submit@freebsd.org
Subject: vnodes are left in a locked state
X-Send-Pr-Version: 3.2

>Number:         1812
>Category:       kern
>Synopsis:       vnodes are left in a locked state
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    dg
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Tue Oct 15 09:20:01 PDT 1996
>Closed-Date:    Mon Aug 23 14:48:42 PDT 1999
>Last-Modified:  Mon Aug 23 14:51:01 PDT 1999
>Originator:     Tor Egge
>Release:        FreeBSD 2.2-CURRENT i386
>Organization:
Norwegian University of Science and Technology, Trondheim, Norway

>Environment:

FreeBSD ikke.idt.unit.no 2.2-CURRENT FreeBSD 2.2-CURRENT #3: Mon Oct 14 02:10:57 MET DST 1996     root@ikke.idt.unit.no:/usr/src/sys/compile/TEGGE  i386

>Description:

	Writing to memory regions corresponding to a few hundred mmapped files 
        and using msync() to flush the file system may cause the process
	to hang.

	The process is unkillable, in diskwait. 

	ps xl outout shows 
  UID   PID  PPID CPU PRI NI   VSZ  RSS WCHAN  STAT  TT       TIME COMMAND
26850 24861 24860  45 -18 19   612 38132 vmiorl DN    ??    2:02.79 bin/domainhelp

	One of the vnodes for the mmapped files is left in a locked state, 
        i.e. lstat() hangs :-(

  UID   PID  PPID CPU PRI NI   VSZ  RSS WCHAN  STAT  TT       TIME COMMAND
26850 25492 25098 145 -14  0   204  592 uihget D+    p9    0:00.03 ls -F -ld h.de (ls@386freebsd)

	As a side effect of this, the vnode for the directory in which 
	the file resides
	(/export/akg2/ftpsearch/datasets/datasets/dataset2/domain) 
	becomes locked. :-(

>How-To-Repeat:
	open and mmap 250 files, each 1.2 MB in size.

	Write to the first 32 KB on each of the 250 mmapped memory regions,
	then use msync() with the MS_ASYNC flag and fsync() for each of the 250
	mmapped memory regions.
	Continue with the next 32 KB, until all of the mmapped regions have
	been written to disk.

>Fix:
	Temporary workaround: reboot the system whenever this occurs.
	

>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-bugs->dyson 
Responsible-Changed-By: pst 
Responsible-Changed-When: Thu Oct 17 10:31:28 PDT 1996 
Responsible-Changed-Why:  
John's area. 
Responsible-Changed-From-To: dyson->dg 
Responsible-Changed-By: wosch 
Responsible-Changed-When: Wed Jun 17 15:10:20 MEST 1998 
Responsible-Changed-Why:  
John Dyson has resigned from the FreeBSD project.

State-Changed-From-To: open->closed
State-Changed-By: tegge
State-Changed-When: Mon Aug 23 14:45:25 1999
State-Changed-Why:
Fixed in sys/kern/vfs_bio.c revision 1.104. 
State-Changed-From-To: open->closed 
State-Changed-By: tegge 
State-Changed-When: Mon Aug 23 14:48:42 PDT 1999 
State-Changed-Why:  
Fixed in sys/kern/vfs_bio.c revision 1.104. 
>Unformatted:
