From owner-freebsd-geom@FreeBSD.ORG Wed Nov 15 14:05:15 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 9FAA916A407 for ; Wed, 15 Nov 2006 14:05:15 +0000 (UTC) (envelope-from anderson@centtech.com) Received: from mh1.centtech.com (moat3.centtech.com [64.129.166.50]) by mx1.FreeBSD.org (Postfix) with ESMTP id B79BA43E15 for ; Wed, 15 Nov 2006 14:03:32 +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.8/8.13.8) with ESMTP id kAFE3US6016211; Wed, 15 Nov 2006 08:03:31 -0600 (CST) (envelope-from anderson@centtech.com) Message-ID: <455B1E37.3000201@centtech.com> Date: Wed, 15 Nov 2006 08:03:35 -0600 From: Eric Anderson User-Agent: Thunderbird 1.5.0.7 (X11/20061015) MIME-Version: 1.0 To: Shane Adams References: <20061114230032.45377.qmail@web31801.mail.mud.yahoo.com> In-Reply-To: <20061114230032.45377.qmail@web31801.mail.mud.yahoo.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.88.4/2195/Tue Nov 14 13:53:04 2006 on mh1.centtech.com X-Virus-Status: Clean X-Spam-Status: No, score=-2.5 required=8.0 tests=AWL,BAYES_00 autolearn=ham version=3.1.6 X-Spam-Checker-Version: SpamAssassin 3.1.6 (2006-10-03) on mh1.centtech.com Cc: freebsd-geom@freebsd.org Subject: Re: g_access questions (Out on a limb here) 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: Wed, 15 Nov 2006 14:05:15 -0000 On 11/14/06 17:00, Shane Adams wrote: > Hello, > > I have a question regarding g_access. I'm mounting a custom filesytem twice against the same device. The first time I'm mounting it with read/write access, I then mount the same device to a different mount point. After I do this, the first mount starts getting write errors, so somehow the second mount is screwing up access rights to the device. For what its worth, I'm mounting a ram backed mdconfig device. > > I'm not sure if this is a geom related issue, or related to the fact that you cannot mount a device more than twice in vfs? > > Anyway - the first time I mount (R/W) I do: > > g_access(cp, 1,1, 0) > > I then mount the device again as read only to a different mount point with > > g_access(cp,1,0,0) > > The code I used is taken from g_vfs_open with wr flag set depending if write access is required: > > pp = g_dev_getprovider(vp->v_rdev); > if (pp == NULL) > return (ENOENT); > gp = g_new_geomf(&g_vfs_class2, "%s.%s", fsname, pp->name); > cp = g_new_consumer(gp); > g_attach(cp, pp); > error = g_access(cp, 1, wr, 0); > if (error) { > g_wither_geom(gp, ENXIO); > return (error); > } Interesting.. I'm mounting a custom file system also, and I'm doing it much differently: [...] struct vnode *devvp; /* vnode of the mount device */ struct g_consumer *cp; [...] DROP_GIANT(); g_topology_lock(); error = g_vfs_open(devvp, &cp, "tarfs", 0); g_topology_unlock(); PICKUP_GIANT(); VOP_UNLOCK(devvp, 0, td); [...] Eric -- ------------------------------------------------------------------------ Eric Anderson Sr. Systems Administrator Centaur Technology Anything that works is better than anything that doesn't. ------------------------------------------------------------------------