Voodoo with md(4) panics system reliably
Jon Passki
cykyc at yahoo.com
Sun Oct 16 19:14:50 PDT 2005
Hello,
I'm attempting to simulate unionfs on RELENG_5_4 by remounting
multiple times one vnode-backed md disk and then union mounting
others on top. Here are my steps below w/ a quick backtrace. I
have the core saved and can look into it farther if need be.
Ideas outside of ``don't do that''?
Jon
touch /root/foo
mdconfig -a -t vnode -s 32m -f /root/foo
newfs /dev/md0
mount /dev/md0 /tmp/md0
touch /tmp/md0/test1
umount /tmp/md0
mdconfig -d -u md0
# Strangeness coming
mdconfig -a -t vnode -f /root/foo -o readonly -u md0
mdconfig -a -t vnode -f /root/foo -o readonly -u md1
mdconfig -a -t vnode -f /root/foo -o readonly -u md2
mount -o ro /dev/md0 /tmp/md0
mount -o ro /dev/md1 /tmp/md1
mount -o ro /dev/md1 /tmp/md2
# Multiple mounts
touch bar{0,1,2}
mdconfig -a -t vnode -s 32m -f /root/bar0 -u md4
mdconfig -a -t vnode -s 32m -f /root/bar1 -u md5
mdconfig -a -t vnode -s 32m -f /root/bar2 -u md6
newfs /dev/md4
newfs /dev/md5
newfs /dev/md6
mount -o union /dev/md4 /tmp/md0
mount -o union /dev/md5 /tmp/md1
mount -o union /dev/md6 /tmp/md2
mount
[snip]
/dev/md0 on /tmp/md0 (ufs, local, read-only)
/dev/md1 on /tmp/md1 (ufs, local, read-only)
/dev/md2 on /tmp/md2 (ufs, local, read-only)
/dev/md4 on /tmp/md0 (ufs, local, union)
/dev/md5 on /tmp/md1 (ufs, local, union)
/dev/md6 on /tmp/md2 (ufs, local, union)
mdconfig -l
md6 md5 md4 md2 md1 md0
ls -li /tmp/md0
total 2
3 drwxrwxr-x 2 root operator 512 Oct 16 20:30 .snap
4 -rw-r--r-- 1 root wheel 0 Oct 16 20:21 test1
touch /tmp/md0/test2
ls -li /tmp/md0
total 2
3 drwxrwxr-x 2 root operator 512 Oct 16 20:30 .snap
4 -rw-r--r-- 1 root wheel 0 Oct 16 20:21 test1
4 -rw-r--r-- 1 root wheel 0 Oct 16 20:31 test2
touch /tmp/md0/test3
ls -li /tmp/md0
total 2
3 drwxrwxr-x 2 root operator 512 Oct 16 20:30 .snap
4 -rw-r--r-- 1 root wheel 0 Oct 16 20:21 test1
4 -rw-r--r-- 1 root wheel 0 Oct 16 20:31 test2
5 -rw-r--r-- 1 root wheel 0 Oct 16 20:32 test3
<panic>
(kgdb) bt
#0 doadump () at pcpu.h:159
#1 0xc054d2e2 in boot (howto=260) at
/usr/src/sys/kern/kern_shutdown.c:410
#2 0xc054d578 in panic (fmt=0xc0735a98 "ffs_sync: rofs mod")
at /usr/src/sys/kern/kern_shutdown.c:566
#3 0xc068a5fc in ffs_sync (mp=0xc2304000, waitfor=3,
cred=0xc21dbd80,
td=0xc22efd80) at /usr/src/sys/ufs/ffs/ffs_vfsops.c:1123
#4 0xc05a23b6 in sync_fsync (ap=0xe49f2ce4)
at /usr/src/sys/kern/vfs_subr.c:3475
#5 0xc059f1cd in sched_sync () at vnode_if.h:627
#6 0xc0538e88 in fork_exit (callout=0xc059ee0c <sched_sync>,
arg=0x0,
frame=0xe49f2d48) at /usr/src/sys/kern/kern_fork.c:791
#7 0xc06d43bc in fork_trampoline () at
/usr/src/sys/i386/i386/exception.s:209
(kgdb) f 3
#3 0xc068a5fc in ffs_sync (mp=0xc2304000, waitfor=3,
cred=0xc21dbd80,
td=0xc22efd80) at /usr/src/sys/ufs/ffs/ffs_vfsops.c:1123
1123 lockreq = LK_EXCLUSIVE | LK_NOWAIT;
(kgdb) inf f
Stack level 3, frame at 0xe49f2c94:
eip = 0xc068a5fc in ffs_sync
(/usr/src/sys/ufs/ffs/ffs_vfsops.c:1123);
saved eip 0xc05a23b6
called by frame at 0xe49f2cc4, caller of frame at 0xe49f2c3c
source language c.
Arglist at 0xe49f2c38, args: mp=0xc2304000, waitfor=3,
cred=0xc21dbd80,
td=0xc22efd80
Locals at 0xe49f2c38, Previous frame's sp is 0xe49f2c94
Saved registers:
ebx at 0xe49f2c80, ebp at 0xe49f2c8c, esi at 0xe49f2c84, edi at
0xe49f2c88,
eip at 0xe49f2c90
(kgdb) l
1118 }
1119 /*
1120 * Write back each (modified) inode.
1121 */
1122 wait = 0;
1123 lockreq = LK_EXCLUSIVE | LK_NOWAIT;
1124 if (waitfor == MNT_WAIT) {
1125 wait = 1;
1126 lockreq = LK_EXCLUSIVE;
1127 }
__________________________________
Yahoo! Mail - PC Magazine Editors' Choice 2005
http://mail.yahoo.com
More information about the freebsd-stable
mailing list