From owner-freebsd-geom@FreeBSD.ORG Tue Nov 14 23:00:33 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 6B6F516A492 for ; Tue, 14 Nov 2006 23:00:33 +0000 (UTC) (envelope-from adamsch1@yahoo.com) Received: from web31801.mail.mud.yahoo.com (web31801.mail.mud.yahoo.com [68.142.207.64]) by mx1.FreeBSD.org (Postfix) with SMTP id EFBA043D58 for ; Tue, 14 Nov 2006 23:00:32 +0000 (GMT) (envelope-from adamsch1@yahoo.com) Received: (qmail 45379 invoked by uid 60001); 14 Nov 2006 23:00:32 -0000 DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; h=Message-ID:Received:Date:From:Subject:To:MIME-Version:Content-Type:Content-Transfer-Encoding; b=CSROwfLI9i/4rXzs7b1i+1pHR7jJ7BXsMyNklf5hhCXlsZ7uXYS7YPCnT50mMMSzSbcueQImmv7mtVLfHnDOgIW4zr/XK1NTECM3DNo+9x36iLy6pvehMmuRFn0FJ948sdnZ5du5kWs7U0InSgDEMn6x3iVJ592yy/030fCdzMo= ; Message-ID: <20061114230032.45377.qmail@web31801.mail.mud.yahoo.com> Received: from [207.126.230.225] by web31801.mail.mud.yahoo.com via HTTP; Tue, 14 Nov 2006 15:00:32 PST Date: Tue, 14 Nov 2006 15:00:32 -0800 (PST) From: Shane Adams To: freebsd-geom@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=ascii Content-Transfer-Encoding: quoted-printable X-Mailman-Approved-At: Tue, 14 Nov 2006 23:37:51 +0000 Subject: 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: Tue, 14 Nov 2006 23:00:33 -0000 Hello,=0A=0AI have a question regarding g_access. I'm mounting a custom fi= lesytem 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.=0A=0AI'm not sure if thi= s is a geom related issue, or related to the fact that you cannot mount a d= evice more than twice in vfs?=0A=0AAnyway - the first time I mount (R/W) I = do:=0A=0Ag_access(cp, 1,1, 0)=0A=0AI then mount the device again as read on= ly to a different mount point with =0A=0Ag_access(cp,1,0,0)=0A=0AThe code I= used is taken from g_vfs_open with wr flag set depending if write access i= s required:=0A=0A pp =3D g_dev_getprovider(vp->v_rdev);=0A if (pp = =3D=3D NULL)=0A return (ENOENT);=0A gp =3D g_new_geom= f(&g_vfs_class2, "%s.%s", fsname, pp->name);=0A cp =3D g_new_consume= r(gp);=0A g_attach(cp, pp);=0A error =3D g_access(cp, 1, wr, = 0);=0A if (error) {=0A g_wither_geom(gp, ENXIO);=0A = return (error);=0A }=0A=0ACheers,=0A Shane=0A=0A=0A= =0A=0A =0A_________________________________________________________________= ___________________=0AWant to start your own business?=0ALearn how on Yahoo= ! Small Business.=0Ahttp://smallbusiness.yahoo.com/r-index