From owner-freebsd-fs@FreeBSD.ORG Wed Aug 2 19:54:49 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 8BAF316A4DF for ; Wed, 2 Aug 2006 19:54:49 +0000 (UTC) (envelope-from adamsch1@yahoo.com) Received: from web31808.mail.mud.yahoo.com (web31808.mail.mud.yahoo.com [68.142.207.71]) by mx1.FreeBSD.org (Postfix) with SMTP id DCD9143D45 for ; Wed, 2 Aug 2006 19:54:48 +0000 (GMT) (envelope-from adamsch1@yahoo.com) Received: (qmail 52413 invoked by uid 60001); 2 Aug 2006 19:54:48 -0000 DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; h=Message-ID:Received:Date:From:Reply-To:Subject:To:Cc:In-Reply-To:MIME-Version:Content-Type; b=yIQ9m4ah5w3pr+IW8ANJl7HZ+K1WW/NyaC/WXb6Ugz9KQHPjl892sn9c1l2mI3lj/SmqpKuMSlS7tN4A/A017OmAVaZC1oh8+np8VdmclNWQbkWcoMC7qUvyRtsCXB6QfdYHol0WZMMBAsWZUC21So8kMn9hK6Qz1GBpHnINsMI= ; Message-ID: <20060802195448.52411.qmail@web31808.mail.mud.yahoo.com> Received: from [207.126.230.225] by web31808.mail.mud.yahoo.com via HTTP; Wed, 02 Aug 2006 12:54:48 PDT Date: Wed, 2 Aug 2006 12:54:48 -0700 (PDT) From: Shane Adams To: Eric Anderson , "R. B. Riddick" In-Reply-To: <44D0FF98.3040701@centtech.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii 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 Reply-To: Shane Adams List-Id: Filesystems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 02 Aug 2006 19:54:49 -0000 I just look around in the sources for other filesystems for similar patterns and try to infer whats going on. Thats how (in my case) I figured out how to create a file on the filesystem from within the kernel. Shane ----- Original Message ---- From: Eric Anderson To: R. B. Riddick Cc: freebsd-fs@freebsd.org Sent: Wednesday, August 2, 2006 12:40:08 PM Subject: Re: locking questions (regarding file systems) On 08/02/06 14:34, R. B. Riddick wrote: > --- Eric Anderson wrote: >> Here's basically what I do: >> in the mount function for the FS, I do something like this: >> >> DROP_GIANT(); >> g_topology_lock(); >> error = g_vfs_open(devvp, &cp, "fsname", 0); >> g_topology_unlock(); >> PICKUP_GIANT(); >> >> What is needed in my unmount function to release those locks? I've >> tried some combinations of things, like: >> >> DROP_GIANT(); >> g_topology_lock(); >> # wedges here >> g_vfs_close(cp, td); >> g_topology_unlock(); >> PICKUP_GIANT(); >> vrele(devvp); >> > > So the first un-mount works fine? > And the second un-mount wedges _before_ g_vfs_close? I never get to a second unmount, because I can't mount or mdconfig -d the device after the first mount. > I cannot find anything really suspicious in ur code... > > Just 2 thoughts: > > 1. Do we really hold GIANT, when we mount and un-mount something? I don't know - how can I check? > 2. R u sure, that we need vrele()? I mean: Why doesn't g_vfs_close() call > vrele(), if g_vfs_open() increases that use-count variable? Can u print the > use-count variable in the beginning and the end of the mount/un-mount > functions? Good idea - I'll look into that.. Thanks!! Eric -- ------------------------------------------------------------------------ Eric Anderson Sr. Systems Administrator Centaur Technology Anything that works is better than anything that doesn't. ------------------------------------------------------------------------ _______________________________________________ freebsd-fs@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-fs To unsubscribe, send any mail to "freebsd-fs-unsubscribe@freebsd.org"