linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Re: Unionfs in -mm
       [not found] <20070109004456.GA7954@filer.fsl.cs.sunysb.edu>
@ 2007-01-09 20:08 ` Jason Lunz
  2007-01-13  6:48   ` Josef Sipek
  0 siblings, 1 reply; 4+ messages in thread
From: Jason Lunz @ 2007-01-09 20:08 UTC (permalink / raw)
  To: jsipek; +Cc: unionfs, linux-fsdevel

On Mon, Jan 08, 2007 at 07:44:56PM -0500, Josef Sipek wrote:
> Today is a good day!
>
> Andrew Morton included a minimal version of Unionfs in his -mm tree.
>
> This minimal version of the code lacks some of the features in the full
> fledged version, however we'll be cleaning them up and adding them in one at
> a time.
>
> Thank you all who helped to make this possible!

and thanks to you all for the hard work.

But I have a bug to report. I'm trying out yesterday's 24-patch series
on 2.6.20-rc4 (http://thread.gmane.org/gmane.linux.kernel/481661).

The root filesystem is a union of a ro squashfs and a rw tmpfs.
The initramfs sets it up something like this:

mkdir /os
mount -r -t squashfs /dev/ram0 /os

mkdir /cow
mount -t tmpfs -o mode=0755 tmpfs /cow

mount -w -o dirs=/cow=rw:/os=ro -t unionfs unionfs /root

The system works normally, except that it crashes reliably whenever I
run this program:

#! /usr/bin/python

import glob
import os
import subprocess
import sys

def processes():
    'Returns a iterator over (pid, exe) tuples for each running process.'

    # the kernel appends this to the link target when the running exe has been
    # unlinked
    unlinked_suffix = ' (deleted)'

    subprocess.call('ps axf 1>&2', shell=True)
    subprocess.call('ls -l /proc/* 1>&2', shell=True)

    for ed in glob.glob('/proc/*'):
        print >>sys.stderr, 'looking at %s' % ed
        try:
            pid = int(os.path.basename(ed))
        except ValueError:
            # probably /proc/self or something
            continue

        print >>sys.stderr, '%s has pid %s' % (ed, pid)

        try:
            l = os.path.join(ed, 'exe')
            print >>sys.stderr, 'reading %s' % l
            targ = os.readlink(l)
        except OSError:
            # building a list of running processes is inherently racy, oh well
            continue
        
        if targ.endswith(unlinked_suffix):
            targ = targ[:-len(unlinked_suffix)]

        yield (pid, targ)

for p, e in processes():
    print >>sys.stderr, p, e


here's the oops from running under qemu. More or less the same thing
happens in UML kernels too:

BUG: unable to handle kernel NULL pointer dereference at virtual address 00000010
 printing eip:
c015d701
*pde = 00000000
Oops: 0000 [#1]
SMP
Modules linked in: button ac battery bridge llc unionfs squashfs zlib_inflate rd ext2 dm_mod ide_cd cdrom ide_disk mousedev parport_pc parport floppy serio_raw psmouse piix generic ide_core ata_generic libata pcspkr ne2k_pci 8390 i2c_piix4 i2c_core scsi_mod evdev fan
CPU:    0
EIP:    0060:[<c015d701>]    Not tainted VLI
EFLAGS: 00200202   (2.6.20-rc4-x86 #0)
EIP is at __d_path+0x8f/0x154
eax: c68ad42c   ebx: c364dffe   ecx: 00000000   edx: 00001000
esi: c7a81da0   edi: c6ce6a9c   ebp: c364dfff   esp: c72f5ec8
ds: 007b   es: 007b   ss: 0068
Process ls (pid: 1804, ti=c72f5000 task=c7a91ab0 task.ti=c72f5000)
Stack: c68ad42c 00000000 c6ce6a9c 00000044 00000001 00000fff c68ad42c c7a81da0
       c364d000 00000000 c015ec0e c7a81da0 c364d000 00001000 c6ce6a9c c6ce6a9c
       c364d000 fffffff4 00000000 c01774b3 00001000 00000001 08061290 00000000
Call Trace:
 [<c015ec0e>] d_path+0x91/0xbd
 [<c01774b3>] proc_pid_readlink+0x76/0xdc
 [<c015246e>] sys_readlinkat+0x83/0x9e
 [<c01524b0>] sys_readlink+0x27/0x2b
 [<c0102ccc>] syscall_call+0x7/0xb
 =======================
Code: ff 2f eb 08 8b 7c 24 10 89 7c 24 08 8b 04 24 39 44 24 08 75 0e 8b 54 24 2c 39 54 24 04 0f 84 c3 00 00 00 8b 7c 24 08 8b 4c 24 04 <3b> 79 10 74 0b 8b 47 18 89 44 24 10 39 c7 75 29 b8 80 f0 2e c0
EIP: [<c015d701>] __d_path+0x8f/0x154 SS:ESP 0068:c72f5ec8

any ideas?

Jason

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Unionfs in -mm
  2007-01-09 20:08 ` Unionfs in -mm Jason Lunz
@ 2007-01-13  6:48   ` Josef Sipek
  2007-01-16 23:03     ` Jason Lunz
  0 siblings, 1 reply; 4+ messages in thread
From: Josef Sipek @ 2007-01-13  6:48 UTC (permalink / raw)
  To: Jason Lunz; +Cc: unionfs, linux-fsdevel

On Tue, Jan 09, 2007 at 03:08:57PM -0500, Jason Lunz wrote:
...
> But I have a bug to report. I'm trying out yesterday's 24-patch series
> on 2.6.20-rc4 (http://thread.gmane.org/gmane.linux.kernel/481661).
> 
> The root filesystem is a union of a ro squashfs and a rw tmpfs.
> The initramfs sets it up something like this:
> 
> mkdir /os
> mount -r -t squashfs /dev/ram0 /os
> 
> mkdir /cow
> mount -t tmpfs -o mode=0755 tmpfs /cow
> 
> mount -w -o dirs=/cow=rw:/os=ro -t unionfs unionfs /root
 
>From the names of the mountpoint I assume you chroot, pivot_root, etc.
Right?
 
Does the problem manifest itself when you mount proc on /root/proc?
 
Thanks for trying the code,

Josef "Jeff" Sipek.

-- 
Research, n.:
  Consider Columbus:
    He didn't know where he was going.
    When he got there he didn't know where he was.
    When he got back he didn't know where he had been.
    And he did it all on someone else's money.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Unionfs in -mm
  2007-01-13  6:48   ` Josef Sipek
@ 2007-01-16 23:03     ` Jason Lunz
  2007-01-17  0:28       ` [Unionfs] " Jan Engelhardt
  0 siblings, 1 reply; 4+ messages in thread
From: Jason Lunz @ 2007-01-16 23:03 UTC (permalink / raw)
  To: Josef Sipek; +Cc: unionfs, linux-fsdevel

On Sat, Jan 13, 2007 at 01:48:04AM -0500, Josef Sipek wrote:
> > The root filesystem is a union of a ro squashfs and a rw tmpfs.
> > The initramfs sets it up something like this:
> > 
> > mkdir /os
> > mount -r -t squashfs /dev/ram0 /os
> > 
> > mkdir /cow
> > mount -t tmpfs -o mode=0755 tmpfs /cow
> > 
> > mount -w -o dirs=/cow=rw:/os=ro -t unionfs unionfs /root
>  
> From the names of the mountpoint I assume you chroot, pivot_root, etc.
> Right?

yes. I'm using debian etch initramfs-tools. After the above mount
sequence, the unionfs becomes root via:

	mkdir ${rootmnt}/cow ${rootmnt}/os
	mount -n -o move /cow ${rootmnt}/cow
	mount -n -o move /os ${rootmnt}/os

	mount -n -o move /dev $rootmnt/dev
	mount -n -o move /sys ${rootmnt}/sys
	mount -n -o move /proc ${rootmnt}/proc

followed by using klibc's run-init, which does the pivot_root/chroot/etc
in C:

	exec run-init ${rootmnt} ${init} "$@" <${rootmnt}/dev/console >${rootmnt}/dev/console

> Does the problem manifest itself when you mount proc on /root/proc?

well, it _is_ mounted there. Do you mean mounting it there without using
-o move? I'd have to modify the non-templated part of mkinitramfs to do
that but I could try it.

> Thanks for trying the code,

thanks for writing it. fyi, I've had better results with aufs - you
may want to check that out. I'll keep an eye on unionfs as well.

Jason

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [Unionfs] Re: Unionfs in -mm
  2007-01-16 23:03     ` Jason Lunz
@ 2007-01-17  0:28       ` Jan Engelhardt
  0 siblings, 0 replies; 4+ messages in thread
From: Jan Engelhardt @ 2007-01-17  0:28 UTC (permalink / raw)
  To: Jason Lunz; +Cc: Josef Sipek, linux-fsdevel, unionfs


On Jan 16 2007 18:03, Jason Lunz wrote:
>yes. I'm using debian etch initramfs-tools. After the above mount
>sequence, the unionfs becomes root via:
>
>	mkdir ${rootmnt}/cow ${rootmnt}/os
>	mount -n -o move /cow ${rootmnt}/cow
>	mount -n -o move /os ${rootmnt}/os
>
>	mount -n -o move /dev $rootmnt/dev
>	mount -n -o move /sys ${rootmnt}/sys
>	mount -n -o move /proc ${rootmnt}/proc

Hint hint, --move also exists, since move itself is not strictly a fs option,
but one of the VFS. ;-)


	-`J'
-- 

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2007-01-17  0:30 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <20070109004456.GA7954@filer.fsl.cs.sunysb.edu>
2007-01-09 20:08 ` Unionfs in -mm Jason Lunz
2007-01-13  6:48   ` Josef Sipek
2007-01-16 23:03     ` Jason Lunz
2007-01-17  0:28       ` [Unionfs] " Jan Engelhardt

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).