From owner-freebsd-hackers@FreeBSD.ORG Wed Apr 27 04:58:19 2011 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7162A1065670 for ; Wed, 27 Apr 2011 04:58:19 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from harmony.bsdimp.com (bsdimp.com [199.45.160.85]) by mx1.freebsd.org (Postfix) with ESMTP id 2E76B8FC16 for ; Wed, 27 Apr 2011 04:58:19 +0000 (UTC) Received: from [10.0.0.63] (63.imp.bsdimp.com [10.0.0.63]) (authenticated bits=0) by harmony.bsdimp.com (8.14.4/8.14.3) with ESMTP id p3R4qbmr041966 (version=TLSv1/SSLv3 cipher=DHE-DSS-AES128-SHA bits=128 verify=NO); Tue, 26 Apr 2011 22:52:38 -0600 (MDT) (envelope-from imp@bsdimp.com) Mime-Version: 1.0 (Apple Message framework v1084) Content-Type: text/plain; charset=us-ascii From: Warner Losh In-Reply-To: <4DB76085.4000402@chillt.de> Date: Tue, 26 Apr 2011 22:52:37 -0600 Content-Transfer-Encoding: quoted-printable Message-Id: <52F5A9FB-8771-4002-B6C0-563679CCB355@bsdimp.com> References: <4DB695DB.1080505@chillt.de> <201104261217.23858.hselasky@c2i.net> <4DB6BCC6.5050001@chillt.de> <20110426124403.GQ48734@deviant.kiev.zoral.com.ua> <4DB76085.4000402@chillt.de> To: Bartosz Fabianowski X-Mailer: Apple Mail (2.1084) X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.0.1 (harmony.bsdimp.com [10.0.0.6]); Tue, 26 Apr 2011 22:52:39 -0600 (MDT) Cc: Kostik Belousov , freebsd-hackers@freebsd.org, Hans Petter Selasky Subject: Re: Is there some implicit locking of device methods? 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: Wed, 27 Apr 2011 04:58:19 -0000 On Apr 26, 2011, at 6:17 PM, Bartosz Fabianowski wrote: >> If you needs per-file private data for cdev, you would be better = served >> by cdevpriv(9) KPI. Cloning is too hard to use correctly for such = task. >=20 > Thanks, I just got that working. To help those going down a similar = path in the future, I would like to note quickly that the following must = be added to the cdevsw structure to ensure proper clean-up: >=20 > .d_flags =3D D_TRACKCLOSE >=20 > I just spent hours debugging panics until I realized only the last = close() was triggering a call to my .d_close method. Traditional BSD behavior... Warner