Date: Wed, 24 Sep 1997 16:32:08 +0900 From: KATO Takenori <kato@migmatite.eps.nagoya-u.ac.jp> To: dg@root.com Cc: current@FreeBSD.ORG Subject: Re: Daily SNAPshots at current.freebsd.org shut down for now. Message-ID: <199709240732.QAA00371@gneiss.eps.nagoya-u.ac.jp> In-Reply-To: Your message of "Tue, 23 Sep 1997 22:15:22 -0700" References: <199709240515.WAA20124@implode.root.com>
next in thread | previous in thread | raw e-mail | index | archive | help
> What is wrong with using LK_CANRECURSE ? In any case, the exact cause > of the recursive locking needs to be understood before this sort of change > is made. I received kgdb log (that is, I don't have vmcore). The backtrace shows that vnstrategy is called twice: 1. vnstrategy() locks the vnode. 2. vnstrategy() calls ffs_write(). 3. cluster write stuff calls vnstrategy() again. 4. Because the vnode has been already locked, VOP_LOCK/vn_lock causes recursive lock. I think problem is in cluster write stuff. It may expect fs stuff supports reentrance, but vnode fs expect it is not reentered. So, possible fixes are: 1. revise cluster write stuff. 2. revise vn.c. ----- kgdb log ---- #0 boot (howto=260) at ../../kern/kern_shutdown.c:266 266 dumppcb.pcb_cr3 = rcr3(); (kgdb) bt #0 boot (howto=260) at ../../kern/kern_shutdown.c:266 #1 0xf010162e in db_fncall (dummy1=-272631644, dummy2=0, dummy3=-266585388, dummy4=0xefbff860 "\n") at ../../ddb/db_command.c:539 #2 0xf0101365 in db_command (last_cmdp=0xf01bbb24, cmd_table=0xf01bb974, aux_cmd_tablep=0xf01cd0f8) at ../../ddb/db_command.c:337 #3 0xf01014e2 in db_command_loop () at ../../ddb/db_command.c:462 #4 0xf0103c28 in db_trap (type=3, code=0) at ../../ddb/db_trap.c:73 #5 0xf019ccbb in kdb_trap (type=3, code=0, regs=0xefbff950) at ../../i386/i386/db_interface.c:126 #6 0xf01a6164 in trap (frame={tf_es = 16, tf_ds = 16, tf_edi = -262329344, tf_esi = -266824827, tf_ebp = -272631404, tf_isp = -272631432, tf_ebx = 256, tf_edx = -266744191, tf_ecx = 1017, tf_eax = 18, tf_trapno = 3, tf_err = 0, tf_eip = -266744135, tf_cs = -272695288, tf_eflags = 582, tf_esp = -266744207, tf_ss = -267318696}) at ../../i386/i386/trap.c:403 #7 0xf019ceb9 in Debugger (msg=0xf0110a58 "panic") at ../../i386/i386/db_interface.c:254 #8 0xf0110aba in panic ( fmt=0xf0189385 "ufs_lock: recursive lock not expected, pid: %d\n") at ../../kern/kern_shutdown.c:388 #9 0xf018941e in ufs_lock (ap=0xefbffa24) at ../../ufs/ufs/ufs_vnops.c:1715 #10 0xf010463e in vnstrategy (bp=0xf250c2e8) at vnode_if.h:731 #11 0xf0134e5e in spec_strategy (ap=0xefbffab0) at ../../miscfs/specfs/spec_vnops.c:511 #12 0xf01895ea in ufs_strategy (ap=0xefbffab0) at ../../ufs/ufs/ufs_vnops.c:1839 #13 0xf01274f0 in bwrite (bp=0xf250c2e8) at vnode_if.h:1116 #14 0xf01275ba in vn_bwrite (ap=0xefbffaec) at ../../kern/vfs_bio.c:386 #15 0xf0127f8c in vfs_bio_awrite (bp=0xf250c2e8) at vnode_if.h:1133 #16 0xf01281a0 in getnewbuf (slpflag=0, slptimeo=0, size=4096, maxsize=4096) at ../../kern/vfs_bio.c:924 #17 0xf01286d5 in getblk (vp=0xf05a7180, blkno=219, size=4096, slpflag=0, slptimeo=0) at ../../kern/vfs_bio.c:1197 #18 0xf0180479 in ffs_balloc (ip=0xf0597200, bn=219, size=4096, cred=0xf05a1e80, bpp=0xefbffc90, flags=0) at ../../ufs/ffs/ffs_balloc.c:286 #19 0xf018338d in ffs_write (ap=0xefbffce4) at ../../ufs/ufs/ufs_readwrite.c:260 #20 0xf01046a4 in vnstrategy (bp=0xf24e40f4) at vnode_if.h:283 #21 0xf0134e5e in spec_strategy (ap=0xefbffd84) at ../../miscfs/specfs/spec_vnops.c:511 #22 0xf01895ea in ufs_strategy (ap=0xefbffd84) at ../../ufs/ufs/ufs_vnops.c:1839 #23 0xf01274f0 in bwrite (bp=0xf24e40f4) at vnode_if.h:1116 #24 0xf01275ba in vn_bwrite (ap=0xefbffda4) at ../../kern/vfs_bio.c:386 #25 0xf01276c8 in bawrite (bp=0xf24e40f4) at vnode_if.h:1133 #26 0xf012af17 in cluster_wbuild (vp=0xf059bb00, size=4096, start_lbn=188, len=16) at ../../kern/vfs_cluster.c:705 #27 0xf012ab21 in cluster_write (bp=0xf250e0fc, filesize=770048) at ../../kern/vfs_cluster.c:555 #28 0xf0183584 in ffs_write (ap=0xefbffee8) at ../../ufs/ufs/ufs_readwrite.c:291 #29 0xf0131597 in vn_write (fp=0xf05da400, uio=0xefbfff34, cred=0xf058ad80) at vnode_if.h:283 #30 0xf0117c83 in write (p=0xf04f9a00, uap=0xefbfff94, retval=0xefbfff84) at ../../kern/sys_generic.c:263 #31 0xf01a6ba7 in syscall (frame={tf_es = 39, tf_ds = -272695257, tf_edi = 73728, tf_esi = 4, tf_ebp = -272640220, tf_isp = -272629788, tf_ebx = 0, tf_edx = 512, tf_ecx = 0, tf_eax = 4, tf_trapno = 0, tf_err = 7, tf_eip = 134708913, tf_cs = 31, tf_eflags = 582, tf_esp = -272640244, tf_ss = 39}) at ../../i386/i386/trap.c:890 #32 0x8077eb1 in ?? () #33 0x9741 in ?? () #34 0x9c29 in ?? () #35 0x4c2c in ?? () #36 0x7b89 in ?? () #37 0x1095 in ?? () ----- end ----- ---- KATO Takenori <kato@ganko.eps.nagoya-u.ac.jp> Dept. Earth Planet. Sci., Nagoya Univ., Nagoya, 464-01, Japan PGP public key: finger kato@eclogite.eps.nagoya-u.ac.jp ------------------- Powered by FreeBSD(98) -------------------
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199709240732.QAA00371>