From owner-cvs-all@FreeBSD.ORG Fri Dec 5 21:45:33 2003 Return-Path: Delivered-To: cvs-all@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 6120616A4D4; Fri, 5 Dec 2003 21:45:33 -0800 (PST) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id ACD6543FBD; Fri, 5 Dec 2003 21:45:32 -0800 (PST) (envelope-from alc@FreeBSD.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.12.9/8.12.9) with ESMTP id hB65jWXJ095326; Fri, 5 Dec 2003 21:45:32 -0800 (PST) (envelope-from alc@repoman.freebsd.org) Received: (from alc@localhost) by repoman.freebsd.org (8.12.9/8.12.9/Submit) id hB65jWx4095325; Fri, 5 Dec 2003 21:45:32 -0800 (PST) (envelope-from alc) Message-Id: <200312060545.hB65jWx4095325@repoman.freebsd.org> From: Alan Cox Date: Fri, 5 Dec 2003 21:45:32 -0800 (PST) To: src-committers@FreeBSD.org, cvs-src@FreeBSD.org, cvs-all@FreeBSD.org X-FreeBSD-CVS-Branch: HEAD Subject: cvs commit: src/sys/vm vm_mmap.c X-BeenThere: cvs-all@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: CVS commit messages for the entire tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 06 Dec 2003 05:45:33 -0000 alc 2003/12/05 21:45:32 PST FreeBSD src repository Modified files: sys/vm vm_mmap.c Log: 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 Revision Changes Path 1.174 +13 -4 src/sys/vm/vm_mmap.c