From owner-freebsd-geom@FreeBSD.ORG Wed Nov 15 18:09:57 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 8CC1E16A40F for ; Wed, 15 Nov 2006 18:09:57 +0000 (UTC) (envelope-from adamsch1@yahoo.com) Received: from web31809.mail.mud.yahoo.com (web31809.mail.mud.yahoo.com [68.142.207.72]) by mx1.FreeBSD.org (Postfix) with SMTP id 2F2A243D46 for ; Wed, 15 Nov 2006 18:09:57 +0000 (GMT) (envelope-from adamsch1@yahoo.com) Received: (qmail 68292 invoked by uid 60001); 15 Nov 2006 18:09:56 -0000 DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; h=Message-ID:Received:Date:From:Subject:To:Cc:MIME-Version:Content-Type:Content-Transfer-Encoding; b=5iCm28G/A1/Hf5kJ7VLhPrRDH543bB8zsGk6hoTjJBUR6riybBUcECMCUXRQ2b+WTFoiMVronde+QXODayDZ8TdDdUgsuwpQWXdUdck1quwmtWVZDdC21oHCR0XZ2SCI7GowP+6v7Yby0Jw5u4744H5dj1fMy7tN9H+iOFvWBuI= ; Message-ID: <20061115180956.68290.qmail@web31809.mail.mud.yahoo.com> Received: from [68.142.200.245] by web31809.mail.mud.yahoo.com via HTTP; Wed, 15 Nov 2006 10:09:56 PST Date: Wed, 15 Nov 2006 10:09:56 -0800 (PST) From: Shane Adams To: Eric Anderson MIME-Version: 1.0 Content-Type: text/plain; charset=ascii Content-Transfer-Encoding: quoted-printable 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 18:09:57 -0000 Thanks for the reply,=0A=0ACan you mount the same device/file more than onc= e at a time?=0A=0AShane=0A=0A=0A----- Original Message ----=0AFrom: Eric An= derson =0ATo: Shane Adams =0ACc:= freebsd-geom@freebsd.org=0ASent: Wednesday, November 15, 2006 6:03:35 AM= =0ASubject: Re: g_access questions (Out on a limb here)=0A=0AOn 11/14/06 17= :00, Shane Adams wrote:=0A> Hello,=0A> =0A> I have a question regarding g_a= ccess. 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 d= evice 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 rig= hts to the device. For what its worth, I'm mounting a ram backed mdconfig = device.=0A> =0A> I'm not sure if this is a geom related issue, or related t= o the fact that you cannot mount a device more than twice in vfs?=0A> =0A> = Anyway - the first time I mount (R/W) I do:=0A> =0A> g_access(cp, 1,1, 0)= =0A> =0A> I then mount the device again as read only to a different mount p= oint with =0A> =0A> g_access(cp,1,0,0)=0A> =0A> The code I used is taken fr= om g_vfs_open with wr flag set depending if write access is required:=0A> = =0A> pp =3D g_dev_getprovider(vp->v_rdev);=0A> if (pp =3D=3D NUL= L)=0A> return (ENOENT);=0A> gp =3D g_new_geomf(&g_v= fs_class2, "%s.%s", fsname, pp->name);=0A> cp =3D g_new_consumer(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=0A=0AInteresting.. I'= m mounting a custom file system also, and I'm doing it =0Amuch differently:= =0A=0A[...]=0A struct vnode *devvp; /* vnode of the mount device */= =0A struct g_consumer *cp;=0A[...]=0A DROP_GIANT();=0A g_topology_= lock();=0A error =3D g_vfs_open(devvp, &cp, "tarfs", 0);=0A g_topolog= y_unlock();=0A PICKUP_GIANT();=0A VOP_UNLOCK(devvp, 0, td);=0A[...]= =0A=0A=0AEric=0A=0A=0A=0A-- =0A--------------------------------------------= ----------------------------=0AEric Anderson Sr. Systems Administrat= or Centaur Technology=0AAnything that works is better than anything = that doesn't.=0A-----------------------------------------------------------= -------------=0A_______________________________________________=0Afreebsd-g= eom@freebsd.org mailing list=0Ahttp://lists.freebsd.org/mailman/listinfo/fr= eebsd-geom=0ATo unsubscribe, send any mail to "freebsd-geom-unsubscribe@fre= ebsd.org"=0A=0A=0A=0A=0A=0A =0A____________________________________________= ________________________________________=0ASponsored Link=0A=0A$420k for $1= ,399/mo. =0AThink You Pay Too Much For Your Mortgage? =0AFind Out! www.Lowe= rMyBills.com/lre