panic when mounting device >= 2 times

Kostik Belousov kostikbel at gmail.com
Fri Oct 16 08:38:42 UTC 2009


On Fri, Oct 16, 2009 at 11:32:00AM +0300, Andriy Gapon wrote:
> on 14/10/2009 23:46 Pawel Jakub Dawidek said the following:
> > I've this patch that is suppose to fix it:
> > 
> > 	http://people.freebsd.org/~pjd/patches/geom_vfs.c.patch
> > 
> > But AFAIR its not complete. I think it is still possible to remount one
> > of the read-only mounts to read-write.
> > 
> > Another possibility that comes to my mind is to keep list/array of
> > consumers in bo_private instead of using one consumer only. This would
> > be better in terms of access management.
> 
> This looks very good for at least preventing the most common accidents.
> I've been thinking about something like creating a cloned vnode for the device
> vnode and giving a private copy to each filesystem. But I currently lack a lot
> knowledge in this area, so I can't even say if it could be feasible, let alone
> implement it.

I suspect this is pretty much bad idea. The reason is that buffer list is
managed by buffer object that has 1:1 correspondence with the vnode.
You will end up with aliased buffers.

Actually, this could happen without the proposed change as well, I believe.
It is enough to mount devfs several times and then use different devfs
vnodes for the same device. But since people usually mount filesystems
using /dev, this does not happen in practice.

For multiple ro mounts to work, we need to find a way to push the buffer
object to cdev.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 196 bytes
Desc: not available
Url : http://lists.freebsd.org/pipermail/freebsd-current/attachments/20091016/161aab15/attachment.pgp


More information about the freebsd-current mailing list