Bug 52818

Summary: vm_fault() calls vput() on shared-locked vnode
Product: Base System Reporter: Tim J. Robbins <tim>
Component: kernAssignee: Alan Cox <alc>
Status: Closed FIXED    
Severity: Affects Only Me    
Priority: Normal    
Version: 4.8-RELEASE   
Hardware: Any   
OS: Any   

Description Tim J. Robbins 2003-05-31 04:40:13 UTC
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.

Fix: 

Perhaps we could drop the shared lock then call vrele() instead.
How-To-Repeat: 
N/A
Comment 1 K. Macy freebsd_committer freebsd_triage 2007-11-16 04:40:27 UTC
Responsible Changed
From-To: freebsd-bugs->alc


I believe that this has long since been fixed. Looking to alc 
to confirm.
Comment 2 Alan Cox freebsd_committer freebsd_triage 2007-11-16 05:47:32 UTC
State Changed
From-To: open->closed

This has been fixed since the RELENG_6 branch point.  Specifically, 
vput() upgrades the lock to exclusive status if VOP_INACTIVE() will 
be invoked.