From owner-freebsd-fs@FreeBSD.ORG Thu Aug 3 19:51:20 2006 Return-Path: X-Original-To: freebsd-fs@freebsd.org Delivered-To: freebsd-fs@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 8330D16A4DD for ; Thu, 3 Aug 2006 19:51:20 +0000 (UTC) (envelope-from anderson@centtech.com) Received: from mh1.centtech.com (moat3.centtech.com [207.200.51.50]) by mx1.FreeBSD.org (Postfix) with ESMTP id DAB5043D6A for ; Thu, 3 Aug 2006 19:51:19 +0000 (GMT) (envelope-from anderson@centtech.com) Received: from [10.177.171.220] (neutrino.centtech.com [10.177.171.220]) by mh1.centtech.com (8.13.1/8.13.1) with ESMTP id k73JpHfi036879; Thu, 3 Aug 2006 14:51:18 -0500 (CDT) (envelope-from anderson@centtech.com) Message-ID: <44D253C7.6030108@centtech.com> Date: Thu, 03 Aug 2006 14:51:35 -0500 From: Eric Anderson User-Agent: Thunderbird 1.5.0.5 (X11/20060802) MIME-Version: 1.0 To: "R. B. Riddick" References: <20060803193633.91249.qmail@web30308.mail.mud.yahoo.com> In-Reply-To: <20060803193633.91249.qmail@web30308.mail.mud.yahoo.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.87.1/1634/Wed Aug 2 17:32:49 2006 on mh1.centtech.com X-Virus-Status: Clean Cc: freebsd-fs@freebsd.org Subject: Re: locking questions (regarding file systems) X-BeenThere: freebsd-fs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Filesystems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 03 Aug 2006 19:51:20 -0000 On 08/03/06 14:36, R. B. Riddick wrote: > --- Eric Anderson wrote: >> On 08/03/06 01:14, R. B. Riddick wrote: >>> --- Eric Anderson wrote: >>>> # here use_count is 1 >>>> error = vflush(mp, 1, flags, td); >>>> if (error) >>>> return (error); >>>> >>>> DROP_GIANT(); >>>> g_topology_lock(); >>>> # this is where the use_count is now zero, and it blocks >>>> g_vfs_close(cp, td); >>>> g_topology_unlock(); >>>> PICKUP_GIANT(); >>>> vrele(devvp); >>>> >>>> Is it blocking because the use_count is already 0? Is the vflush >>>> breaking things? >>>> >>> >From the man page of vflush() I would guess, that u call it too early or >>> unnecessarily... >>> >>> My feeling says: Open & Close it... ;-) >>> >>> Hmm... Did u try to run without vflush() and vrele()? :-) >> I've tried getting rid of the vrele and vflush, and that doesn't help. >> > Hmm... So the g_vfs_close() always deadlocks with and without vflush()? > That is strange... I mean: When I open a regular file, I can close it... Correct.. > Did u try to call g_vfs_close() immediately after the g_vfs_open()? I just did, and looks like the g_vfs_close directly after the g_vfs_open block (I copy-pasted) works ok. When unmounting, it then panics on g_vfs_close, probably because it's already closed from before. >> Any other ideas? I have to be missing something very simple here.. >> > Yes. Most likely it is something simple and orthogonal, because: Humans often > have similar ideas of "simple"... ;-) > > -Arne > > > __________________________________________________ > Do You Yahoo!? > Tired of spam? Yahoo! Mail has the best spam protection around > http://mail.yahoo.com -- ------------------------------------------------------------------------ Eric Anderson Sr. Systems Administrator Centaur Technology Anything that works is better than anything that doesn't. ------------------------------------------------------------------------