From tim@robbins.dropbear.id.au  Fri May 30 20:31:37 2003
Return-Path: <tim@robbins.dropbear.id.au>
Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125])
	by hub.freebsd.org (Postfix) with ESMTP id EF76637B401
	for <FreeBSD-gnats-submit@freebsd.org>; Fri, 30 May 2003 20:31:37 -0700 (PDT)
Received: from smtp01.syd.iprimus.net.au (smtp01.syd.iprimus.net.au [210.50.30.52])
	by mx1.FreeBSD.org (Postfix) with ESMTP id 2AC5243FCB
	for <FreeBSD-gnats-submit@freebsd.org>; Fri, 30 May 2003 20:31:37 -0700 (PDT)
	(envelope-from tim@robbins.dropbear.id.au)
Received: from dilbert.robbins.dropbear.id.au (210.50.219.83) by smtp01.syd.iprimus.net.au (7.0.015)
        id 3ECDA44500172836 for FreeBSD-gnats-submit@freebsd.org; Sat, 31 May 2003 13:31:35 +1000
Received: by dilbert.robbins.dropbear.id.au (Postfix, from userid 1000)
	id 147BCB4CD; Sat, 31 May 2003 13:30:57 +1000 (EST)
Message-Id: <20030531033057.147BCB4CD@dilbert.robbins.dropbear.id.au>
Date: Sat, 31 May 2003 13:30:57 +1000 (EST)
From: Tim Robbins <tim@robbins.dropbear.id.au>
Reply-To: Tim Robbins <tim@robbins.dropbear.id.au>
To: FreeBSD-gnats-submit@freebsd.org
Cc:
Subject: vm_fault() calls vput() on shared-locked vnode
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         52818
>Category:       kern
>Synopsis:       vm_fault() calls vput() on shared-locked vnode
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    alc
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Fri May 30 20:40:13 PDT 2003
>Closed-Date:    Fri Nov 16 06:00:05 UTC 2007
>Last-Modified:  Fri Nov 16 06:00:05 UTC 2007
>Originator:     Tim Robbins
>Release:        FreeBSD 4.8-RELEASE i386
>Organization:
The FreeBSD Project
>Environment:
FreeBSD 4.8-RELEASE i386
FreeBSD 5.1-BETA i386
>Description:

vm_fault() calls vput() on a vnode that has been locked with the LK_SHARED
flag:

        fs.vp = vnode_pager_lock(fs.first_object);
	...
                if (fs.vp != NULL) {
                        vput(fs.vp);
                        fs.vp = NULL;
                }

This is bad because it means that VOP_INACTIVE is called while holding
a shared lock, instead of an exclusive lock.

This may be related to kern/52412.

>How-To-Repeat:

N/A

>Fix:

Perhaps we could drop the shared lock then call vrele() instead.
>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-bugs->alc 
Responsible-Changed-By: kmacy 
Responsible-Changed-When: Fri Nov 16 04:40:27 UTC 2007 
Responsible-Changed-Why:  

I believe that this has long since been fixed. Looking to alc 
to confirm. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=52818 
State-Changed-From-To: open->closed 
State-Changed-By: alc 
State-Changed-When: Fri Nov 16 05:47:32 UTC 2007 
State-Changed-Why:  
This has been fixed since the RELENG_6 branch point.  Specifically, 
vput() upgrades the lock to exclusive status if VOP_INACTIVE() will 
be invoked. 

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