From owner-cvs-all@FreeBSD.ORG Sun Oct 9 20:00:18 2005 Return-Path: X-Original-To: cvs-all@FreeBSD.org 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 E1BEC16A41F; Sun, 9 Oct 2005 20:00:17 +0000 (GMT) (envelope-from tegge@FreeBSD.org) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 9098143D48; Sun, 9 Oct 2005 20:00:17 +0000 (GMT) (envelope-from tegge@FreeBSD.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.1/8.13.1) with ESMTP id j99K0H22026812; Sun, 9 Oct 2005 20:00:17 GMT (envelope-from tegge@repoman.freebsd.org) Received: (from tegge@localhost) by repoman.freebsd.org (8.13.1/8.13.1/Submit) id j99K0HVK026811; Sun, 9 Oct 2005 20:00:17 GMT (envelope-from tegge) Message-Id: <200510092000.j99K0HVK026811@repoman.freebsd.org> From: Tor Egge Date: Sun, 9 Oct 2005 20:00:17 +0000 (UTC) To: src-committers@FreeBSD.org, cvs-src@FreeBSD.org, cvs-all@FreeBSD.org X-FreeBSD-CVS-Branch: HEAD Cc: Subject: cvs commit: src/sys/ufs/ffs ffs_snapshot.c X-BeenThere: cvs-all@freebsd.org X-Mailman-Version: 2.1.5 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: Sun, 09 Oct 2005 20:00:18 -0000 tegge 2005-10-09 20:00:17 UTC FreeBSD src repository Modified files: sys/ufs/ffs ffs_snapshot.c Log: Eliminate a deadlock that can occur during the cgaccount() processing due to the cg map buffer being held when writing indirect blocks. The process ends up in ffs_copyonwrite(), attempting to get snaplk while holding the cg map buffer lock. Another process might be in ffs_copyonwrite(), trying to allocate a new block for a copy. It would hold snaplk while trying to get the cg map buffer lock. Release the cg map buffer early and use the copy for most of the cgaccount processing to avoid this deadlock. Revision Changes Path 1.108 +2 -3 src/sys/ufs/ffs/ffs_snapshot.c