From owner-freebsd-fs@FreeBSD.ORG Thu Aug 3 06:14:32 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 547DC16A4DE for ; Thu, 3 Aug 2006 06:14:32 +0000 (UTC) (envelope-from arne_woerner@yahoo.com) Received: from web30307.mail.mud.yahoo.com (web30307.mail.mud.yahoo.com [68.142.200.100]) by mx1.FreeBSD.org (Postfix) with SMTP id 52FF543D5D for ; Thu, 3 Aug 2006 06:14:30 +0000 (GMT) (envelope-from arne_woerner@yahoo.com) Received: (qmail 33045 invoked by uid 60001); 3 Aug 2006 06:14:29 -0000 DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; h=Message-ID:Received:Date:From:Subject:To:Cc:In-Reply-To:MIME-Version:Content-Type:Content-Transfer-Encoding; b=ZAOxtndBllr1NmmMJnBHzPEtg9FTO3WQZVW6MrkzSwZL9mvcFbPZEjVkBT6XOgSxeYcIIjJPetJa00NK+7jKjWbm2IHSS+wyLIjtklqNg/1sarmMVpbnNOl5PJc6FSd8WlLnWHgJJmx2lFimR6pI1HrmTsTdeWC68X1PlzmjmuA= ; Message-ID: <20060803061429.33043.qmail@web30307.mail.mud.yahoo.com> Received: from [213.54.80.200] by web30307.mail.mud.yahoo.com via HTTP; Wed, 02 Aug 2006 23:14:29 PDT Date: Wed, 2 Aug 2006 23:14:29 -0700 (PDT) From: "R. B. Riddick" To: Eric Anderson In-Reply-To: <44D176AF.8020300@centtech.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit 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 06:14:32 -0000 --- 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... ;-) Or did u read a tutorial, that said u should do vflush() and vrele()? I personally find that both calls should be done in the close() function... > Actually, I misinformed you earlier - I can't actually unmount, because > it hangs during the first unmount. It will only unmount successfully if > I remove the block above (the DROP_GIANT down to PICKUP_GIANT). > Hmm... Did u try to run without vflush() and vrele()? :-) -Arne __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com