From owner-freebsd-hackers@FreeBSD.ORG Thu Jun 30 03:26:59 2005 Return-Path: X-Original-To: freebsd-hackers@freebsd.org Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 9C02E16A41C for ; Thu, 30 Jun 2005 03:26:59 +0000 (GMT) (envelope-from ncb@cs.wisc.edu) Received: from delicious.cs.wisc.edu (delicious.cs.wisc.edu [128.105.167.24]) by mx1.FreeBSD.org (Postfix) with ESMTP id 54DE143D58 for ; Thu, 30 Jun 2005 03:26:59 +0000 (GMT) (envelope-from ncb@cs.wisc.edu) Received: from delicious.cs.wisc.edu (localhost [127.0.0.1]) by delicious.cs.wisc.edu (8.13.1/8.13.1) with ESMTP id j5U3Qw8A007237 for ; Wed, 29 Jun 2005 22:26:58 -0500 Received: from localhost (ncb@localhost) by delicious.cs.wisc.edu (8.13.1/8.13.1/Submit) with ESMTP id j5U3QwTl007234 for ; Wed, 29 Jun 2005 22:26:58 -0500 X-Authentication-Warning: delicious.cs.wisc.edu: ncb owned process doing -bs Date: Wed, 29 Jun 2005 22:26:58 -0500 (CDT) From: "Nathan C. Burnett" To: freebsd-hackers@freebsd.org Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Subject: buffer locking X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Jun 2005 03:26:59 -0000 I'm working in FreeBSD 5.3-RELEASE. In various places in the buffer management code (e.g. ibwrite()) the buffer lock reference count is checked (see below), presumably to make sure the buffer is safely locked before working with it. Is there a reason that it's not neccesary to ensure that the current thread is the lockholder? This seems like it could lead to a race condition where, say ibwrite, is content because SOMEONE has the buffer locked, even if it's not the current thread. Thanks, -Nate