]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
Fix a deadlock between vm_fault() and vm_mmap(): The expected lock ordering
authoralc <alc@FreeBSD.org>
Sat, 6 Dec 2003 05:45:32 +0000 (05:45 +0000)
committeralc <alc@FreeBSD.org>
Sat, 6 Dec 2003 05:45:32 +0000 (05:45 +0000)
commit3b8e185f65b43a35fd03a8c1e33517c56dafd196
tree560c9b455e9d0e51f3d5cfe4b3698382da778053
parentb7377409b878fdfc3f6ec9283862d597e7a898a0
Fix a deadlock between vm_fault() and vm_mmap(): The expected lock ordering
between vm_map and vnode locks is that vm_map locks are acquired first.  In
revision 1.150 mmap(2) was changed to pass a locked vnode into vm_mmap().
This creates a lock-order reversal when vm_mmap() calls one of the vm_map
routines that acquires a vm_map lock.  The solution implemented herein is
to release the vnode lock in mmap() before calling vm_mmap() and reacquire
this lock if necessary in vm_mmap().

Approved by: re (scottl)
Reviewed by: jeff, kan, rwatson
sys/vm/vm_mmap.c