Re: Mounting cd9660 multiple times gives EBUSY [Was: unionfs a little improvement]

2010-08-22 Thread Pawel Jakub Dawidek
On Wed, Aug 18, 2010 at 12:48:53PM +0200, Ed Schouten wrote:
 Hi Daichi,
 
 I think Keith Packard of Xorg once wrote a commit message along the
 lines of 5000 lines of code removed, feature added This seems to be
 similar, albeit on a smaller scale. ;-)
 
 Apart from this issue with unionfs, I am also experiencing another
 issue, where for some reason I cannot perform a second mount of the CD
 right after booting the system. Basically, my WIP FreeBSD boot CD does
 the following (but written in C):
 
   mount -t cd9660 /dev/iso9660/freebsd /mnt
   mount -t tmpfs none /tmp
   mount -t unionfs /tmp /mnt
   mount -t devfs none /mnt/dev
   chroot /mnt /sbin/init
 
 The first step fails with EBUSY. I use the following hack to get it
 working, but I don't think it's the proper way to solve it:

What you are trying to do here is to mount /dev/iso9660/freebsd for the
second time? This is not supported. The check is there to prevent doing
this, as it will panic on you when you try to unmount first mount (not
really a problem in your case, as the first mount is /, so you probably
don't want to unmount it, but it is a problem in general).

You should be able to reproduce the panic with your patch applied by
doing the following:

# mount -t cd9660 /dev/iso9660/freebsd /mnt0
# mount -t cd9660 /dev/iso9660/freebsd /mnt1
# umount /mnt0

-- 
Pawel Jakub Dawidek   http://www.wheelsystems.com
p...@freebsd.org   http://www.FreeBSD.org
FreeBSD committer Am I Evil? Yes, I Am!


pgp88NLmz310d.pgp
Description: PGP signature


Mounting cd9660 multiple times gives EBUSY [Was: unionfs a little improvement]

2010-08-18 Thread Ed Schouten
Hi Daichi,

I think Keith Packard of Xorg once wrote a commit message along the
lines of 5000 lines of code removed, feature added This seems to be
similar, albeit on a smaller scale. ;-)

Apart from this issue with unionfs, I am also experiencing another
issue, where for some reason I cannot perform a second mount of the CD
right after booting the system. Basically, my WIP FreeBSD boot CD does
the following (but written in C):

mount -t cd9660 /dev/iso9660/freebsd /mnt
mount -t tmpfs none /tmp
mount -t unionfs /tmp /mnt
mount -t devfs none /mnt/dev
chroot /mnt /sbin/init

The first step fails with EBUSY. I use the following hack to get it
working, but I don't think it's the proper way to solve it:

%%%
Index: sys/geom/geom_vfs.c
===
--- sys/geom/geom_vfs.c (revision 211093)
+++ sys/geom/geom_vfs.c (working copy)
@@ -162,8 +162,10 @@
 
*cpp = NULL;
bo = vp-v_bufobj;
+#if 0
if (bo-bo_private != vp)
return (EBUSY);
+#endif
 
pp = g_dev_getprovider(vp-v_rdev);
if (pp == NULL)
%%%

I am really not that familiar with GEOM/VFS to understand the impact of
this change. What does it actually mean if bo-bo_private != vp?

-- 
 Ed Schouten e...@80386.nl
 WWW: http://80386.nl/


pgpDtQb4iDzU5.pgp
Description: PGP signature


Re: Mounting cd9660 multiple times gives EBUSY [Was: unionfs a little improvement]

2010-08-18 Thread Ed Schouten
* Pawel Jakub Dawidek p...@freebsd.org wrote:
 What you are trying to do here is to mount /dev/iso9660/freebsd for the
 second time? This is not supported. The check is there to prevent doing
 this, as it will panic on you when you try to unmount first mount (not
 really a problem in your case, as the first mount is /, so you probably
 don't want to unmount it, but it is a problem in general).
 
 You should be able to reproduce the panic with your patch applied by
 doing the following:
 
   # mount -t cd9660 /dev/iso9660/freebsd /mnt0
   # mount -t cd9660 /dev/iso9660/freebsd /mnt1
   # umount /mnt0

Ah, I see. Well, I changed my setup to use an md root now. Works quite
nicely. Screenshot:

http://80386.nl/pub/livecd.png

Thanks for the explanation!

-- 
 Ed Schouten e...@80386.nl
 WWW: http://80386.nl/


pgps9FfC06S09.pgp
Description: PGP signature