From owner-freebsd-geom@FreeBSD.ORG Tue Aug 1 04:26:53 2006 Return-Path: X-Original-To: freebsd-geom@freebsd.org Delivered-To: freebsd-geom@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id EFCB316A4E5 for ; Tue, 1 Aug 2006 04:26:53 +0000 (UTC) (envelope-from anderson@centtech.com) Received: from mh2.centtech.com (moat3.centtech.com [207.200.51.50]) by mx1.FreeBSD.org (Postfix) with ESMTP id A04ED43D49 for ; Tue, 1 Aug 2006 04:26:53 +0000 (GMT) (envelope-from anderson@centtech.com) Received: from [192.168.42.24] (andersonbox4.centtech.com [192.168.42.24]) by mh2.centtech.com (8.13.1/8.13.1) with ESMTP id k714QqJM012634 for ; Mon, 31 Jul 2006 23:26:52 -0500 (CDT) (envelope-from anderson@centtech.com) Message-ID: <44CED817.1080905@centtech.com> Date: Mon, 31 Jul 2006 23:27:03 -0500 From: Eric Anderson User-Agent: Thunderbird 1.5.0.4 (X11/20060612) MIME-Version: 1.0 To: freebsd-geom@freebsd.org Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.87.1/1628/Mon Jul 31 16:56:57 2006 on mh2.centtech.com X-Virus-Status: Clean Subject: locking questions (regarding file systems) X-BeenThere: freebsd-geom@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: GEOM-specific discussions and implementations List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 01 Aug 2006 04:26:54 -0000 Hi GEOMers, I'm writing a file system (read-only), and I need to do some GEOM related locking. I can mount/unmount the filesystem on a vnode backed md disk, but I can't re-mount on that device nor can I get rid (mdconfig -d) of it. It appears to be wedged in some kind of locking. 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); Any help would be greatly appreciated! Eric -- ------------------------------------------------------------------------ Eric Anderson Sr. Systems Administrator Centaur Technology Anything that works is better than anything that doesn't. ------------------------------------------------------------------------