Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 15 Nov 2006 10:09:56 -0800 (PST)
From:      Shane Adams <adamsch1@yahoo.com>
To:        Eric Anderson <anderson@centtech.com>
Cc:        freebsd-geom@freebsd.org
Subject:   Re: g_access questions (Out on a limb here)
Message-ID:  <20061115180956.68290.qmail@web31809.mail.mud.yahoo.com>

next in thread | raw e-mail | index | archive | help

Thanks for the reply,

Can you mount the same device/file more than once at a time?

Shane


----- Original Message ----
From: Eric Anderson <anderson@centtech.com>
To: Shane Adams <adamsch1@yahoo.com>
Cc: freebsd-geom@freebsd.org
Sent: Wednesday, November 15, 2006 6:03:35 AM
Subject: Re: g_access questions (Out on a limb here)

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.
------------------------------------------------------------------------
_______________________________________________
freebsd-geom@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-geom
To unsubscribe, send any mail to "freebsd-geom-unsubscribe@freebsd.org"





 
____________________________________________________________________________________
Sponsored Link

$420k for $1,399/mo. 
Think You Pay Too Much For Your Mortgage? 
Find Out! www.LowerMyBills.com/lre



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20061115180956.68290.qmail>