From owner-freebsd-fs@FreeBSD.ORG Wed Aug 2 20:03:42 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 6278616A4DD for ; Wed, 2 Aug 2006 20:03:42 +0000 (UTC) (envelope-from ssedov@mbsd.msk.ru) Received: from com1.ht-systems.ru (com1.ht-systems.ru [83.97.104.204]) by mx1.FreeBSD.org (Postfix) with ESMTP id 9FF0043D53 for ; Wed, 2 Aug 2006 20:03:41 +0000 (GMT) (envelope-from ssedov@mbsd.msk.ru) Received: from [217.118.83.1] (helo=fonon.realnet) by com1.ht-systems.ru with esmtpa (Exim 4.62) (envelope-from ) id 1G8N4C-0002mC-3v for freebsd-fs@freebsd.org; Thu, 03 Aug 2006 00:11:47 +0400 Received: from localhost (localhost [127.0.0.1]) by fonon.realnet (Postfix) with ESMTP id A9857121EA for ; Thu, 3 Aug 2006 00:03:16 +0400 (MSD) Date: Thu, 3 Aug 2006 00:03:16 +0400 From: Stanislav Sedov To: freebsd-fs@freebsd.org Message-ID: <20060803000316.6b371691@localhost> In-Reply-To: <44D0F6E3.7080908@centtech.com> References: <44D0F6E3.7080908@centtech.com> Organization: MBSD labs, Inc. X-Operating-System: FreeBSD X-Mailer: carrier-pigeon Mime-Version: 1.0 Content-Type: multipart/signed; boundary="Sig_SzOaIALrqLZ=.o3vbyqg8Q7"; protocol="application/pgp-signature"; micalg=PGP-SHA1 X-Spam-Flag: SKIP X-Spam-Yversion: Spamooborona 1.6.0 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: Wed, 02 Aug 2006 20:03:42 -0000 --Sig_SzOaIALrqLZ=.o3vbyqg8Q7 Content-Type: text/plain; charset=KOI8-R Content-Transfer-Encoding: quoted-printable On Wed, 02 Aug 2006 14:02:59 -0500 Eric Anderson mentioned: > Hello everyone, > (resend from a post to the -geom list, which I received no replies) >=20 > 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. >=20 > Here's basically what I do: > in the mount function for the FS, I do something like this: >=20 > DROP_GIANT(); > g_topology_lock(); > error =3D g_vfs_open(devvp, &cp, "fsname", 0); > g_topology_unlock(); > PICKUP_GIANT(); >=20 >=20 > What is needed in my unmount function to release those locks? I've > tried some combinations of things, like: >=20 >=20 > DROP_GIANT(); > g_topology_lock(); > # wedges here > g_vfs_close(cp, td); > g_topology_unlock(); > PICKUP_GIANT(); > vrele(devvp); >=20 > How can I debug this and find out what is blocking it? >=20 > Any help would be greatly appreciated! >=20 > Eric >=20 >=20 >=20 It seems that device or geom isn't unlocked. Do you call VOP_UNLOCK(devvp) after g_vfs_open()? You can enable geom locks debugging by manipulation sys.kern.geom.debug values.=20 --=20 Stanislav Sedov MBSD labs, Inc. =F2=CF=D3=D3=C9=D1, =ED=CF=D3=CB=D7=C1 http://mbsd.msk.ru -------------------------------------------------------------------- If the facts don't fit the theory, change the facts. -- A. Einstein -------------------------------------------------------------------- PGP fingerprint: F21E D6CC 5626 9609 6CE2 A385 2BF5 5993 EB26 9581 --Sig_SzOaIALrqLZ=.o3vbyqg8Q7 Content-Type: application/pgp-signature; name=signature.asc Content-Disposition: attachment; filename=signature.asc -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.3 (FreeBSD) iD8DBQFE0QUEK/VZk+smlYERAv6kAJ4vzUb05NFGyTlEEs7JtHh6EnlYjgCfbEfE P/zcNuQqiufsSAnqNcTmGHI= =ks8l -----END PGP SIGNATURE----- --Sig_SzOaIALrqLZ=.o3vbyqg8Q7--