GENERIC HEAD from 2011-06-08 23:44:59 UTC, r222894M, vmcore.155 Looping mksnap_ffs. KDB: debugger backends: ddb KDB: current backend: ddb 524288K of memory above 4GB ignored Copyright (c) 1992-2011 The FreeBSD Project. Copyright (c) 1979, 1980, 1983, 1986, 1988, 1989, 1991, 1992, 1993, 1994 The Regents of the University of California. All rights reserved. FreeBSD is a registered trademark of The FreeBSD Foundation. FreeBSD 9.0-CURRENT #0 r222894M: Thu Jun 9 14:44:26 CEST 2011 pho@x4.osted.lan:/usr/src/sys/i386/compile/PHO i386 WARNING: WITNESS option enabled, expect reduced performance. WARNING: DIAGNOSTIC option enabled, expect reduced performance. CPU: AMD Phenom(tm) 9150e Quad-Core Processor (1800.02-MHz 686-class CPU) Origin = "AuthenticAMD" Id = 0x100f23 Family = 10 Model = 2 Stepping = 3 Features=0x178bfbff Features2=0x802009 AMD Features=0xee500800 AMD Features2=0x7ff TSC: P-state invariant real memory = 4294967296 (4096 MB) avail memory = 3535958016 (3372 MB) : Trying to mount root from ufs:/dev/ad4s1a [rw]... WARNING: / was not properly dismounted Setting hostuuid: 00000000-0000-0000-0000-00218515337d. Setting hostid: 0x6b64ac17. Starting ddb. Entropy harvesting: interrupts ethernet point_to_point kickstart. Starting file system checks: /dev/ad4s1a: 2357 files, 678226 used, 334789 free (1565 frags, 41653 blocks, 0.2% fragmentation) /dev/ad4s1f: 15548 files, 815590 used, 197425 free (4457 frags, 24121 blocks, 0.4% fragmentation) /dev/label/tmp: SUMMARY INFORMATION BAD (SALVAGED) /dev/label/tmp: BLK(S) MISSING IN BIT MAPS (SALVAGED) /dev/label/tmp: 301373 files, 26978970 used, 91335011 free (3139 frags, 11416484 blocks, 0.0% fragmentation) /dev/ad4s1d: 765230 files, 7663401 used, 2490798 free (231830 frags, 282371 blocks, 2.3% fragmentation) /dev/ad4s1e: 620000 files, 16019416 used, 9369101 free (51581 frags, 1164690 blocks, 0.2% fragmentation) Mounting local file systems:. Setting hostname: x4.osted.lan. re0: link state changed to DOWN Starting Network: lo0 re0 fwe0 fwip0. lo0: flags=8049 metric 0 mtu 16384 options=3 inet 127.0.0.1 netmask 0xff000000 inet6 ::1 prefixlen 128 inet6 fe80::1%lo0 prefixlen 64 scopeid 0xa nd6 options=21 re0: flags=8843 metric 0 mtu 1500 options=389b ether 00:21:85:15:33:7d inet 192.168.1.101 netmask 0xffffff00 broadcast 192.168.1.255 inet6 fe80::221:85ff:fe15:337d%re0 prefixlen 64 tentative scopeid 0x1 nd6 options=29 media: Ethernet autoselect (none) status: no carrier fwe0: flags=8802 metric 0 mtu 1500 options=8 ether 02:dc:10:62:ad:eb ch 1 dma -1 fwip0: flags=8802 metric 0 mtu 1500 lladdr 0.dc.10.0.1.62.ad.eb.a.2.ff.fe.0.0.0.0 Starting devd. Starting Network: usbus0. Starting Network: usbus1. Starting Network: usbus2. Starting Network: usbus3. Starting Network: usbus4. Starting Network: usbus5. Starting Network: fwe0. fwe0: flags=8802 metric 0 mtu 1500 options=8 ether 02:dc:10:62:ad:eb ch 1 dma -1 re0: link state changed to UP Starting Network: fwip0. fwip0: flags=8802 metric 0 mtu 1500 lladdr 0.dc.10.0.1.62.ad.eb.a.2.ff.fe.0.0.0.0 add net default: gateway 192.168.1.1 add net ::ffff:0.0.0.0: gateway ::1 add net ::0.0.0.0: gateway ::1 add net fe80::: gateway ::1 add net ff02::: gateway ::1 ELF ldconfig path: /lib /usr/lib /usr/lib/compat /usr/local/lib /usr/local/lib/compat/pkg /usr/local/kde4/lib /usr/local/lib /usr/local/lib/compat /usr/local/lib/compat/pkg /usr/local/lib/nss /usr/local/lib/qt4 /usr/local/lib/virtualbox /usr/local/lib/wine a.out ldconfig path: /usr/lib/aout /usr/lib/compat/aout Creating and/or trimming log files. Starting syslogd. savecore: reboot after panic: chlock order reversal: eck_inode_unwrit1st 0xe0715120 bufwait (bufwait) @ kern/vfs_bio.c:2658 ten: busy inode 2nd 0xc78e7000 dirhash (dirhash) @ ufs/ufs/ufs_dirhash.c:284 K Jun 9 18:38:00DB: stack backtrace: x4 savecore: redboot after panicb_: check_inode_untwritten: busy inraode ce_self_wrapper(c0e93696,2e687361,38323a63,c7000a34,a7a,...) at db_trace_self_wrapper+0x26 kdb_backtrace(c09e5dcb,c0e9709f,c6d5e2a0,c6d61f90,ef2747e8,...) at kdb_backtrace+0x2a _witness_debugger(c0e9709f,c78e7000,c0ec633a,c6d61f90,c0ec5fcc,...) at _witness_debugger+0x25 witness_checkorder(c78e7000,9,c0ec5fc3,11c,0,...) at witness_checkorder+0x839 _sx_xlock(c78e7000,0,c0ec5fc3,11c,c78d1414,...) at _sx_xlock+0x85 ufsdirhash_acquire(e07150c0,e128a4b4,14c,e128a4c8,ef2748b8,...) at ufsdirhash_acquire+0x48 ufsdirhash_add(c78d1414,ef274914,24c8,ef2748a4,ef2748a8,...) at ufsdirhash_add+0x13 ufs_direnter(c78d3414,c78ed2b8,ef274914,ef274ba4,0,...) at ufs_direnter+0x749 ufs_makeinode(ef274ba4,c0fc5e60,ef274b00,ef274a5c,c0cfc5b5,...) at ufs_makeinode+0x5c5 ufs_create(ef274b00,c0ee40cd,0,0,ef274b78,...) at ufs_create+0x30 VOP_CREATE_APV(c0fc5960,ef274b00,ef274ba4,ef274a98,0,...) at VOP_CREATE_APV+0xc5 vn_open_cred(ef274b78,ef274c2c,180,0,c6d9fe00,...) at vn_open_cred+0x205 vn_open(ef274b78,ef274c2c,180,c78734d0,0,...) at vn_open+0x3b kern_openat(c786fb80,ffffff9c,28450000,0,602,...) at kern_openat+0x12f kern_open(c786fb80,28450000,0,601,180,...) at kern_open+0x35 open(c786fb80,ef274cec,ef274d80,ef274c88,0,...) at open+0x30 syscallenter(c786fb80,ef274ce4,c0cd90e6,0,0,...) at syscallenter+0x263 syscall(ef274d28) at syscall+0x4f Xint0x80_syscall() at Xint0x80_syscall+0x21 --- syscall (5, FreeBSD ELF32, open), eip = 0x281896a3, esp = 0xbfbfe2ac, ebp = 0xbfbfedb8 --- savecore: writing core to vmcore.154 Unable to find matching kernel for /var/crash/vmcore.154 Additional ABI support: linux. Starting rpcbind. NFS access cache time=60 Clearing /tmp (X related). Starting mountd. NFSv4 is disabled Starting nfsd. Recovering vi editor sessions:. Updating motd:. Starting ntpd. Starting default moused. Configuring syscons: keymap blanktime. Starting sshd. Starting cron. Local package initialization: backuplock order reversal: 1st 0xc77309dc ufs (ufs) @ kern/vfs_subr.c:2132 2nd 0xe095a020 bufwait (bufwait) @ ufs/ffs/ffs_vnops.c:261 3rd 0xc7a5a9dc ufs (ufs) @ kern/vfs_subr.c:2132 KDB: stack backtrace: db_trace_self_wrapper(c0e93696,3a632e73,a313632,ef235800,246,...) at db_trace_self_wrapper+0x26 kdb_backtrace(c09e5dcb,c0e970b8,c6d5e2a0,c6d61f28,ef2358a4,...) at kdb_backtrace+0x2a _witness_debugger(c0e970b8,c7a5a9dc,c0e86454,c6d61f28,c0e9ecbb,...) at _witness_debugger+0x25 witness_checkorder(c7a5a9dc,9,c0e9ecb2,854,0,...) at witness_checkorder+0x839 __lockmgr_args(c7a5a9dc,80100,c7a5aa48,0,0,...) at __lockmgr_args+0x814 ffs_lock(ef2359c8,c09f76bb,c0e9e017,80100,c7a5a984,...) at ffs_lock+0xa1 VOP_LOCK1_APV(c0fc5960,ef2359c8,109,c0fe08e0,c7a5a984,...) at VOP_LOCK1_APV+0xb5 _vn_lock(c7a5a984,80100,c0e9ecb2,854,4,...) at _vn_lock+0x78 vget(c7a5a984,80100,c742e8a0,50,0,...) at vget+0xbb vfs_hash_get(c7738000,5a3400,80000,c742e8a0,ef235b0c,...) at vfs_hash_get+0xed ffs_vgetf(c7738000,5a3400,80000,ef235b0c,1,...) at ffs_vgetf+0x49 softdep_sync_buf(c7730984,e0959fc0,1,107,0,...) at softdep_sync_buf+0x4a3 ffs_syncvnode(c7730984,1,c742e8a0,566,0,...) at ffs_syncvnode+0x238 ffs_sync(c7738000,1,ef235c14,4ee,0,...) at ffs_sync+0x26f dounmount(c7738000,8080000,c742e8a0,473,5b85c5ea,...) at dounmount+0x447 unmount(c742e8a0,ef235cec,28176705,1,0,...) at unmount+0x310 syscallenter(c742e8a0,ef235ce4,c0cd942d,c101b570,0,...) at syscallenter+0x263 syscall(ef235d28) at syscall+0x4f Xint0x80_syscall() at Xint0x80_syscall+0x21 --- syscall (22, FreeBSD ELF32, unmount), eip = 0x280dcd5b, esp = 0xbfbfe64c, ebp = 0xbfbfe718 --- lock order reversal: 1st 0xc7731310 ufs (ufs) @ kern/vfs_mount.c:1193 2nd 0xc74bb1b4 devfs (devfs) @ ufs/ffs/ffs_softdep.c:1794 KDB: stack backtrace: db_trace_self_wrapper(c0e93696,37313a63,a3439,c0ec7609,c15b3888,...) at db_trace_self_wrapper+0x26 kdb_backtrace(c09e5dcb,c0e9709f,c6d61f28,c6d61e58,ef235a04,...) at kdb_backtrace+0x2a _witness_debugger(c0e9709f,c74bb1b4,c0e7e2c7,c6d61e58,c0ec25e9,...) at _witness_debugger+0x25 witness_checkorder(c74bb1b4,9,c0ec25e0,702,c74bb220,...) at witness_checkorder+0x839 __lockmgr_args(c74bb1b4,80400,c74bb220,0,0,...) at __lockmgr_args+0x814 vop_stdlock(ef235b24,4,c0e8dd67,80400,c74bb15c,...) at vop_stdlock+0x65 VOP_LOCK1_APV(c0f9b460,ef235b24,c1199630,c0fe08e0,c74bb15c,...) at VOP_LOCK1_APV+0xb5 _vn_lock(c74bb15c,80400,c0ec25e0,702,c7738000,...) at _vn_lock+0x78 softdep_flushworklist(c7738000,ef235bd0,c742e8a0,574,0,...) at softdep_flushworklist+0x47 ffs_sync(c7738000,1,ef235c14,4ee,0,...) at ffs_sync+0x2fd dounmount(c7738000,8080000,c742e8a0,473,5b85c5ea,...) at dounmount+0x447 unmount(c742e8a0,ef235cec,28176705,1,0,...) at unmount+0x310 syscallenter(c742e8a0,ef235ce4,c0cd942d,c101b570,0,...) at syscallenter+0x263 syscall(ef235d28) at syscall+0x4f Xint0x80_syscall() at Xint0x80_syscall+0x21 --- syscall (22, FreeBSD ELF32, unmount), eip = 0x280dcd5b, esp = 0xbfbfe64c, ebp = 0xbfbfe718 --- ** /dev/label/tmp ** Last Mounted on /tmp ** Phase 1 - Check Blocks and Sizes ** Phase 2 - Check Pathnames ** Phase 3 - Check Connectivity ** Phase 4 - Check Reference Counts ** Phase 5 - Check Cyl groups 301373 files, 26978970 used, 91335011 free (3139 frags, 11416484 blocks, 0.0% fragmentation) ***** FILE SYSTEM IS CLEAN ***** ** /dev/label/tmp ** Last Mounted on /tmp ** Phase 1 - Check Blocks and Sizes ** Phase 2 - Check Pathnames ** Phase 3 - Check Connectivity ** Phase 4 - Check Reference Counts ** Phase 5 - Check Cyl groups 301373 files, 26978970 used, 91335011 free (3139 frags, 11416484 blocks, 0.0% fragmentation) ***** FILE SYSTEM IS CLEAN ***** fsck -y /tmp watchdogd. Starting inetd. Thu Jun 9 18:41:17 CEST 2011 FreeBSD/i386 (x4.osted.lan) (console) login: Jun 9 18:48:13 x4 su: pho to root on /dev/pts/0 Jun 9 18:52:49 x4 su: pho to root on /dev/pts/0 lock order reversal: 1st 0xe07af3e0 bufwait (bufwait) @ kern/vfs_bio.c:2658 2nd 0xc6ecd81c snaplk (snaplk) @ ufs/ffs/ffs_snapshot.c:817 KDB: stack backtrace: db_trace_self_wrapper(c0e93696,632e746f,3731383a,ef2d000a,c09f76bb,...) at db_trace_self_wrapper+0x26 kdb_backtrace(c09e5dcb,c0e9709f,c6d5e2a0,c6d62748,ef2df50c,...) at kdb_backtrace+0x2a _witness_debugger(c0e9709f,c6ecd81c,c0ec2085,c6d62748,c0ec200f,...) at _witness_debugger+0x25 witness_checkorder(c6ecd81c,9,c0ec2006,331,c95f94d8,...) at witness_checkorder+0x839 __lockmgr_args(c6ecd81c,80400,c95f94d8,0,0,...) at __lockmgr_args+0x814 ffs_lock(ef2df630,e079f660,100000,80400,c95f9414,...) at ffs_lock+0xa1 VOP_LOCK1_APV(c0fc5960,ef2df630,e079f708,c0fe08e0,c95f9414,...) at VOP_LOCK1_APV+0xb5 _vn_lock(c95f9414,80400,c0ec2006,331,0,...) at _vn_lock+0x78 ffs_snapshot(c77362d4,c7405340,c0ec5490,174,ef2df980,...) at ffs_snapshot+0x2946 ffs_mount(c77362d4,c7408500,ff,393,0,...) at ffs_mount+0x1590 vfs_donmount(c7be0b80,213300,c7404580,c7404580,c786d834,...) at vfs_donmount+0x1147 nmount(c7be0b80,ef2dfcec,ef2dfd28,c0e958ea,0,...) at nmount+0x84 syscallenter(c7be0b80,ef2dfce4,ef2dfce4,0,0,...) at syscallenter+0x263 syscall(ef2dfd28) at syscall+0x4f Xint0x80_syscall() at Xint0x80_syscall+0x21 --- syscall (378, FreeBSD ELF32, nmount), eip = 0x280da9db, esp = 0xbfbfe0ac, ebp = 0xbfbfe828 --- Expensive timeout(9) function: 0xc099e5f0(0) 0.200058154 s ~KDB: enter: Line break on console [ thread pid 2479 tid 100089 ] Stopped at kdb_enter+0x3a: movl $0,kdb_why db> lock order reversal: lock order reversal: 1st 0xc95f9634 vnode interlock (vnode interlock) @ kern/vfs_subr.c:2140 1st 0xc95f9634 vnode interlock (vnode interlock) @ kern/vfs_subr.c:2140 2nd 0xc706f474 firewire (firewire) @ dev/firewire/fwohci.c:2117 2nd 0xc706f474 firewire (firewire) @ dev/firewire/fwohci.c:2117 KDB: stack backtrace: KDB: stack backtrace: db_trace_self_wrapper(c0e93696,63686f77,3a632e69,37313132,3a63000a,...) at db_trace_self_wrapper+0x26 kdb_backtrace(c09e5dcb,c0e9709f,c6d5b1e0,c6d600b0,ef1c9224,...) at kdb_backtrace+0x2a _witness_debugger(c0e9709f,c706f474,c0e2a93a,c6d600b0,c0e2a022,...) at _witness_debugger+0x25 witness_checkorder(c706f474,9,c0e2a019,845,0,...) at witness_checkorder+0x839 _mtx_lock_flags(c706f474,0,c0e2a019,845,c6d7cba0,...) at _mtx_lock_flags+0xc4 fwohci_poll(c706b000,ffffffff,ffffffff,ef1c92a8,c064727e,...) at fwohci_poll+0x35 dcons_crom_poll(c6fea000,0,c0e22245,c1,c0fed9a0,...) at dcons_crom_poll+0x25 dcons_os_checkc(ef1c92c0,c09695ea,c0f485a0,78,ef1c92c8,...) at dcons_os_checkc+0xae dcons_cngetc(c0f485a0,78,ef1c92c8,c0969626,ef1c92e8,...) at dcons_cngetc+0xe cncheckc(ef1c92e8,c04e0015,c0d16113,c04e12c0,ef1c92e4,...) at cncheckc+0x3a cngetc(c0d16113,c04e12c0,ef1c92e4,ef1c9320,c0ef5920,...) at cngetc+0x16 db_readline(c0fe36e0,78,ef1c9304,c04deb06,c0d16113,...) at db_readline+0x75 db_read_line(c0d16113,ef1c9358,c04e0b0d,c0d1643e,fb,...) at db_read_line+0x1a db_command_loop(c0d1643e,fb,3,0,0,...) at db_command_loop+0x46 db_trap(3,0,1,46,e,...) at db_trap+0xdd kdb_trap(3,0,ef1c9420,ef1c93a0,c7024834,...) at kdb_trap+0x92 trap(ef1c9420) at trap+0x66b calltrap() at calltrap+0x6 --- trap 0x3, eip = 0xc09e15fa, esp = 0xef1c9460, ebp = 0xef1c9468 --- kdb_enter(c0d1643e,c0e595b0,0,c716a080,0,...) at kdb_enter+0x3a uart_intr(c716a000,c6d5b1e0,c6d61f28,c,0,...) at uart_intr+0x126 intr_event_handle(c6d88800,ef1c9500,ef1c94d8,c74a68a0,c95f9634,...) at intr_event_handle+0x76 intr_execute_handlers(c6e020d0,ef1c9500,0,ef1c955c,c0cc25f5,...) at intr_execute_handlers+0x49 lapic_handle_intr(3b,ef1c9500) at lapic_handle_intr+0x36 Xapic_isr1() at Xapic_isr1+0x35 --- interrupt, eip = 0xc099d27e, esp = 0xef1c9540, ebp = 0xef1c955c --- _mtx_unlock_flags(c95f9634,0,c0e9ecb2,86b,c95f9634,...) at _mtx_unlock_flags+0x9e vget(c95f9570,80100,c74a68a0,419,c77362d4,...) at vget+0x1b3 qsync(c77362d4,ef1c9614,c74a68a0,574,0,...) at qsync+0x19d ffs_sync(c77362d4,1,277,c0ea0542,0,...) at ffs_sync+0x584 vfs_write_suspend(c77362d4,ef1c98b8,0,4000,c6da0000,...) at vfs_write_suspend+0x122 ffs_snapshot(c77362d4,c7405320,c0ec5490,174,ef1c9980,...) at ffs_snapshot+0xc91 ffs_mount(c77362d4,c7beb800,ff,393,0,...) at ffs_mount+0x1590 vfs_donmount(c74a68a0,213300,c7b3cc80,c7b3cc80,c7024834,...) at vfs_donmount+0x1147 nmount(c74a68a0,ef1c9cec,ef1c9d28,c0e958ea,0,...) at nmount+0x84 syscallenter(c74a68a0,ef1c9ce4,ef1c9ce4,0,74b,...) at syscallenter+0x263 syscall(ef1c9d28) at syscall+0x4f Xint0x80_syscall() at Xint0x80_syscall+0x21 --- syscall (378, FreeBSD ELF32, nmount), eip = 0x280da9db, esp = 0xbfbfe0ac, ebp = 0xbfbfe828 --- ~ db> run pho db:0:pho> bt Tracing pid 2479 tid 100089 td 0xc74a68a0 kdb_enter(c0d1643e,c0e595b0,0,c716a080,0,...) at kdb_enter+0x3a uart_intr(c716a000,c6d5b1e0,c6d61f28,c,0,...) at uart_intr+0x126 intr_event_handle(c6d88800,ef1c9500,ef1c94d8,c74a68a0,c95f9634,...) at intr_event_handle+0x76 intr_execute_handlers(c6e020d0,ef1c9500,0,ef1c955c,c0cc25f5,...) at intr_execute_handlers+0x49 lapic_handle_intr(3b,ef1c9500) at lapic_handle_intr+0x36 Xapic_isr1() at Xapic_isr1+0x35 --- interrupt, eip = 0xc099d27e, esp = 0xef1c9540, ebp = 0xef1c955c --- _mtx_unlock_flags(c95f9634,0,c0e9ecb2,86b,c95f9634,...) at _mtx_unlock_flags+0x9e vget(c95f9570,80100,c74a68a0,419,c77362d4,...) at vget+0x1b3 qsync(c77362d4,ef1c9614,c74a68a0,574,0,...) at qsync+0x19d ffs_sync(c77362d4,1,277,c0ea0542,0,...) at ffs_sync+0x584 vfs_write_suspend(c77362d4,ef1c98b8,0,4000,c6da0000,...) at vfs_write_suspend+0x122 ffs_snapshot(c77362d4,c7405320,c0ec5490,174,ef1c9980,...) at ffs_snapshot+0xc91 ffs_mount(c77362d4,c7beb800,ff,393,0,...) at ffs_mount+0x1590 vfs_donmount(c74a68a0,213300,c7b3cc80,c7b3cc80,c7024834,...) at vfs_donmount+0x1147 nmount(c74a68a0,ef1c9cec,ef1c9d28,c0e958ea,0,...) at nmount+0x84 syscallenter(c74a68a0,ef1c9ce4,ef1c9ce4,0,74b,...) at syscallenter+0x263 syscall(ef1c9d28) at syscall+0x4f Xint0x80_syscall() at Xint0x80_syscall+0x21 --- syscall (378, FreeBSD ELF32, nmount), eip = 0x280da9db, esp = 0xbfbfe0ac, ebp = 0xbfbfe828 --- db:0:bt> show allpcpu Current CPU: 0 cpuid = 0 dynamic pcpu = 0x444000 curthread = 0xc74a68a0: pid 2479 "mksnap_ffs" curpcb = 0xef1c9d80 fpcurthread = none idlethread = 0xc6dbe8a0: tid 100003 "idle: cpu0" APIC ID = 0 currentldt = 0x50 spin locks held: cpuid = 1 dynamic pcpu = 0x5b49000 curthread = 0xc6dbe5c0: pid 11 "idle: cpu1" curpcb = 0xc6b3dd80 fpcurthread = none idlethread = 0xc6dbe5c0: tid 100004 "idle: cpu1" APIC ID = 1 currentldt = 0x50 spin locks held: cpuid = 2 dynamic pcpu = 0x5b4c000 curthread = 0xc6dbe2e0: pid 11 "idle: cpu2" curpcb = 0xc6b40d80 fpcurthread = none idlethread = 0xc6dbe2e0: tid 100005 "idle: cpu2" APIC ID = 2 currentldt = 0x50 spin locks held: cpuid = 3 dynamic pcpu = 0x5b4f000 curthread = 0xc6e04000: pid 12 "swi4: clock" curpcb = 0xc6b4dd80 fpcurthread = none idlethread = 0xc6dbe000: tid 100006 "idle: cpu3" APIC ID = 3 currentldt = 0x50 spin locks held: db:0:allpcpu> show alllocks Process 2524 (sshd) thread 0xc74a8000 (100083) exclusive sx so_rcv_sx (so_rcv_sx) r = 0 (0xc997bd8c) locked @ kern/uipc_sockbuf.c:148 Process 2482 (sshd) thread 0xc97bc2e0 (100177) exclusive sx so_rcv_sx (so_rcv_sx) r = 0 (0xc785b70c) locked @ kern/uipc_sockbuf.c:148 Process 2481 (sshd) thread 0xc97bc000 (100178) exclusive sx so_rcv_sx (so_rcv_sx) r = 0 (0xc776a22c) locked @ kern/uipc_sockbuf.c:148 Process 2480 (sshd) thread 0xc97bbb80 (100179) exclusive sx so_rcv_sx (so_rcv_sx) r = 0 (0xc776a3cc) locked @ kern/uipc_sockbuf.c:148 Process 2479 (mksnap_ffs) thread 0xc74a68a0 (100089) exclusive sleep mutex vnode interlock (vnode interlock) r = 0 (0xc95f9634) locked @ kern/vfs_subr.c:2140 exclusive lockmgr ufs (ufs) r = 0 (0xc95f95c8) locked @ kern/vfs_subr.c:2132 exclusive sleep mutex Giant (Giant) r = 0 (0xc101b570) locked @ kern/vfs_mount.c:1068 Process 2313 (sshd) thread 0xc7f5e5c0 (100157) exclusive sx so_rcv_sx (so_rcv_sx) r = 0 (0xc776abec) locked @ kern/uipc_sockbuf.c:148 db:0:alllocks> show lockedvnods Locked vnodes 0xc95f9570: 0xc95f9570: tag ufs, type VDIR tag ufs, type VDIR usecount 2, writecount 0, refcount 5 mountedhere 0 usecount 2, writecount 0, refcount 5 mountedhere 0 flags () flags () VI_LOCKed VI_LOCKed v_object 0xc7f447f8 ref 0 pages 1 v_object 0xc7f447f8 ref 0 pages 1 lock type ufs: EXCL by thread 0xc74a68a0 (pid 2479) lock type ufs: EXCL by thread 0xc74a68a0 (pid 2479) #0 0xc099548e at __lockmgr_args+0xbfe #0 0xc099548e at __lockmgr_args+0xbfe #1 0xc0be7391 at ffs_lock+0xa1 #1 0xc0be7391 at ffs_lock+0xa1 #2 0xc0cfb5e5 at VOP_LOCK1_APV+0xb5 #2 0xc0cfb5e5 at VOP_LOCK1_APV+0xb5 #3 0xc0a553d8 at _vn_lock+0x78 #3 0xc0a553d8 at _vn_lock+0x78 #4 0xc0a4853b at vget+0xbb #4 0xc0a4853b at vget+0xbb #5 0xc0bf3cad at qsync+0x19d #5 0xc0bf3cad at qsync+0x19d #6 0xc0be2b34 at ffs_sync+0x584 #6 0xc0be2b34 at ffs_sync+0x584 #7 0xc0a551b2 at vfs_write_suspend+0x122 #7 0xc0a551b2 at vfs_write_suspend+0x122 #8 0xc0bc79b1 at ffs_snapshot+0xc91 #8 0xc0bc79b1 at ffs_snapshot+0xc91 #9 0xc0be4780 at ffs_mount+0x1590 #9 0xc0be4780 at ffs_mount+0x1590 #10 0xc0a3ec07 at vfs_donmount+0x1147 #10 0xc0a3ec07 at vfs_donmount+0x1147 #11 0xc0a3f274 at nmount+0x84 #11 0xc0a3f274 at nmount+0x84 #12 0xc09f0083 at syscallenter+0x263 #12 0xc09f0083 at syscallenter+0x263 #13 0xc0cd8bcf at syscall+0x4f #13 0xc0cd8bcf at syscall+0x4f #14 0xc0cc2291 at Xint0x80_syscall+0x21 #14 0xc0cc2291 at Xint0x80_syscall+0x21 ino 3, on dev md5a ino 3, on dev md5a db:0:lockedvnods> show mount 0xc73f5b50 /dev/ad4s1a on / (ufs) 0xc73f6000 devfs on /dev (devfs) 0xc77365a8 /dev/ad4s1f on /home (ufs) 0xc7737b50 /dev/ad4s1d on /usr (ufs) 0xc773787c /dev/ad4s1e on /var (ufs) 0xc77375a8 procfs on /proc (procfs) 0xc77372d4 /dev/label/tmp on /tmp (ufs) 0xc77362d4 /dev/md5a on /mnt (ufs) More info: show mount db:0:mount> ps pid ppid pgrp uid state wmesg wchan cmd 5713 2492 2488 1001 S nanslp 0xc101ce84 sleep 2529 2528 2529 1001 Ss+ ttyin 0xc7791a70 bash 2528 2524 2524 1001 S select 0xc74642a4 sshd 2527 2526 2179 0 D suspfs 0xc773631c ls 2526 2179 2179 0 S wait 0xc97b9834 sh 2524 2110 2524 0 Ss sbwait 0xc997bdb8 sshd 2493 2488 2488 1001 S piperd 0xc7c11000 awk 2492 2488 2488 1001 S wait 0xc9960af0 sh 2491 2489 2491 1001 Ss+ select 0xc7872624 top 2490 2487 2490 1001 Ss kqread 0xc7e1eb80 tail 2489 2481 2481 1001 S select 0xc74648e4 sshd 2488 2486 2488 1001 Ss wait 0xc7f1a2bc sh 2487 2482 2482 1001 S select 0xc7872664 sshd 2486 2480 2480 1001 S select 0xc7464864 sshd 2482 2110 2482 0 Ss sbwait 0xc785b738 sshd 2481 2110 2481 0 Ss sbwait 0xc776a258 sshd 2480 2110 2480 0 Ss sbwait 0xc776a3f8 sshd 2479 2408 2408 0 R+ CPU 0 mksnap_ffs 2473 2468 2436 1001 S+ suspfs 0xc773631c creat 2472 2468 2436 1001 S+ suspfs 0xc773631c creat 2471 2468 2436 1001 S+ suspfs 0xc773631c creat 2470 2468 2436 1001 S+ suspfs 0xc773631c creat 2469 2468 2436 1001 S+ suspfs 0xc773631c creat 2468 2445 2436 1001 S+ wait 0xc97b7af0 creat 2467 2447 2436 1001 S+ suspfs 0xc773631c mkdir 2466 2447 2436 1001 S+ suspfs 0xc773631c mkdir 2465 2448 2436 1001 S+ suspfs 0xc773631c rw 2464 2447 2436 1001 S+ suspfs 0xc773631c mkdir 2463 2448 2436 1001 S+ suspfs 0xc773631c rw 2462 2447 2436 1001 S+ suspfs 0xc773631c mkdir 2461 2448 2436 1001 S+ suspfs 0xc773631c rw 2460 2447 2436 1001 S+ suspfs 0xc773631c mkdir 2459 2448 2436 1001 S+ suspfs 0xc773631c rw 2458 2447 2436 1001 S+ suspfs 0xc773631c mkdir 2457 2448 2436 1001 S+ suspfs 0xc773631c rw 2456 2447 2436 1001 S+ suspfs 0xc773631c mkdir 2455 2448 2436 1001 S+ suspfs 0xc773631c rw 2454 2447 2436 1001 S+ suspfs 0xc773631c mkdir 2453 2448 2436 1001 S+ suspfs 0xc773631c rw 2452 2448 2436 1001 S+ suspfs 0xc773631c rw 2451 2447 2436 1001 S+ suspfs 0xc773631c mkdir 2450 2448 2436 1001 S+ suspfs 0xc773631c rw 2449 2447 2436 1001 S+ suspfs 0xc773631c mkdir 2448 2444 2436 1001 S+ wait 0xc745d578 rw 2447 2446 2436 1001 S+ wait 0xc74282bc mkdir 2446 2443 2436 1001 S+ wait 0xc786c000 mkdir 2445 2443 2436 1001 S+ wait 0xc7b55578 creat 2444 2443 2436 1001 S+ wait 0xc7b552bc rw 2443 2442 2436 1001 S+ wait 0xc97b6000 run 2442 2441 2436 1001 S+ wait 0xc7b52af0 run 2441 2436 2436 1001 S+ wait 0xc97b62bc run 2436 2432 2436 1001 S+ wait 0xc97b72bc sh 2432 2408 2408 0 S+ wait 0xc97b7834 su 2421 0 0 0 DL mdwait 0xc95ec000 [md5] 2408 2353 2408 0 S+ wait 0xc7f19578 sh 2353 2349 2353 0 S+ wait 0xc7f182bc bash 2349 2348 2349 0 S+ pause 0xc776588c csh 2348 2316 2348 1001 S+ wait 0xc7f18000 su 2316 2315 2316 1001 Ss+ wait 0xc7428834 bash 2315 2313 2313 1001 S select 0xc7b472a4 sshd 2313 2110 2313 0 Ss sbwait 0xc776ac18 sshd 2251 1 2251 0 Ss+ ttyin 0xc7181070 getty 2250 1 2250 0 Ss+ ttyin 0xc7181270 getty 2249 1 2249 0 Ss+ ttyin 0xc7181470 getty 2248 1 2248 0 Ss+ ttyin 0xc6f59070 getty 2247 1 2247 0 Ss+ ttyin 0xc6f59270 getty 2246 1 2246 0 Ss+ ttyin 0xc6f59470 getty 2245 1 2245 0 Ss+ ttyin 0xc6f59670 getty 2244 1 2244 0 Ss+ ttyin 0xc6f59870 getty 2243 1 2243 0 Ss+ ttyin 0xc6f59a70 getty 2203 1 2203 0 Ss select 0xc74649e4 inetd 2179 1 2179 0 Ss wait 0xc7024af0 watchdogd 2132 1 2132 0 Ss nanslp 0xc101ce84 cron 2124 1 2124 25 Ss pause 0xc7b52314 sendmail 2118 1 2118 0 Ss select 0xc7463c64 sendmail 2110 1 2110 0 Ss select 0xc7464aa4 sshd 2050 1 2050 0 Ss select 0xc7464ae4 moused 1990 1 1990 0 Ss select 0xc7b472e4 ntpd 1874 1873 1873 0 S (threaded) nfsd 100125 S rpcsvc 0xc74b35d0 nfsd: service 100124 S rpcsvc 0xc74b3610 nfsd: service 100123 S rpcsvc 0xc74b3650 nfsd: service 100122 S rpcsvc 0xc74de3d0 nfsd: master 1873 1 1873 0 Ss select 0xc7872164 nfsd 1863 1 1863 0 Ss select 0xc7b476e4 mountd 1764 1 1764 0 Ss select 0xc7463d24 rpcbind 1717 1 1717 0 Ss select 0xc78722a4 syslogd 1516 1 1516 0 Ss select 0xc78722e4 devd 18 0 0 0 DL sdflush 0xc1199680 [softdepflush] 17 0 0 0 DL syncer 0xc1193074 [syncer] 16 0 0 0 DL vlruwt 0xc73a1834 [vnlru] 9 0 0 0 DL psleep 0xc1192d08 [bufdaemon] 8 0 0 0 DL pgzero 0xc119b4dc [pagezero] 7 0 0 0 DL psleep 0xc119b0c8 [vmdaemon] 6 0 0 0 DL psleep 0xc119b090 [pagedaemon] 5 0 0 0 DL ccb_scan 0xc0fe1d54 [xpt_thrd] 4 0 0 0 DL waiting_ 0xc1194b98 [sctp_iterator] 3 0 0 0 DL - 0xc6fe9e3c [fdc0] 2 0 0 0 SL - 0xc706b000 [fw0_probe] 15 0 0 0 DL (threaded) [usb] 100057 D - 0xc704cd34 [usbus5] 100056 D - 0xc704cd04 [usbus5] 100055 D - 0xc704ccd4 [usbus5] 100054 D - 0xc704cca4 [usbus5] 100052 D - 0xc703eb5c [usbus4] 100051 D - 0xc703eb2c [usbus4] 100050 D - 0xc703eafc [usbus4] 100049 D - 0xc703eacc [usbus4] 100048 D - 0xc7038b5c [usbus3] 100047 D - 0xc7038b2c [usbus3] 100046 D - 0xc7038afc [usbus3] 100045 D - 0xc7038acc [usbus3] 100044 D - 0xc702fb5c [usbus2] 100043 D - 0xc702fb2c [usbus2] 100042 D - 0xc702fafc [usbus2] 100041 D - 0xc702facc [usbus2] 100039 D - 0xc7028b5c [usbus1] 100038 D - 0xc7028b2c [usbus1] 100037 D - 0xc7028afc [usbus1] 100036 D - 0xc7028acc [usbus1] 100034 D - 0xc701fb5c [usbus0] 100033 D - 0xc701fb2c [usbus0] 100032 D - 0xc701fafc [usbus0] 100031 D - 0xc701facc [usbus0] 14 0 0 0 DL - 0xc101bc84 [yarrow] 13 0 0 0 DL (threaded) [geom] 100015 D - 0xc10198a8 [g_down] 100014 D - 0xc10198a4 [g_up] 100013 D - 0xc101989c [g_event] 12 0 0 0 RL (threaded) [intr] 100065 I [irq12: psm0] 100064 I [irq1: atkbd0] 100062 I [swi0: uart] 100059 I [irq20: fwohci0] 100058 I [irq14: ata0] 100053 I [irq19: ehci0] 100040 I [irq18: ohci2 ohci4] 100035 I [irq17: ohci1 ohci3] 100030 I [irq16: ohci0] 100029 I [irq22: ahci0] 100028 I [irq256: re0] 100027 I [swi2: cambio] 100022 I [swi6: task queue] 100020 I [swi6: Giant taskq] 100018 I [swi5: +] 100012 I [swi4: clock] 100011 I [swi4: clock] 100010 I [swi4: clock] 100009 Run CPU 3 [swi4: clock] 100008 I [swi1: netisr 0] 100007 I [swi3: vm] 11 0 0 0 RL (threaded) [idle] 100006 CanRun [idle: cpu3] 100005 Run CPU 2 [idle: cpu2] 100004 Run CPU 1 [idle: cpu1] 100003 CanRun [idle: cpu0] 1 0 1 0 SLs wait 0xc6dbcaf0 [init] 10 0 0 0 DL audit_wo 0xc1198e00 [audit] 0 0 0 0 DLs (threaded) [kernel] 100076 D - 0xc73729c0 [mca taskq] 100066 D - 0xc101bc84 [deadlkres] 100060 D - 0xc7034480 [fw0_taskq] 100026 D - 0xc6f50500 [acpi_task_2] 100025 D - 0xc6f50500 [acpi_task_1] 100024 D - 0xc6f50500 [acpi_task_0] 100023 D - 0xc6f50540 [kqueue taskq] 100021 D - 0xc6f505c0 [ffs_trim taskq] 100019 D - 0xc6f50640 [thread taskq] 100016 D - 0xc6d78b40 [firmware taskq] 100000 D sched 0xc1019980 [swapper] db:0:ps> allt Tracing command sleep pid 5713 tid 100240 td 0xc99fc8a0 sched_switch(c99fc8a0,0,104,191,9b6baec,...) at sched_switch+0x3bc mi_switch(104,0,c0e94f60,1f3,6c,...) at mi_switch+0x1eb sleepq_switch(c99fc8a0,0,c0e94f60,1a7,6c,...) at sleepq_switch+0x162 sleepq_catch_signals(2711,c09ec5a0,c99fc8a0,3,100,...) at sleepq_catch_signals+0xf9 sleepq_timedwait_sig(c101ce84,6c,c0e90cb7,100,0,...) at sleepq_timedwait_sig+0x1a _sleep(c101ce84,0,16c,c0e90cb7,2711,...) at _sleep+0x328 kern_nanosleep(c99fc8a0,ef42cc34,ef42cc3c,a,0,...) at kern_nanosleep+0xc1 nanosleep(c99fc8a0,ef42ccec,ef42cd28,c0e958ea,0,...) at nanosleep+0x6f syscallenter(c99fc8a0,ef42cce4,ef42cce4,0,0,...) at syscallenter+0x263 syscall(ef42cd28) at syscall+0x4f Xint0x80_syscall() at Xint0x80_syscall+0x21 --- syscall (240, FreeBSD ELF32, nanosleep), eip = 0x28165b77, esp = 0xbfbfec5c, ebp = 0xbfbfeca8 --- Tracing command bash pid 2529 tid 100197 td 0xc99698a0 sched_switch(c99698a0,0,104,191,a1c19ea,...) at sched_switch+0x3bc mi_switch(104,0,c0e94f60,1f3,0,...) at mi_switch+0x1eb sleepq_switch(c99698a0,0,c0e94f60,1a7,0,...) at sleepq_switch+0x162 sleepq_catch_signals(c099d34a,c7791a04,0,c0e8dd67,c99698a0,...) at sleepq_catch_signals+0xf9 sleepq_wait_sig(c7791a70,0,ef3a0ad8,101,0,...) at sleepq_wait_sig+0x17 _cv_wait_sig(c7791a70,c7791a04,c0e9961c,514,0,...) at _cv_wait_sig+0x243 tty_wait(c7791a00,c7791a70,ef3a0c28,1,0,...) at tty_wait+0x71 ttydisc_read(c7791a00,ef3a0c28,0,9f,0,...) at ttydisc_read+0x22c ttydev_read(c7beb200,ef3a0c28,0,0,1,...) at ttydev_read+0xaa devfs_read_f(c7868b28,ef3a0c28,c7e1ee00,0,c99698a0,...) at devfs_read_f+0x7e dofileread(ef3a0c28,ffffffff,ffffffff,0,c7868b28,...) at dofileread+0x9e kern_readv(c99698a0,0,ef3a0c28,ef3a0c48,1,...) at kern_readv+0x58 read(c99698a0,ef3a0cec,ef3a0d28,c0e958ea,0,...) at read+0x4f syscallenter(c99698a0,ef3a0ce4,ef3a0ce4,0,0,...) at syscallenter+0x263 syscall(ef3a0d28) at syscall+0x4f Xint0x80_syscall() at Xint0x80_syscall+0x21 --- syscall (3, FreeBSD ELF32, read), eip = 0x28354643, esp = 0xbfbfdfcc, ebp = 0xbfbfdff8 --- Tracing command sshd pid 2528 tid 100146 td 0xc7b5c2e0 sched_switch(c7b5c2e0,0,104,191,a1e1068,...) at sched_switch+0x3bc mi_switch(104,0,c0e94f60,1f3,0,...) at mi_switch+0x1eb sleepq_switch(c7b5c2e0,0,c0e94f60,1a7,0,...) at sleepq_switch+0x162 sleepq_catch_signals(c099d34a,c7464290,0,c0e8dd67,c7b5c2e0,...) at sleepq_catch_signals+0xf9 sleepq_wait_sig(c74642a4,0,ef2faa4c,101,0,...) at sleepq_wait_sig+0x17 _cv_wait_sig(c74642a4,c7464290,c0e975b1,627,c74b0bd0,...) at _cv_wait_sig+0x243 seltdwait(c74b0bd0,58,c7e1e980,c7b5c2e0,246,...) at seltdwait+0xa2 kern_select(c7b5c2e0,c,288060b4,288060bc,0,0,20,c7b542bc,c7b542bc) at kern_select+0x504 select(c7b5c2e0,ef2facec,ef2fad28,c0e958ea,0,...) at select+0x66 syscallenter(c7b5c2e0,ef2face4,ef2face4,0,c1029b00,...) at syscallenter+0x263 syscall(ef2fad28) at syscall+0x4f Xint0x80_syscall() at Xint0x80_syscall+0x21 --- syscall (93, FreeBSD ELF32, select), eip = 0x284c45c3, esp = 0xbfbfe19c, ebp = 0xbfbfe1e8 --- Tracing command ls pid 2527 tid 100196 td 0xc9969b80 sched_switch(c9969b80,0,104,191,1a2f81fa,...) at sched_switch+0x3bc mi_switch(104,0,c0e94f60,1f3,77,...) at mi_switch+0x1eb sleepq_switch(c9969b80,0,c0e94f60,268,0,...) at sleepq_switch+0x162 sleepq_wait(c773631c,77,c0ea053b,0,0,...) at sleepq_wait+0x63 _sleep(c773631c,c77362d4,77,c0ea053b,0,...) at _sleep+0x372 vn_start_write(c88de414,ef39db30,1,c0cf7cf5,0,...) at vn_start_write+0xdd vn_close(c88de414,5,c6d9fe00,c9969b80,c9969b80,...) at vn_close+0x87 vn_closefile(c78738f8,c9969b80,3,0,c78738f8,...) at vn_closefile+0xe4 _fdrop(c78738f8,c9969b80,ef39dbe8,c09f775c,0,c9969c30,c0fac060,c1164228,c0e8924d,c9969b80,c97ba32c,4ab,ef39dc10,c09b5087,c97ba32c,8,c0e89244,4ab) at _fdrop+0x43 closef(c78738f8,c9969b80,4ab,490,c97ba32c,...) at closef+0x290 kern_close(c9969b80,7,ef39dc7c,c09f0083,c9969b80,...) at kern_close+0x117 close(c9969b80,ef39dcec,ef39dd28,c0e958ea,0,...) at close+0x1a syscallenter(c9969b80,ef39dce4,ef39dce4,0,0,...) at syscallenter+0x263 syscall(ef39dd28) at syscall+0x4f Xint0x80_syscall() at Xint0x80_syscall+0x21 --- syscall (6, FreeBSD ELF32, close), eip = 0x281d7603, esp = 0xbfbfe5ec, ebp = 0xbfbfe608 --- Tracing command sh pid 2526 tid 100195 td 0xc996a000 sched_switch(c996a000,0,104,191,191cfb90,...) at sched_switch+0x3bc mi_switch(104,0,c0e94f60,1f3,6c,...) at mi_switch+0x1eb sleepq_switch(c996a000,0,c0e94f60,1a7,6c,...) at sleepq_switch+0x162 sleepq_catch_signals(c0e94f60,160,0,100,100,...) at sleepq_catch_signals+0xf9 sleepq_wait_sig(c97b9834,6c,c0e97d3e,100,0,...) at sleepq_wait_sig+0x17 _sleep(c97b9834,c97b98bc,16c,c0e97d3e,0,...) at _sleep+0x35c kern_wait(c996a000,ffffffff,ef39ac44,2,0,...) at kern_wait+0xbe6 wait4(c996a000,ef39acec,2820fd28,1,0,...) at wait4+0x3b syscallenter(c996a000,ef39ace4,c0cd942d,c101b570,0,...) at syscallenter+0x263 syscall(ef39ad28) at syscall+0x4f Xint0x80_syscall() at Xint0x80_syscall+0x21 --- syscall (7, FreeBSD ELF32, wait4), eip = 0x2816a93b, esp = 0xbfbfeb1c, ebp = 0xbfbfeb38 --- Tracing command sshd pid 2524 tid 100083 td 0xc74a8000 sched_switch(c74a8000,0,104,191,9c5d98f6,...) at sched_switch+0x3bc mi_switch(104,0,c0e94f60,1f3,68,...) at mi_switch+0x1eb sleepq_switch(c74a8000,0,c0e94f60,1a7,68,...) at sleepq_switch+0x162 sleepq_catch_signals(c0e94f60,160,0,100,100,...) at sleepq_catch_signals+0xf9 sleepq_wait_sig(c997bdb8,68,c0e9b401,100,0,...) at sleepq_wait_sig+0x17 _sleep(c997bdb8,c997bd78,168,c0e9b401,0) at _sleep+0x35c sbwait(c997bd54,4,c0e9b4d9,5ec,c997bd78,...) at sbwait+0x76 soreceive_generic(c997bd00,0,ef1b1c28,0,0,...) at soreceive_generic+0x3f0 soreceive(c997bd00,0,ef1b1c28,0,0,0) at soreceive+0x38 soo_read(c7868e00,ef1b1c28,c7e1ea00,0,c74a8000,...) at soo_read+0x4e dofileread(ef1b1c28,ffffffff,ffffffff,0,c7868e00,...) at dofileread+0x9e kern_readv(c74a8000,5,ef1b1c28,ef1b1c48,1,...) at kern_readv+0x58 read(c74a8000,ef1b1cec,ef1b1d28,c0e958ea,0,...) at read+0x4f syscallenter(c74a8000,ef1b1ce4,ef1b1ce4,0,0,...) at syscallenter+0x263 syscall(ef1b1d28) at syscall+0x4f Xint0x80_syscall() at Xint0x80_syscall+0x21 --- syscall (3, FreeBSD ELF32, read), eip = 0x284c4643, esp = 0xbfbfdd3c, ebp = 0xbfbfdd78 --- Tracing command awk pid 2493 tid 100185 td 0xc7f5f8a0 sched_switch(c7f5f8a0,0,104,191,978b065,...) at sched_switch+0x3bc mi_switch(104,0,c0e94f60,1f3,5c,...) at mi_switch+0x1eb sleepq_switch(c7f5f8a0,0,c0e94f60,1a7,5c,...) at sleepq_switch+0x162 sleepq_catch_signals(c0e94f60,160,0,100,100,...) at sleepq_catch_signals+0xf9 sleepq_wait_sig(c7c11000,5c,c0e9776f,100,0,...) at sleepq_wait_sig+0x17 _sleep(c7c11000,c7c11170,15c,c0e9776f,0,...) at _sleep+0x35c pipe_read(c7878ce8,ef37cc28,c73f7900,0,c7f5f8a0,...) at pipe_read+0x417 dofileread(ef37cc28,ffffffff,ffffffff,0,c7878ce8,...) at dofileread+0x9e kern_readv(c7f5f8a0,0,ef37cc28,ef37cc48,1,...) at kern_readv+0x58 read(c7f5f8a0,ef37ccec,ef37cd80,ef37cc88,0,...) at read+0x4f syscallenter(c7f5f8a0,ef37cce4,c0cd90e6,0,0,...) at syscallenter+0x263 syscall(ef37cd28) at syscall+0x4f Xint0x80_syscall() at Xint0x80_syscall+0x21 --- syscall (3, FreeBSD ELF32, read), eip = 0x281b8643, esp = 0xbfbfe93c, ebp = 0xbfbfe958 --- Tracing command sh pid 2492 tid 100184 td 0xc7f5fb80 sched_switch(c7f5fb80,0,104,191,98d2a63,...) at sched_switch+0x3bc mi_switch(104,0,c0e94f60,1f3,6c,...) at mi_switch+0x1eb sleepq_switch(c7f5fb80,0,c0e94f60,1a7,6c,...) at sleepq_switch+0x162 sleepq_catch_signals(c0e94f60,160,0,100,100,...) at sleepq_catch_signals+0xf9 sleepq_wait_sig(c9960af0,6c,c0e97d3e,100,0,...) at sleepq_wait_sig+0x17 _sleep(c9960af0,c9960b78,16c,c0e97d3e,0,...) at _sleep+0x35c kern_wait(c7f5fb80,ffffffff,ef379c44,2,0,...) at kern_wait+0xbe6 wait4(c7f5fb80,ef379cec,ef379d28,c0e958ea,0,...) at wait4+0x3b syscallenter(c7f5fb80,ef379ce4,ef379ce4,0,0,...) at syscallenter+0x263 syscall(ef379d28) at syscall+0x4f Xint0x80_syscall() at Xint0x80_syscall+0x21 --- syscall (7, FreeBSD ELF32, wait4), eip = 0x2816a93b, esp = 0xbfbfe98c, ebp = 0xbfbfe9a8 --- Tracing command top pid 2491 tid 100183 td 0xc97bb000 sched_switch(c97bb000,0,104,191,e24437f,...) at sched_switch+0x3bc mi_switch(104,0,c0e94f60,1f3,0,...) at mi_switch+0x1eb sleepq_switch(c97bb000,0,c0e94f60,1a7,0,...) at sleepq_switch+0x162 sleepq_catch_signals(ef376a14,c099d34a,c7872610,0,c97bb000,...) at sleepq_catch_signals+0xf9 sleepq_timedwait_sig(c7872624,0,ef376a4c,101,0,...) at sleepq_timedwait_sig+0x1a _cv_timedwait_sig(c7872624,c7872610,3e9,627,c74b0d58,...) at _cv_timedwait_sig+0x252 seltdwait(ef376bf8,ef376c00,c701cd80,c97bb000,39324830,...) at seltdwait+0x8a kern_select(c97bb000,2,bfbfebac,0,0,ef376c40,20,1,0) at kern_select+0x504 select(c97bb000,ef376cec,ef376d28,c0e958ea,0,...) at select+0x66 syscallenter(c97bb000,ef376ce4,ef376ce4,0,0,...) at syscallenter+0x263 syscall(ef376d28) at syscall+0x4f Xint0x80_syscall() at Xint0x80_syscall+0x21 --- syscall (93, FreeBSD ELF32, select), eip = 0x281ee5c3, esp = 0xbfbfeb4c, ebp = 0xbfbfeca8 --- Tracing command tail pid 2490 tid 100182 td 0xc97bb2e0 sched_switch(c97bb2e0,0,104,191,f8751fe3,...) at sched_switch+0x3bc mi_switch(104,0,c0e94f60,1f3,68,...) at mi_switch+0x1eb sleepq_switch(c97bb2e0,0,c0e94f60,1a7,68,...) at sleepq_switch+0x162 sleepq_catch_signals(3e9,c09ec5a0,c97bb2e0,0,100,...) at sleepq_catch_signals+0xf9 sleepq_timedwait_sig(c7e1eb80,68,c0e89cdc,100,0,...) at sleepq_timedwait_sig+0x1a _sleep(c7e1eb80,c7e1eb80,168,c0e89cdc,3e9,...) at _sleep+0x328 kern_kevent(c97bb2e0,4,0,1,ef373c28,...) at kern_kevent+0x364 kevent(c97bb2e0,ef373cec,ef373d28,c0e958ea,0,...) at kevent+0x19e syscallenter(c97bb2e0,ef373ce4,ef373ce4,0,74b,...) at syscallenter+0x263 syscall(ef373d28) at syscall+0x4f Xint0x80_syscall() at Xint0x80_syscall+0x21 --- syscall (363, FreeBSD ELF32, kevent), eip = 0x28169cab, esp = 0xbfbfeb1c, ebp = 0xbfbfebd8 --- Tracing command sshd pid 2489 tid 100153 td 0xc7f5f2e0 sched_switch(c7f5f2e0,0,104,191,e2649f7,...) at sched_switch+0x3bc mi_switch(104,0,c0e94f60,1f3,0,...) at mi_switch+0x1eb sleepq_switch(c7f5f2e0,0,c0e94f60,1a7,0,...) at sleepq_switch+0x162 sleepq_catch_signals(c099d34a,c74648d0,0,c0e8dd67,c7f5f2e0,...) at sleepq_catch_signals+0xf9 sleepq_wait_sig(c74648e4,0,ef31ba4c,101,0,...) at sleepq_wait_sig+0x17 _cv_wait_sig(c74648e4,c74648d0,c0e975b1,627,c74332a0,...) at _cv_wait_sig+0x243 seltdwait(c74332a0,58,c74c1a00,c7f5f2e0,246,...) at seltdwait+0xa2 kern_select(c7f5f2e0,a,288060b4,288060bc,0,0,20,c7f1a578,c7f1a578) at kern_select+0x504 select(c7f5f2e0,ef31bcec,ef31bd28,c0e958ea,0,...) at select+0x66 syscallenter(c7f5f2e0,ef31bce4,ef31bce4,0,0,...) at syscallenter+0x263 syscall(ef31bd28) at syscall+0x4f Xint0x80_syscall() at Xint0x80_syscall+0x21 --- syscall (93, FreeBSD ELF32, select), eip = 0x284c45c3, esp = 0xbfbfe19c, ebp = 0xbfbfe1e8 --- Tracing command sh pid 2488 tid 100154 td 0xc7f5f000 sched_switch(c7f5f000,0,104,191,d095cd97,...) at sched_switch+0x3bc mi_switch(104,0,c0e94f60,1f3,6c,...) at mi_switch+0x1eb sleepq_switch(c7f5f000,0,c0e94f60,1a7,6c,...) at sleepq_switch+0x162 sleepq_catch_signals(c0e94f60,160,0,100,100,...) at sleepq_catch_signals+0xf9 sleepq_wait_sig(c7f1a2bc,6c,c0e97d3e,100,0,...) at sleepq_wait_sig+0x17 _sleep(c7f1a2bc,c7f1a344,16c,c0e97d3e,0,...) at _sleep+0x35c kern_wait(c7f5f000,ffffffff,ef31ec44,2,0,...) at kern_wait+0xbe6 wait4(c7f5f000,ef31ecec,2820fd28,1,0,...) at wait4+0x3b syscallenter(c7f5f000,ef31ece4,c0cd942d,c101b570,0,...) at syscallenter+0x263 syscall(ef31ed28) at syscall+0x4f Xint0x80_syscall() at Xint0x80_syscall+0x21 --- syscall (7, FreeBSD ELF32, wait4), eip = 0x2816a93b, esp = 0xbfbfeb3c, ebp = 0xbfbfeb58 --- Tracing command sshd pid 2487 tid 100171 td 0xc97bd5c0 sched_switch(c97bd5c0,0,104,191,cb97d5bd,...) at sched_switch+0x3bc mi_switch(104,0,c0e94f60,1f3,0,...) at mi_switch+0x1eb sleepq_switch(c97bd5c0,0,c0e94f60,1a7,0,...) at sleepq_switch+0x162 sleepq_catch_signals(c099d34a,c7872650,0,c0e8dd67,c97bd5c0,...) at sleepq_catch_signals+0xf9 sleepq_wait_sig(c7872664,0,ef351a4c,101,0,...) at sleepq_wait_sig+0x17 _cv_wait_sig(c7872664,c7872650,c0e975b1,627,c7433930,...) at _cv_wait_sig+0x243 seltdwait(c7433930,58,c7e1e780,c97bd5c0,246,...) at seltdwait+0xa2 kern_select(c97bd5c0,c,288060b4,288060bc,0,0,20,c97b8000,c97b8000) at kern_select+0x504 select(c97bd5c0,ef351cec,ef351d28,c0e958ea,0,...) at select+0x66 syscallenter(c97bd5c0,ef351ce4,ef351ce4,0,74b,...) at syscallenter+0x263 syscall(ef351d28) at syscall+0x4f Xint0x80_syscall() at Xint0x80_syscall+0x21 --- syscall (93, FreeBSD ELF32, select), eip = 0x284c45c3, esp = 0xbfbfe19c, ebp = 0xbfbfe1e8 --- Tracing command sshd pid 2486 tid 100155 td 0xc7f5eb80 sched_switch(c7f5eb80,0,104,191,c9553327,...) at sched_switch+0x3bc mi_switch(104,0,c0e94f60,1f3,0,...) at mi_switch+0x1eb sleepq_switch(c7f5eb80,0,c0e94f60,1a7,0,...) at sleepq_switch+0x162 sleepq_catch_signals(c099d34a,c7464850,0,c0e8dd67,c7f5eb80,...) at sleepq_catch_signals+0xf9 sleepq_wait_sig(c7464864,0,ef321a4c,101,0,...) at sleepq_wait_sig+0x17 _cv_wait_sig(c7464864,c7464850,c0e975b1,627,c744e8c0,...) at _cv_wait_sig+0x243 seltdwait(c744e8c0,58,c74c1580,c7f5eb80,f33,...) at seltdwait+0xa2 kern_select(c7f5eb80,c,288060b4,288060bc,0,0,20,c7f1a000,c7f1a000) at kern_select+0x504 select(c7f5eb80,ef321cec,ef321d28,c0e958ea,0,...) at select+0x66 syscallenter(c7f5eb80,ef321ce4,ef321ce4,0,0,...) at syscallenter+0x263 syscall(ef321d28) at syscall+0x4f Xint0x80_syscall() at Xint0x80_syscall+0x21 --- syscall (93, FreeBSD ELF32, select), eip = 0x284c45c3, esp = 0xbfbfe19c, ebp = 0xbfbfe1e8 --- Tracing command sshd pid 2482 tid 100177 td 0xc97bc2e0 sched_switch(c97bc2e0,0,104,191,c96eb22b,...) at sched_switch+0x3bc mi_switch(104,0,c0e94f60,1f3,68,...) at mi_switch+0x1eb sleepq_switch(c97bc2e0,0,c0e94f60,1a7,68,...) at sleepq_switch+0x162 sleepq_catch_signals(c0e94f60,160,0,100,100,...) at sleepq_catch_signals+0xf9 sleepq_wait_sig(c785b738,68,c0e9b401,100,0,...) at sleepq_wait_sig+0x17 _sleep(c785b738,c785b6f8,168,c0e9b401,0) at _sleep+0x35c sbwait(c785b6d4,4,c0e9b4d9,5ec,c785b6f8,...) at sbwait+0x76 soreceive_generic(c785b680,0,ef364c28,0,0,...) at soreceive_generic+0x3f0 soreceive(c785b680,0,ef364c28,0,0,0) at soreceive+0x38 soo_read(c7873e70,ef364c28,c7455400,0,c97bc2e0,...) at soo_read+0x4e dofileread(ef364c28,ffffffff,ffffffff,0,c7873e70,...) at dofileread+0x9e kern_readv(c97bc2e0,5,ef364c28,ef364c48,1,...) at kern_readv+0x58 read(c97bc2e0,ef364cec,ef364d28,c0e958ea,0,...) at read+0x4f syscallenter(c97bc2e0,ef364ce4,ef364ce4,0,0,...) at syscallenter+0x263 syscall(ef364d28) at syscall+0x4f Xint0x80_syscall() at Xint0x80_syscall+0x21 --- syscall (3, FreeBSD ELF32, read), eip = 0x284c4643, esp = 0xbfbfdd3c, ebp = 0xbfbfdd78 --- Tracing command sshd pid 2481 tid 100178 td 0xc97bc000 sched_switch(c97bc000,0,104,191,ca6be097,...) at sched_switch+0x3bc mi_switch(104,0,c0e94f60,1f3,68,...) at mi_switch+0x1eb sleepq_switch(c97bc000,0,c0e94f60,1a7,68,...) at sleepq_switch+0x162 sleepq_catch_signals(c0e94f60,160,0,100,100,...) at sleepq_catch_signals+0xf9 sleepq_wait_sig(c776a258,68,c0e9b401,100,0,...) at sleepq_wait_sig+0x17 _sleep(c776a258,c776a218,168,c0e9b401,0) at _sleep+0x35c sbwait(c776a1f4,4,c0e9b4d9,5ec,c776a218,...) at sbwait+0x76 soreceive_generic(c776a1a0,0,ef367c28,0,0,...) at soreceive_generic+0x3f0 soreceive(c776a1a0,0,ef367c28,0,0,0) at soreceive+0x38 soo_read(c7868c78,ef367c28,c7e1ee80,0,c97bc000,...) at soo_read+0x4e dofileread(ef367c28,ffffffff,ffffffff,0,c7868c78,...) at dofileread+0x9e kern_readv(c97bc000,5,ef367c28,ef367c48,1,...) at kern_readv+0x58 read(c97bc000,ef367cec,2888a010,1,0,...) at read+0x4f syscallenter(c97bc000,ef367ce4,c0cd942d,c101b570,0,...) at syscallenter+0x263 syscall(ef367d28) at syscall+0x4f Xint0x80_syscall() at Xint0x80_syscall+0x21 --- syscall (3, FreeBSD ELF32, read), eip = 0x284c4643, esp = 0xbfbfdd3c, ebp = 0xbfbfdd78 --- Tracing command sshd pid 2480 tid 100179 td 0xc97bbb80 sched_switch(c97bbb80,0,104,191,c956864c,...) at sched_switch+0x3bc mi_switch(104,0,c0e94f60,1f3,68,...) at mi_switch+0x1eb sleepq_switch(c97bbb80,0,c0e94f60,1a7,68,...) at sleepq_switch+0x162 sleepq_catch_signals(c0e94f60,160,0,100,100,...) at sleepq_catch_signals+0xf9 sleepq_wait_sig(c776a3f8,68,c0e9b401,100,0,...) at sleepq_wait_sig+0x17 _sleep(c776a3f8,c776a3b8,168,c0e9b401,0) at _sleep+0x35c sbwait(c776a394,4,c0e9b4d9,5ec,c776a3b8,...) at sbwait+0x76 soreceive_generic(c776a340,0,ef36ac28,0,0,...) at soreceive_generic+0x3f0 soreceive(c776a340,0,ef36ac28,0,0,0) at soreceive+0x38 soo_read(c7432348,ef36ac28,c992a180,0,c97bbb80,...) at soo_read+0x4e dofileread(ef36ac28,ffffffff,ffffffff,0,c7432348,...) at dofileread+0x9e kern_readv(c97bbb80,5,ef36ac28,ef36ac48,1,...) at kern_readv+0x58 read(c97bbb80,ef36acec,ef36ad28,c0e958ea,0,...) at read+0x4f syscallenter(c97bbb80,ef36ace4,ef36ace4,0,0,...) at syscallenter+0x263 syscall(ef36ad28) at syscall+0x4f Xint0x80_syscall() at Xint0x80_syscall+0x21 --- syscall (3, FreeBSD ELF32, read), eip = 0x284c4643, esp = 0xbfbfdd3c, ebp = 0xbfbfdd78 --- Tracing command mksnap_ffs pid 2479 tid 100089 td 0xc74a68a0 kdb_enter(c0d1643e,c0e595b0,0,c716a080,0,...) at kdb_enter+0x3a uart_intr(c716a000,c6d5b1e0,c6d61f28,c,0,...) at uart_intr+0x126 intr_event_handle(c6d88800,ef1c9500,ef1c94d8,c74a68a0,c95f9634,...) at intr_event_handle+0x76 intr_execute_handlers(c6e020d0,ef1c9500,0,ef1c955c,c0cc25f5,...) at intr_execute_handlers+0x49 lapic_handle_intr(3b,ef1c9500) at lapic_handle_intr+0x36 Xapic_isr1() at Xapic_isr1+0x35 --- interrupt, eip = 0xc099d27e, esp = 0xef1c9540, ebp = 0xef1c955c --- _mtx_unlock_flags(c95f9634,0,c0e9ecb2,86b,c95f9634,...) at _mtx_unlock_flags+0x9e vget(c95f9570,80100,c74a68a0,419,c77362d4,...) at vget+0x1b3 qsync(c77362d4,ef1c9614,c74a68a0,574,0,...) at qsync+0x19d ffs_sync(c77362d4,1,277,c0ea0542,0,...) at ffs_sync+0x584 vfs_write_suspend(c77362d4,ef1c98b8,0,4000,c6da0000,...) at vfs_write_suspend+0x122 ffs_snapshot(c77362d4,c7405320,c0ec5490,174,ef1c9980,...) at ffs_snapshot+0xc91 ffs_mount(c77362d4,c7beb800,ff,393,0,...) at ffs_mount+0x1590 vfs_donmount(c74a68a0,213300,c7b3cc80,c7b3cc80,c7024834,...) at vfs_donmount+0x1147 nmount(c74a68a0,ef1c9cec,ef1c9d28,c0e958ea,0,...) at nmount+0x84 syscallenter(c74a68a0,ef1c9ce4,ef1c9ce4,0,74b,...) at syscallenter+0x263 syscall(ef1c9d28) at syscall+0x4f Xint0x80_syscall() at Xint0x80_syscall+0x21 --- syscall (378, FreeBSD ELF32, nmount), eip = 0x280da9db, esp = 0xbfbfe0ac, ebp = 0xbfbfe828 --- Tracing command creat pid 2473 tid 100144 td 0xc7b5c8a0 sched_switch(c7b5c8a0,0,104,191,461575a2,...) at sched_switch+0x3bc mi_switch(104,0,c0e94f60,1f3,77,...) at mi_switch+0x1eb sleepq_switch(c7b5c8a0,0,c0e94f60,1a7,77,...) at sleepq_switch+0x162 sleepq_catch_signals(c0e94f60,160,0,100,100,...) at sleepq_catch_signals+0xf9 sleepq_wait_sig(c773631c,77,c0ea053b,100,0,...) at sleepq_wait_sig+0x17 _sleep(c773631c,c77362d4,177,c0ea053b,0,...) at _sleep+0x35c vn_start_write(0,ef2f2c14,104,ef2f2bdc,804cc60,...) at vn_start_write+0xdd kern_rmdirat(c7b5c8a0,ffffff9c,804cc60,0,ef2f2c50,...) at kern_rmdirat+0x16b kern_rmdir(c7b5c8a0,804cc60,0,ef2f2c7c,c09f0083,...) at kern_rmdir+0x27 rmdir(c7b5c8a0,ef2f2cec,ef2f2d80,ef2f2c88,0,...) at rmdir+0x22 syscallenter(c7b5c8a0,ef2f2ce4,c0cd90e6,0,0,...) at syscallenter+0x263 syscall(ef2f2d28) at syscall+0x4f Xint0x80_syscall() at Xint0x80_syscall+0x21 --- syscall (137, FreeBSD ELF32, rmdir), eip = 0x280ee91b, esp = 0xbfbfe5ec, ebp = 0xbfbfe608 --- Tracing command creat pid 2472 tid 100090 td 0xc7465000 sched_switch(c7465000,0,104,191,46254931,...) at sched_switch+0x3bc mi_switch(104,0,c0e94f60,1f3,77,...) at mi_switch+0x1eb sleepq_switch(c7465000,0,c0e94f60,1a7,77,...) at sleepq_switch+0x162 sleepq_catch_signals(c0e94f60,160,0,100,100,...) at sleepq_catch_signals+0xf9 sleepq_wait_sig(c773631c,77,c0ea053b,100,0,...) at sleepq_wait_sig+0x17 _sleep(c773631c,c77362d4,177,c0ea053b,0,...) at _sleep+0x35c vn_start_write(0,ef1cdc14,104,ef1cdbdc,804cc60,...) at vn_start_write+0xdd kern_rmdirat(c7465000,ffffff9c,804cc60,0,ef1cdc50,...) at kern_rmdirat+0x16b kern_rmdir(c7465000,804cc60,0,ef1cdc7c,c09f0083,...) at kern_rmdir+0x27 rmdir(c7465000,ef1cdcec,ef1cdd28,c0e958ea,0,...) at rmdir+0x22 syscallenter(c7465000,ef1cdce4,ef1cdce4,0,0,...) at syscallenter+0x263 syscall(ef1cdd28) at syscall+0x4f Xint0x80_syscall() at Xint0x80_syscall+0x21 --- syscall (137, FreeBSD ELF32, rmdir), eip = 0x280ee91b, esp = 0xbfbfe5ec, ebp = 0xbfbfe608 --- Tracing command creat pid 2471 tid 100163 td 0xc7f5d2e0 sched_switch(c7f5d2e0,0,104,191,461d2b59,...) at sched_switch+0x3bc mi_switch(104,0,c0e94f60,1f3,77,...) at mi_switch+0x1eb sleepq_switch(c7f5d2e0,0,c0e94f60,1a7,77,...) at sleepq_switch+0x162 sleepq_catch_signals(c0e94f60,160,0,100,100,...) at sleepq_catch_signals+0xf9 sleepq_wait_sig(c773631c,77,c0ea053b,100,0,...) at sleepq_wait_sig+0x17 _sleep(c773631c,c77362d4,177,c0ea053b,0,...) at _sleep+0x35c vn_start_write(0,ef339c14,104,ef339bdc,804cc60,...) at vn_start_write+0xdd kern_rmdirat(c7f5d2e0,ffffff9c,804cc60,0,ef339c50,...) at kern_rmdirat+0x16b kern_rmdir(c7f5d2e0,804cc60,0,ef339c7c,c09f0083,...) at kern_rmdir+0x27 rmdir(c7f5d2e0,ef339cec,ef339d28,c0e958ea,0,...) at rmdir+0x22 syscallenter(c7f5d2e0,ef339ce4,ef339ce4,0,0,...) at syscallenter+0x263 syscall(ef339d28) at syscall+0x4f Xint0x80_syscall() at Xint0x80_syscall+0x21 --- syscall (137, FreeBSD ELF32, rmdir), eip = 0x280ee91b, esp = 0xbfbfe5ec, ebp = 0xbfbfe608 --- Tracing command creat pid 2470 tid 100170 td 0xc745e000 sched_switch(c745e000,0,104,191,4613bb42,...) at sched_switch+0x3bc mi_switch(104,0,c0e94f60,1f3,77,...) at mi_switch+0x1eb sleepq_switch(c745e000,0,c0e94f60,1a7,77,...) at sleepq_switch+0x162 sleepq_catch_signals(c0e94f60,160,0,100,100,...) at sleepq_catch_signals+0xf9 sleepq_wait_sig(c773631c,77,c0ea053b,100,0,...) at sleepq_wait_sig+0x17 _sleep(c773631c,c77362d4,177,c0ea053b,0,...) at _sleep+0x35c vn_start_write(0,ef34ec14,104,ef34ebdc,804cc60,...) at vn_start_write+0xdd kern_rmdirat(c745e000,ffffff9c,804cc60,0,ef34ec50,...) at kern_rmdirat+0x16b kern_rmdir(c745e000,804cc60,0,ef34ec7c,c09f0083,...) at kern_rmdir+0x27 rmdir(c745e000,ef34ecec,ef34ed28,c0e958ea,0,...) at rmdir+0x22 syscallenter(c745e000,ef34ece4,ef34ece4,0,0,...) at syscallenter+0x263 syscall(ef34ed28) at syscall+0x4f Xint0x80_syscall() at Xint0x80_syscall+0x21 --- syscall (137, FreeBSD ELF32, rmdir), eip = 0x280ee91b, esp = 0xbfbfe5ec, ebp = 0xbfbfe608 --- Tracing command creat pid 2469 tid 100174 td 0xc97bcb80 sched_switch(c97bcb80,0,104,191,4619b1d3,...) at sched_switch+0x3bc mi_switch(104,0,c0e94f60,1f3,77,...) at mi_switch+0x1eb sleepq_switch(c97bcb80,0,c0e94f60,1a7,77,...) at sleepq_switch+0x162 sleepq_catch_signals(c0e94f60,160,0,100,100,...) at sleepq_catch_signals+0xf9 sleepq_wait_sig(c773631c,77,c0ea053b,100,0,...) at sleepq_wait_sig+0x17 _sleep(c773631c,c77362d4,177,c0ea053b,0,...) at _sleep+0x35c vn_start_write(0,ef35bc14,104,ef35bbdc,804cc60,...) at vn_start_write+0xdd kern_rmdirat(c97bcb80,ffffff9c,804cc60,0,ef35bc50,...) at kern_rmdirat+0x16b kern_rmdir(c97bcb80,804cc60,0,ef35bc7c,c09f0083,...) at kern_rmdir+0x27 rmdir(c97bcb80,ef35bcec,ef35bd80,ef35bc88,0,...) at rmdir+0x22 syscallenter(c97bcb80,ef35bce4,c0cd90e6,0,0,...) at syscallenter+0x263 syscall(ef35bd28) at syscall+0x4f Xint0x80_syscall() at Xint0x80_syscall+0x21 --- syscall (137, FreeBSD ELF32, rmdir), eip = 0x280ee91b, esp = 0xbfbfe5ec, ebp = 0xbfbfe608 --- Tracing command creat pid 2468 tid 100172 td 0xc97bd2e0 sched_switch(c97bd2e0,0,104,191,46021e32,...) at sched_switch+0x3bc mi_switch(104,0,c0e94f60,1f3,6c,...) at mi_switch+0x1eb sleepq_switch(c97bd2e0,0,c0e94f60,1a7,6c,...) at sleepq_switch+0x162 sleepq_catch_signals(c0e94f60,160,0,100,100,...) at sleepq_catch_signals+0xf9 sleepq_wait_sig(c97b7af0,6c,c0e97d3e,100,0,...) at sleepq_wait_sig+0x17 _sleep(c97b7af0,c97b7b78,16c,c0e97d3e,0,...) at _sleep+0x35c kern_wait(c97bd2e0,9a5,ef355c44,0,0,...) at kern_wait+0xbe6 wait4(c97bd2e0,ef355cec,ef355d28,c0e958ea,0,...) at wait4+0x3b syscallenter(c97bd2e0,ef355ce4,ef355ce4,fffffffe,246,...) at syscallenter+0x263 syscall(ef355d28) at syscall+0x4f Xint0x80_syscall() at Xint0x80_syscall+0x21 --- syscall (7, FreeBSD ELF32, wait4), eip = 0x2810493b, esp = 0xbfbfe79c, ebp = 0xbfbfe7b8 --- Tracing command mkdir pid 2467 tid 100167 td 0xc745e8a0 sched_switch(c745e8a0,0,104,191,45ce21c4,...) at sched_switch+0x3bc mi_switch(104,0,c0e94f60,1f3,77,...) at mi_switch+0x1eb sleepq_switch(c745e8a0,0,c0e94f60,1a7,77,...) at sleepq_switch+0x162 sleepq_catch_signals(c0e94f60,160,0,100,100,...) at sleepq_catch_signals+0xf9 sleepq_wait_sig(c773631c,77,c0ea053b,100,0,...) at sleepq_wait_sig+0x17 _sleep(c773631c,c77362d4,177,c0ea053b,0,...) at _sleep+0x35c vn_start_write(0,ef345c0c,104,0,0,...) at vn_start_write+0xdd kern_mkdirat(c745e8a0,ffffff9c,bfbfc65b,0,1f8,...) at kern_mkdirat+0x18b kern_mkdir(c745e8a0,bfbfc65b,0,1f8,ef345c7c,...) at kern_mkdir+0x2e mkdir(c745e8a0,ef345cec,ef345d28,c0e958ea,0,...) at mkdir+0x29 syscallenter(c745e8a0,ef345ce4,ef345ce4,fffffffe,246,...) at syscallenter+0x263 syscall(ef345d28) at syscall+0x4f Xint0x80_syscall() at Xint0x80_syscall+0x21 --- syscall (136, FreeBSD ELF32, mkdir), eip = 0x28186663, esp = 0xbfbfc20c, ebp = 0xbfbfc638 --- Tracing command mkdir pid 2466 tid 100166 td 0xc745eb80 sched_switch(c745eb80,0,104,191,45d0153e,...) at sched_switch+0x3bc mi_switch(104,0,c0e94f60,1f3,77,...) at mi_switch+0x1eb sleepq_switch(c745eb80,0,c0e94f60,1a7,77,...) at sleepq_switch+0x162 sleepq_catch_signals(c0e94f60,160,0,100,100,...) at sleepq_catch_signals+0xf9 sleepq_wait_sig(c773631c,77,c0ea053b,100,0,...) at sleepq_wait_sig+0x17 _sleep(c773631c,c77362d4,177,c0ea053b,0,...) at _sleep+0x35c vn_start_write(0,ef342c14,104,ef342bdc,bfbfc5f7,...) at vn_start_write+0xdd kern_rmdirat(c745eb80,ffffff9c,bfbfc5f7,0,ef342c50,...) at kern_rmdirat+0x16b kern_rmdir(c745eb80,bfbfc5f7,0,ef342c7c,c09f0083,...) at kern_rmdir+0x27 rmdir(c745eb80,ef342cec,ef342d28,c0e958ea,0,...) at rmdir+0x22 syscallenter(c745eb80,ef342ce4,ef342ce4,fffffffe,246,...) at syscallenter+0x263 syscall(ef342d28) at syscall+0x4f Xint0x80_syscall() at Xint0x80_syscall+0x21 --- syscall (137, FreeBSD ELF32, rmdir), eip = 0x280ee91b, esp = 0xbfbfc18c, ebp = 0xbfbfc5c8 --- Tracing command rw pid 2465 tid 100096 td 0xc74a55c0 sched_switch(c74a55c0,0,104,191,5b7879b7,...) at sched_switch+0x3bc mi_switch(104,0,c0e94f60,1f3,77,...) at mi_switch+0x1eb sleepq_switch(c74a55c0,0,c0e94f60,1a7,77,...) at sleepq_switch+0x162 sleepq_catch_signals(c0e94f60,160,0,100,100,...) at sleepq_catch_signals+0xf9 sleepq_wait_sig(c773631c,77,c0ea053b,100,0,...) at sleepq_wait_sig+0x17 _sleep(c773631c,c77362d4,177,c0ea053b,0,...) at _sleep+0x35c vn_start_write(c98a115c,ef217ba8,101,0,0,...) at vn_start_write+0xdd vn_write(c7873348,ef217c28,c701c280,0,c74a55c0,...) at vn_write+0xfa dofilewrite(ef217c28,ffffffff,ffffffff,0,c7873348,...) at dofilewrite+0x95 kern_writev(c74a55c0,4,ef217c28,ef217c48,1,...) at kern_writev+0x58 write(c74a55c0,ef217cec,ef217d28,c0e958ea,0,...) at write+0x4f syscallenter(c74a55c0,ef217ce4,ef217ce4,fffffffe,246,...) at syscallenter+0x263 syscall(ef217d28) at syscall+0x4f Xint0x80_syscall() at Xint0x80_syscall+0x21 --- syscall (4, FreeBSD ELF32, write), eip = 0x28195623, esp = 0xbfbfd70c, ebp = 0xbfbfe7c8 --- Tracing command mkdir pid 2464 tid 100105 td 0xc742e000 sched_switch(c742e000,0,104,191,45cdf6e2,...) at sched_switch+0x3bc mi_switch(104,0,c0e94f60,1f3,77,...) at mi_switch+0x1eb sleepq_switch(c742e000,0,c0e94f60,1a7,77,...) at sleepq_switch+0x162 sleepq_catch_signals(c0e94f60,160,0,100,100,...) at sleepq_catch_signals+0xf9 sleepq_wait_sig(c773631c,77,c0ea053b,100,0,...) at sleepq_wait_sig+0x17 _sleep(c773631c,c77362d4,177,c0ea053b,0,...) at _sleep+0x35c vn_start_write(0,ef241c0c,104,0,0,...) at vn_start_write+0xdd kern_mkdirat(c742e000,ffffff9c,bfbfe3af,0,1f8,...) at kern_mkdirat+0x18b kern_mkdir(c742e000,bfbfe3af,0,1f8,ef241c7c,...) at kern_mkdir+0x2e mkdir(c742e000,ef241cec,ef241d28,c0e958ea,0,...) at mkdir+0x29 syscallenter(c742e000,ef241ce4,ef241ce4,fffffffe,246,...) at syscallenter+0x263 syscall(ef241d28) at syscall+0x4f Xint0x80_syscall() at Xint0x80_syscall+0x21 --- syscall (136, FreeBSD ELF32, mkdir), eip = 0x28186663, esp = 0xbfbfdf5c, ebp = 0xbfbfe388 --- Tracing command rw pid 2463 tid 100113 td 0xc786fb80 sched_switch(c786fb80,0,104,191,5b7864c0,...) at sched_switch+0x3bc mi_switch(104,0,c0e94f60,1f3,77,...) at mi_switch+0x1eb sleepq_switch(c786fb80,0,c0e94f60,1a7,77,...) at sleepq_switch+0x162 sleepq_catch_signals(c0e94f60,160,0,100,100,...) at sleepq_catch_signals+0xf9 sleepq_wait_sig(c773631c,77,c0ea053b,100,0,...) at sleepq_wait_sig+0x17 _sleep(c773631c,c77362d4,177,c0ea053b,0,...) at _sleep+0x35c vn_start_write(c95f915c,ef274ba8,101,0,0,...) at vn_start_write+0xdd vn_write(c78785e8,ef274c28,c701c280,0,c786fb80,...) at vn_write+0xfa dofilewrite(ef274c28,ffffffff,ffffffff,0,c78785e8,...) at dofilewrite+0x95 kern_writev(c786fb80,4,ef274c28,ef274c48,1,...) at kern_writev+0x58 write(c786fb80,ef274cec,ef274d28,c0e958ea,0,...) at write+0x4f syscallenter(c786fb80,ef274ce4,ef274ce4,fffffffe,246,...) at syscallenter+0x263 syscall(ef274d28) at syscall+0x4f Xint0x80_syscall() at Xint0x80_syscall+0x21 --- syscall (4, FreeBSD ELF32, write), eip = 0x28195623, esp = 0xbfbfd70c, ebp = 0xbfbfe7c8 --- Tracing command mkdir pid 2462 tid 100148 td 0xc7b56b80 sched_switch(c7b56b80,0,104,191,45cd81e2,...) at sched_switch+0x3bc mi_switch(104,0,c0e94f60,1f3,77,...) at mi_switch+0x1eb sleepq_switch(c7b56b80,0,c0e94f60,1a7,77,...) at sleepq_switch+0x162 sleepq_catch_signals(c0e94f60,160,0,100,100,...) at sleepq_catch_signals+0xf9 sleepq_wait_sig(c773631c,77,c0ea053b,100,0,...) at sleepq_wait_sig+0x17 _sleep(c773631c,c77362d4,177,c0ea053b,0,...) at _sleep+0x35c vn_start_write(0,ef301c0c,104,0,0,...) at vn_start_write+0xdd kern_mkdirat(c7b56b80,ffffff9c,bfbfd2eb,0,1f8,...) at kern_mkdirat+0x18b kern_mkdir(c7b56b80,bfbfd2eb,0,1f8,ef301c7c,...) at kern_mkdir+0x2e mkdir(c7b56b80,ef301cec,ef301d28,c0e958ea,0,...) at mkdir+0x29 syscallenter(c7b56b80,ef301ce4,ef301ce4,fffffffe,246,...) at syscallenter+0x263 syscall(ef301d28) at syscall+0x4f Xint0x80_syscall() at Xint0x80_syscall+0x21 --- syscall (136, FreeBSD ELF32, mkdir), eip = 0x28186663, esp = 0xbfbfce9c, ebp = 0xbfbfd2c8 --- Tracing command rw pid 2461 tid 100095 td 0xc74a58a0 sched_switch(c74a58a0,0,104,191,5b77ec91,...) at sched_switch+0x3bc mi_switch(104,0,c0e94f60,1f3,77,...) at mi_switch+0x1eb sleepq_switch(c74a58a0,0,c0e94f60,1a7,77,...) at sleepq_switch+0x162 sleepq_catch_signals(c0e94f60,160,0,100,100,...) at sleepq_catch_signals+0xf9 sleepq_wait_sig(c773631c,77,c0ea053b,100,0,...) at sleepq_wait_sig+0x17 _sleep(c773631c,c77362d4,177,c0ea053b,0,...) at _sleep+0x35c vn_start_write(c97fb2b8,ef20cba8,101,0,0,...) at vn_start_write+0xdd vn_write(c74b0428,ef20cc28,c701c280,0,c74a58a0,...) at vn_write+0xfa dofilewrite(ef20cc28,ffffffff,ffffffff,0,c74b0428,...) at dofilewrite+0x95 kern_writev(c74a58a0,4,ef20cc28,ef20cc48,1,...) at kern_writev+0x58 write(c74a58a0,ef20ccec,ef20cd28,c0e958ea,0,...) at write+0x4f syscallenter(c74a58a0,ef20cce4,ef20cce4,fffffffe,246,...) at syscallenter+0x263 syscall(ef20cd28) at syscall+0x4f Xint0x80_syscall() at Xint0x80_syscall+0x21 --- syscall (4, FreeBSD ELF32, write), eip = 0x28195623, esp = 0xbfbfd70c, ebp = 0xbfbfe7c8 --- Tracing command mkdir pid 2460 tid 100114 td 0xc786f8a0 sched_switch(c786f8a0,0,104,191,45cd22d8,...) at sched_switch+0x3bc mi_switch(104,0,c0e94f60,1f3,77,...) at mi_switch+0x1eb sleepq_switch(c786f8a0,0,c0e94f60,1a7,77,...) at sleepq_switch+0x162 sleepq_catch_signals(c0e94f60,160,0,100,100,...) at sleepq_catch_signals+0xf9 sleepq_wait_sig(c773631c,77,c0ea053b,100,0,...) at sleepq_wait_sig+0x17 _sleep(c773631c,c77362d4,177,c0ea053b,0,...) at _sleep+0x35c vn_start_write(0,ef277c0c,104,0,0,...) at vn_start_write+0xdd kern_mkdirat(c786f8a0,ffffff9c,bfbfe3af,0,1f8,...) at kern_mkdirat+0x18b kern_mkdir(c786f8a0,bfbfe3af,0,1f8,ef277c7c,...) at kern_mkdir+0x2e mkdir(c786f8a0,ef277cec,ef277d28,c0e958ea,0,...) at mkdir+0x29 syscallenter(c786f8a0,ef277ce4,ef277ce4,fffffffe,246,...) at syscallenter+0x263 syscall(ef277d28) at syscall+0x4f Xint0x80_syscall() at Xint0x80_syscall+0x21 --- syscall (136, FreeBSD ELF32, mkdir), eip = 0x28186663, esp = 0xbfbfdf5c, ebp = 0xbfbfe388 --- Tracing command rw pid 2459 tid 100082 td 0xc7466000 sched_switch(c7466000,0,104,191,5b7802ce,...) at sched_switch+0x3bc mi_switch(104,0,c0e94f60,1f3,77,...) at mi_switch+0x1eb sleepq_switch(c7466000,0,c0e94f60,1a7,77,...) at sleepq_switch+0x162 sleepq_catch_signals(c0e94f60,160,0,100,100,...) at sleepq_catch_signals+0xf9 sleepq_wait_sig(c773631c,77,c0ea053b,100,0,...) at sleepq_wait_sig+0x17 _sleep(c773631c,c77362d4,177,c0ea053b,0,...) at _sleep+0x35c vn_start_write(c98e2984,ef1adba8,101,0,0,...) at vn_start_write+0xdd vn_write(c7433a10,ef1adc28,c701c280,0,c7466000,...) at vn_write+0xfa dofilewrite(ef1adc28,ffffffff,ffffffff,0,c7433a10,...) at dofilewrite+0x95 kern_writev(c7466000,4,ef1adc28,ef1adc48,1,...) at kern_writev+0x58 write(c7466000,ef1adcec,ef1add28,c0e958ea,0,...) at write+0x4f syscallenter(c7466000,ef1adce4,ef1adce4,fffffffe,246,...) at syscallenter+0x263 syscall(ef1add28) at syscall+0x4f Xint0x80_syscall() at Xint0x80_syscall+0x21 --- syscall (4, FreeBSD ELF32, write), eip = 0x28195623, esp = 0xbfbfd70c, ebp = 0xbfbfe7c8 --- Tracing command mkdir pid 2458 tid 100138 td 0xc7be2000 sched_switch(c7be2000,0,104,191,45cfd751,...) at sched_switch+0x3bc mi_switch(104,0,c0e94f60,1f3,77,...) at mi_switch+0x1eb sleepq_switch(c7be2000,0,c0e94f60,1a7,77,...) at sleepq_switch+0x162 sleepq_catch_signals(c0e94f60,160,0,100,100,...) at sleepq_catch_signals+0xf9 sleepq_wait_sig(c773631c,77,c0ea053b,100,0,...) at sleepq_wait_sig+0x17 _sleep(c773631c,c77362d4,177,c0ea053b,0,...) at _sleep+0x35c vn_start_write(0,ef2dcc0c,104,0,0,...) at vn_start_write+0xdd kern_mkdirat(c7be2000,ffffff9c,bfbfe3af,0,1f8,...) at kern_mkdirat+0x18b kern_mkdir(c7be2000,bfbfe3af,0,1f8,ef2dcc7c,...) at kern_mkdir+0x2e mkdir(c7be2000,ef2dccec,ef2dcd28,c0e958ea,0,...) at mkdir+0x29 syscallenter(c7be2000,ef2dcce4,ef2dcce4,fffffffe,246,...) at syscallenter+0x263 syscall(ef2dcd28) at syscall+0x4f Xint0x80_syscall() at Xint0x80_syscall+0x21 --- syscall (136, FreeBSD ELF32, mkdir), eip = 0x28186663, esp = 0xbfbfdf5c, ebp = 0xbfbfe388 --- Tracing command rw pid 2457 tid 100126 td 0xc7b5db80 sched_switch(c7b5db80,0,104,191,5b7887e3,...) at sched_switch+0x3bc mi_switch(104,0,c0e94f60,1f3,77,...) at mi_switch+0x1eb sleepq_switch(c7b5db80,0,c0e94f60,1a7,77,...) at sleepq_switch+0x162 sleepq_catch_signals(c0e94f60,160,0,100,100,...) at sleepq_catch_signals+0xf9 sleepq_wait_sig(c773631c,77,c0ea053b,100,0,...) at sleepq_wait_sig+0x17 _sleep(c773631c,c77362d4,177,c0ea053b,0,...) at _sleep+0x35c vn_start_write(c98a1570,ef2b6ba8,101,0,0,...) at vn_start_write+0xdd vn_write(c78735b0,ef2b6c28,c701c280,0,c7b5db80,...) at vn_write+0xfa dofilewrite(ef2b6c28,ffffffff,ffffffff,0,c78735b0,...) at dofilewrite+0x95 kern_writev(c7b5db80,4,ef2b6c28,ef2b6c48,1,...) at kern_writev+0x58 write(c7b5db80,ef2b6cec,ef2b6d28,c0e958ea,0,...) at write+0x4f syscallenter(c7b5db80,ef2b6ce4,ef2b6ce4,fffffffe,246,...) at syscallenter+0x263 syscall(ef2b6d28) at syscall+0x4f Xint0x80_syscall() at Xint0x80_syscall+0x21 --- syscall (4, FreeBSD ELF32, write), eip = 0x28195623, esp = 0xbfbfd70c, ebp = 0xbfbfe7c8 --- Tracing command mkdir pid 2456 tid 100137 td 0xc7be22e0 sched_switch(c7be22e0,0,104,191,45ceab39,...) at sched_switch+0x3bc mi_switch(104,0,c0e94f60,1f3,77,...) at mi_switch+0x1eb sleepq_switch(c7be22e0,0,c0e94f60,1a7,77,...) at sleepq_switch+0x162 sleepq_catch_signals(c0e94f60,160,0,100,100,...) at sleepq_catch_signals+0xf9 sleepq_wait_sig(c773631c,77,c0ea053b,100,0,...) at sleepq_wait_sig+0x17 _sleep(c773631c,c77362d4,177,c0ea053b,0,...) at _sleep+0x35c vn_start_write(0,ef2d9c0c,104,0,0,...) at vn_start_write+0xdd kern_mkdirat(c7be22e0,ffffff9c,bfbfe3af,0,1f8,...) at kern_mkdirat+0x18b kern_mkdir(c7be22e0,bfbfe3af,0,1f8,ef2d9c7c,...) at kern_mkdir+0x2e mkdir(c7be22e0,ef2d9cec,ef2d9d28,c0e958ea,0,...) at mkdir+0x29 syscallenter(c7be22e0,ef2d9ce4,ef2d9ce4,fffffffe,246,...) at syscallenter+0x263 syscall(ef2d9d28) at syscall+0x4f Xint0x80_syscall() at Xint0x80_syscall+0x21 --- syscall (136, FreeBSD ELF32, mkdir), eip = 0x28186663, esp = 0xbfbfdf5c, ebp = 0xbfbfe388 --- Tracing command rw pid 2455 tid 100127 td 0xc7b5d8a0 sched_switch(c7b5d8a0,0,104,191,5b777e6f,...) at sched_switch+0x3bc mi_switch(104,0,c0e94f60,1f3,77,...) at mi_switch+0x1eb sleepq_switch(c7b5d8a0,0,c0e94f60,1a7,77,...) at sleepq_switch+0x162 sleepq_catch_signals(c0e94f60,160,0,100,100,...) at sleepq_catch_signals+0xf9 sleepq_wait_sig(c773631c,77,c0ea053b,100,0,...) at sleepq_wait_sig+0x17 _sleep(c773631c,c77362d4,177,c0ea053b,0,...) at _sleep+0x35c vn_start_write(c97c36cc,ef2baba8,101,0,0,...) at vn_start_write+0xdd vn_write(c74b0ab8,ef2bac28,c701c280,0,c7b5d8a0,...) at vn_write+0xfa dofilewrite(ef2bac28,ffffffff,ffffffff,0,c74b0ab8,...) at dofilewrite+0x95 kern_writev(c7b5d8a0,4,ef2bac28,ef2bac48,1,...) at kern_writev+0x58 write(c7b5d8a0,ef2bacec,ef2bad28,c0e958ea,0,...) at write+0x4f syscallenter(c7b5d8a0,ef2bace4,ef2bace4,fffffffe,246,...) at syscallenter+0x263 syscall(ef2bad28) at syscall+0x4f Xint0x80_syscall() at Xint0x80_syscall+0x21 --- syscall (4, FreeBSD ELF32, write), eip = 0x28195623, esp = 0xbfbfd70c, ebp = 0xbfbfe7c8 --- Tracing command mkdir pid 2454 tid 100084 td 0xc7465b80 sched_switch(c7465b80,0,104,191,45d021cf,...) at sched_switch+0x3bc mi_switch(104,0,c0e94f60,1f3,77,...) at mi_switch+0x1eb sleepq_switch(c7465b80,0,c0e94f60,1a7,77,...) at sleepq_switch+0x162 sleepq_catch_signals(c0e94f60,160,0,100,100,...) at sleepq_catch_signals+0xf9 sleepq_wait_sig(c773631c,77,c0ea053b,100,0,...) at sleepq_wait_sig+0x17 _sleep(c773631c,c77362d4,177,c0ea053b,0,...) at _sleep+0x35c vn_start_write(0,ef1b5c0c,104,0,0,...) at vn_start_write+0xdd kern_mkdirat(c7465b80,ffffff9c,bfbfe3af,0,1f8,...) at kern_mkdirat+0x18b kern_mkdir(c7465b80,bfbfe3af,0,1f8,ef1b5c7c,...) at kern_mkdir+0x2e mkdir(c7465b80,ef1b5cec,ef1b5d28,c0e958ea,0,...) at mkdir+0x29 syscallenter(c7465b80,ef1b5ce4,ef1b5ce4,fffffffe,246,...) at syscallenter+0x263 syscall(ef1b5d28) at syscall+0x4f Xint0x80_syscall() at Xint0x80_syscall+0x21 --- syscall (136, FreeBSD ELF32, mkdir), eip = 0x28186663, esp = 0xbfbfdf5c, ebp = 0xbfbfe388 --- Tracing command rw pid 2453 tid 100129 td 0xc74a8b80 sched_switch(c74a8b80,0,104,191,5b778ac3,...) at sched_switch+0x3bc mi_switch(104,0,c0e94f60,1f3,77,...) at mi_switch+0x1eb sleepq_switch(c74a8b80,0,c0e94f60,1a7,77,...) at sleepq_switch+0x162 sleepq_catch_signals(c0e94f60,160,0,100,100,...) at sleepq_catch_signals+0xf9 sleepq_wait_sig(c773631c,77,c0ea053b,100,0,...) at sleepq_wait_sig+0x17 _sleep(c773631c,c77362d4,177,c0ea053b,0,...) at _sleep+0x35c vn_start_write(c98e1d98,ef2c1ba8,101,0,0,...) at vn_start_write+0xdd vn_write(c7878188,ef2c1c28,c701c280,0,c74a8b80,...) at vn_write+0xfa dofilewrite(ef2c1c28,ffffffff,ffffffff,0,c7878188,...) at dofilewrite+0x95 kern_writev(c74a8b80,4,ef2c1c28,ef2c1c48,1,...) at kern_writev+0x58 write(c74a8b80,ef2c1cec,ef2c1d28,c0e958ea,0,...) at write+0x4f syscallenter(c74a8b80,ef2c1ce4,ef2c1ce4,fffffffe,246,...) at syscallenter+0x263 syscall(ef2c1d28) at syscall+0x4f Xint0x80_syscall() at Xint0x80_syscall+0x21 --- syscall (4, FreeBSD ELF32, write), eip = 0x28195623, esp = 0xbfbfd70c, ebp = 0xbfbfe7c8 --- Tracing command rw pid 2452 tid 100135 td 0xc7be28a0 sched_switch(c7be28a0,0,104,191,5b781d88,...) at sched_switch+0x3bc mi_switch(104,0,c0e94f60,1f3,77,...) at mi_switch+0x1eb sleepq_switch(c7be28a0,0,c0e94f60,1a7,77,...) at sleepq_switch+0x162 sleepq_catch_signals(c0e94f60,160,0,100,100,...) at sleepq_catch_signals+0xf9 sleepq_wait_sig(c773631c,77,c0ea053b,100,0,...) at sleepq_wait_sig+0x17 _sleep(c773631c,c77362d4,177,c0ea053b,0,...) at _sleep+0x35c vn_start_write(c92f815c,ef2d3ba8,101,0,0,...) at vn_start_write+0xdd vn_write(c7878070,ef2d3c28,c701c280,0,c7be28a0,...) at vn_write+0xfa dofilewrite(ef2d3c28,ffffffff,ffffffff,0,c7878070,...) at dofilewrite+0x95 kern_writev(c7be28a0,4,ef2d3c28,ef2d3c48,1,...) at kern_writev+0x58 write(c7be28a0,ef2d3cec,ef2d3d28,c0e958ea,0,...) at write+0x4f syscallenter(c7be28a0,ef2d3ce4,ef2d3ce4,fffffffe,246,...) at syscallenter+0x263 syscall(ef2d3d28) at syscall+0x4f Xint0x80_syscall() at Xint0x80_syscall+0x21 --- syscall (4, FreeBSD ELF32, write), eip = 0x28195623, esp = 0xbfbfd70c, ebp = 0xbfbfe7c8 --- Tracing command mkdir pid 2451 tid 100115 td 0xc786f5c0 sched_switch(c786f5c0,0,104,191,45d09c4f,...) at sched_switch+0x3bc mi_switch(104,0,c0e94f60,1f3,77,...) at mi_switch+0x1eb sleepq_switch(c786f5c0,0,c0e94f60,1a7,77,...) at sleepq_switch+0x162 sleepq_catch_signals(c0e94f60,160,0,100,100,...) at sleepq_catch_signals+0xf9 sleepq_wait_sig(c773631c,77,c0ea053b,100,0,...) at sleepq_wait_sig+0x17 _sleep(c773631c,c77362d4,177,c0ea053b,0,...) at _sleep+0x35c vn_start_write(0,ef27ac0c,104,0,0,...) at vn_start_write+0xdd kern_mkdirat(c786f5c0,ffffff9c,bfbfe3af,0,1f8,...) at kern_mkdirat+0x18b kern_mkdir(c786f5c0,bfbfe3af,0,1f8,ef27ac7c,...) at kern_mkdir+0x2e mkdir(c786f5c0,ef27acec,ef27ad28,c0e958ea,0,...) at mkdir+0x29 syscallenter(c786f5c0,ef27ace4,ef27ace4,fffffffe,246,...) at syscallenter+0x263 syscall(ef27ad28) at syscall+0x4f Xint0x80_syscall() at Xint0x80_syscall+0x21 --- syscall (136, FreeBSD ELF32, mkdir), eip = 0x28186663, esp = 0xbfbfdf5c, ebp = 0xbfbfe388 --- Tracing command rw pid 2450 tid 100133 td 0xc7be4000 sched_switch(c7be4000,0,104,191,5b77176f,...) at sched_switch+0x3bc mi_switch(104,0,c0e94f60,1f3,77,...) at mi_switch+0x1eb sleepq_switch(c7be4000,0,c0e94f60,1a7,77,...) at sleepq_switch+0x162 sleepq_catch_signals(c0e94f60,160,0,100,100,...) at sleepq_catch_signals+0xf9 sleepq_wait_sig(c773631c,77,c0ea053b,100,0,...) at sleepq_wait_sig+0x17 _sleep(c773631c,c77362d4,177,c0ea053b,0,...) at _sleep+0x35c vn_start_write(c92f715c,ef2cdba8,101,0,0,...) at vn_start_write+0xdd vn_write(c7432000,ef2cdc28,c701c280,0,c7be4000,...) at vn_write+0xfa dofilewrite(ef2cdc28,ffffffff,ffffffff,0,c7432000,...) at dofilewrite+0x95 kern_writev(c7be4000,4,ef2cdc28,ef2cdc48,1,...) at kern_writev+0x58 write(c7be4000,ef2cdcec,ef2cdd28,c0e958ea,0,...) at write+0x4f syscallenter(c7be4000,ef2cdce4,ef2cdce4,fffffffe,246,...) at syscallenter+0x263 syscall(ef2cdd28) at syscall+0x4f Xint0x80_syscall() at Xint0x80_syscall+0x21 --- syscall (4, FreeBSD ELF32, write), eip = 0x28195623, esp = 0xbfbfd70c, ebp = 0xbfbfe7c8 --- Tracing command mkdir pid 2449 tid 100081 td 0xc74662e0 sched_switch(c74662e0,0,104,191,45cc0529,...) at sched_switch+0x3bc mi_switch(104,0,c0e94f60,1f3,77,...) at mi_switch+0x1eb sleepq_switch(c74662e0,0,c0e94f60,1a7,77,...) at sleepq_switch+0x162 sleepq_catch_signals(c0e94f60,160,0,100,100,...) at sleepq_catch_signals+0xf9 sleepq_wait_sig(c773631c,77,c0ea053b,100,0,...) at sleepq_wait_sig+0x17 _sleep(c773631c,c77362d4,177,c0ea053b,0,...) at _sleep+0x35c vn_start_write(0,ef1a9c0c,104,0,0,...) at vn_start_write+0xdd kern_mkdirat(c74662e0,ffffff9c,bfbfe3af,0,1f8,...) at kern_mkdirat+0x18b kern_mkdir(c74662e0,bfbfe3af,0,1f8,ef1a9c7c,...) at kern_mkdir+0x2e mkdir(c74662e0,ef1a9cec,ef1a9d28,c0e958ea,0,...) at mkdir+0x29 syscallenter(c74662e0,ef1a9ce4,ef1a9ce4,fffffffe,246,...) at syscallenter+0x263 syscall(ef1a9d28) at syscall+0x4f Xint0x80_syscall() at Xint0x80_syscall+0x21 --- syscall (136, FreeBSD ELF32, mkdir), eip = 0x28186663, esp = 0xbfbfdf5c, ebp = 0xbfbfe388 --- Tracing command rw pid 2448 tid 100080 td 0xc74665c0 sched_switch(c74665c0,0,104,191,5b779ca4,...) at sched_switch+0x3bc mi_switch(104,0,c0e94f60,1f3,6c,...) at mi_switch+0x1eb sleepq_switch(c74665c0,0,c0e94f60,1a7,6c,...) at sleepq_switch+0x162 sleepq_catch_signals(c0e94f60,160,0,100,100,...) at sleepq_catch_signals+0xf9 sleepq_wait_sig(c745d578,6c,c0e97d3e,100,0,...) at sleepq_wait_sig+0x17 _sleep(c745d578,c745d600,16c,c0e97d3e,0,...) at _sleep+0x35c kern_wait(c74665c0,992,ef1a5c44,0,0,...) at kern_wait+0xbe6 wait4(c74665c0,ef1a5cec,ef1a5d28,c0e958ea,0,...) at wait4+0x3b syscallenter(c74665c0,ef1a5ce4,ef1a5ce4,fffffffe,246,...) at syscallenter+0x263 syscall(ef1a5d28) at syscall+0x4f Xint0x80_syscall() at Xint0x80_syscall+0x21 --- syscall (7, FreeBSD ELF32, wait4), eip = 0x2810493b, esp = 0xbfbfe7ac, ebp = 0xbfbfe7c8 --- Tracing command mkdir pid 2447 tid 100104 td 0xc742e2e0 sched_switch(c742e2e0,0,104,191,45cc3615,...) at sched_switch+0x3bc mi_switch(104,0,c0e94f60,1f3,6c,...) at mi_switch+0x1eb sleepq_switch(c742e2e0,0,c0e94f60,1a7,6c,...) at sleepq_switch+0x162 sleepq_catch_signals(c0e94f60,160,0,100,100,...) at sleepq_catch_signals+0xf9 sleepq_wait_sig(c74282bc,6c,c0e97d3e,100,0,...) at sleepq_wait_sig+0x17 _sleep(c74282bc,c7428344,16c,c0e97d3e,0,...) at _sleep+0x35c kern_wait(c742e2e0,991,ef23dc44,0,0,...) at kern_wait+0xbe6 wait4(c742e2e0,ef23dcec,ef23dd28,c0e958ea,0,...) at wait4+0x3b syscallenter(c742e2e0,ef23dce4,ef23dce4,fffffffe,246,...) at syscallenter+0x263 syscall(ef23dd28) at syscall+0x4f Xint0x80_syscall() at Xint0x80_syscall+0x21 --- syscall (7, FreeBSD ELF32, wait4), eip = 0x2810493b, esp = 0xbfbfe79c, ebp = 0xbfbfe7b8 --- Tracing command mkdir pid 2446 tid 100116 td 0xc786f2e0 sched_switch(c786f2e0,0,104,191,45ca928d,...) at sched_switch+0x3bc mi_switch(104,0,c0e94f60,1f3,6c,...) at mi_switch+0x1eb sleepq_switch(c786f2e0,0,c0e94f60,1a7,6c,...) at sleepq_switch+0x162 sleepq_catch_signals(c0e94f60,160,0,100,100,...) at sleepq_catch_signals+0xf9 sleepq_wait_sig(c786c000,6c,c0e97d3e,100,0,...) at sleepq_wait_sig+0x17 _sleep(c786c000,c786c088,16c,c0e97d3e,0,...) at _sleep+0x35c kern_wait(c786f2e0,98f,ef27dc44,0,0,...) at kern_wait+0xbe6 wait4(c786f2e0,ef27dcec,281a9d28,1,0,...) at wait4+0x3b syscallenter(c786f2e0,ef27dce4,c0cd942d,c101b570,0,...) at syscallenter+0x263 syscall(ef27dd28) at syscall+0x4f Xint0x80_syscall() at Xint0x80_syscall+0x21 --- syscall (7, FreeBSD ELF32, wait4), eip = 0x2810493b, esp = 0xbfbfe79c, ebp = 0xbfbfe7b8 --- Tracing command creat pid 2445 tid 100140 td 0xc7b5d5c0 sched_switch(c7b5d5c0,0,104,191,4601ab7f,...) at sched_switch+0x3bc mi_switch(104,0,c0e94f60,1f3,6c,...) at mi_switch+0x1eb sleepq_switch(c7b5d5c0,0,c0e94f60,1a7,6c,...) at sleepq_switch+0x162 sleepq_catch_signals(c0e94f60,160,0,100,100,...) at sleepq_catch_signals+0xf9 sleepq_wait_sig(c7b55578,6c,c0e97d3e,100,0,...) at sleepq_wait_sig+0x17 _sleep(c7b55578,c7b55600,16c,c0e97d3e,0,...) at _sleep+0x35c kern_wait(c7b5d5c0,9a4,ef2e2c44,0,0,...) at kern_wait+0xbe6 wait4(c7b5d5c0,ef2e2cec,281a9d28,1,0,...) at wait4+0x3b syscallenter(c7b5d5c0,ef2e2ce4,c0cd942d,c101b570,0,...) at syscallenter+0x263 syscall(ef2e2d28) at syscall+0x4f Xint0x80_syscall() at Xint0x80_syscall+0x21 --- syscall (7, FreeBSD ELF32, wait4), eip = 0x2810493b, esp = 0xbfbfe79c, ebp = 0xbfbfe7b8 --- Tracing command rw pid 2444 tid 100141 td 0xc7b5d2e0 sched_switch(c7b5d2e0,0,104,191,5b7671ae,...) at sched_switch+0x3bc mi_switch(104,0,c0e94f60,1f3,6c,...) at mi_switch+0x1eb sleepq_switch(c7b5d2e0,0,c0e94f60,1a7,6c,...) at sleepq_switch+0x162 sleepq_catch_signals(c0e94f60,160,0,100,100,...) at sleepq_catch_signals+0xf9 sleepq_wait_sig(c7b552bc,6c,c0e97d3e,100,0,...) at sleepq_wait_sig+0x17 _sleep(c7b552bc,c7b55344,16c,c0e97d3e,0,...) at _sleep+0x35c kern_wait(c7b5d2e0,990,ef2e6c44,0,0,...) at kern_wait+0xbe6 wait4(c7b5d2e0,ef2e6cec,281a9d28,1,0,...) at wait4+0x3b syscallenter(c7b5d2e0,ef2e6ce4,c0cd942d,c101b570,0,...) at syscallenter+0x263 syscall(ef2e6d28) at syscall+0x4f Xint0x80_syscall() at Xint0x80_syscall+0x21 --- syscall (7, FreeBSD ELF32, wait4), eip = 0x2810493b, esp = 0xbfbfe7ac, ebp = 0xbfbfe7c8 --- Tracing command run pid 2443 tid 100181 td 0xc97bb5c0 sched_switch(c97bb5c0,0,104,191,ab5486f1,...) at sched_switch+0x3bc mi_switch(104,0,c0e94f60,1f3,6c,...) at mi_switch+0x1eb sleepq_switch(c97bb5c0,0,c0e94f60,1a7,6c,...) at sleepq_switch+0x162 sleepq_catch_signals(c0e94f60,160,0,100,100,...) at sleepq_catch_signals+0xf9 sleepq_wait_sig(c97b6000,6c,c0e97d3e,100,0,...) at sleepq_wait_sig+0x17 _sleep(c97b6000,c97b6088,16c,c0e97d3e,0,...) at _sleep+0x35c kern_wait(c97bb5c0,98c,ef370c44,0,0,...) at kern_wait+0xbe6 wait4(c97bb5c0,ef370cec,ef370d28,c0e958ea,0,...) at wait4+0x3b syscallenter(c97bb5c0,ef370ce4,ef370ce4,fffffffe,246,...) at syscallenter+0x263 syscall(ef370d28) at syscall+0x4f Xint0x80_syscall() at Xint0x80_syscall+0x21 --- syscall (7, FreeBSD ELF32, wait4), eip = 0x2810393b, esp = 0xbfbfe22c, ebp = 0xbfbfe248 --- Tracing command run pid 2442 tid 100128 td 0xc786e000 sched_switch(c786e000,0,104,191,ab541b82,...) at sched_switch+0x3bc mi_switch(104,0,c0e94f60,1f3,6c,...) at mi_switch+0x1eb sleepq_switch(c786e000,0,c0e94f60,1a7,6c,...) at sleepq_switch+0x162 sleepq_catch_signals(c0e94f60,160,0,100,100,...) at sleepq_catch_signals+0xf9 sleepq_wait_sig(c7b52af0,6c,c0e97d3e,100,0,...) at sleepq_wait_sig+0x17 _sleep(c7b52af0,c7b52b78,16c,c0e97d3e,0,...) at _sleep+0x35c kern_wait(c786e000,98b,ef2bec44,0,0,...) at kern_wait+0xbe6 wait4(c786e000,ef2becec,ef2bed28,c0e958ea,0,...) at wait4+0x3b syscallenter(c786e000,ef2bece4,ef2bece4,fffffffe,246,...) at syscallenter+0x263 syscall(ef2bed28) at syscall+0x4f Xint0x80_syscall() at Xint0x80_syscall+0x21 --- syscall (7, FreeBSD ELF32, wait4), eip = 0x2810393b, esp = 0xbfbfe74c, ebp = 0xbfbfe768 --- Tracing command run pid 2441 tid 100180 td 0xc97bb8a0 sched_switch(c97bb8a0,0,104,191,ab53bdde,...) at sched_switch+0x3bc mi_switch(104,0,c0e94f60,1f3,6c,...) at mi_switch+0x1eb sleepq_switch(c97bb8a0,0,c0e94f60,1a7,6c,...) at sleepq_switch+0x162 sleepq_catch_signals(c0e94f60,160,0,100,100,...) at sleepq_catch_signals+0xf9 sleepq_wait_sig(c97b62bc,6c,c0e97d3e,100,0,...) at sleepq_wait_sig+0x17 _sleep(c97b62bc,c97b6344,16c,c0e97d3e,0,...) at _sleep+0x35c kern_wait(c97bb8a0,98a,ef36dc44,0,0,...) at kern_wait+0xbe6 wait4(c97bb8a0,ef36dcec,281a8d28,1,0,...) at wait4+0x3b syscallenter(c97bb8a0,ef36dce4,c0cd942d,c101b570,0,...) at syscallenter+0x263 syscall(ef36dd28) at syscall+0x4f Xint0x80_syscall() at Xint0x80_syscall+0x21 --- syscall (7, FreeBSD ELF32, wait4), eip = 0x2810393b, esp = 0xbfbfe74c, ebp = 0xbfbfe768 --- Tracing command sh pid 2436 tid 100175 td 0xc97bc8a0 sched_switch(c97bc8a0,0,104,191,d0bdf4cb,...) at sched_switch+0x3bc mi_switch(104,0,c0e94f60,1f3,6c,...) at mi_switch+0x1eb sleepq_switch(c97bc8a0,0,c0e94f60,1a7,6c,...) at sleepq_switch+0x162 sleepq_catch_signals(c0e94f60,160,0,100,100,...) at sleepq_catch_signals+0xf9 sleepq_wait_sig(c97b72bc,6c,c0e97d3e,100,0,...) at sleepq_wait_sig+0x17 _sleep(c97b72bc,c97b7344,16c,c0e97d3e,0,...) at _sleep+0x35c kern_wait(c97bc8a0,ffffffff,ef35ec44,2,0,...) at kern_wait+0xbe6 wait4(c97bc8a0,ef35ecec,ef35ed28,c0e958ea,0,...) at wait4+0x3b syscallenter(c97bc8a0,ef35ece4,ef35ece4,0,0,...) at syscallenter+0x263 syscall(ef35ed28) at syscall+0x4f Xint0x80_syscall() at Xint0x80_syscall+0x21 --- syscall (7, FreeBSD ELF32, wait4), eip = 0x2816a93b, esp = 0xbfbfe5dc, ebp = 0xbfbfe5f8 --- Tracing command su pid 2432 tid 100173 td 0xc97bd000 sched_switch(c97bd000,0,104,191,c78fd20b,...) at sched_switch+0x3bc mi_switch(104,0,c0e94f60,1f3,6c,...) at mi_switch+0x1eb sleepq_switch(c97bd000,0,c0e94f60,1a7,6c,...) at sleepq_switch+0x162 sleepq_catch_signals(c0e94f60,160,0,100,100,...) at sleepq_catch_signals+0xf9 sleepq_wait_sig(c97b7834,6c,c0e97d3e,100,0,...) at sleepq_wait_sig+0x17 _sleep(c97b7834,c97b78bc,16c,c0e97d3e,0,...) at _sleep+0x35c kern_wait(c97bd000,984,ef358c44,2,0,...) at kern_wait+0xbe6 wait4(c97bd000,ef358cec,281c8d28,1,0,...) at wait4+0x3b syscallenter(c97bd000,ef358ce4,c0cd942d,c101b570,0,...) at syscallenter+0x263 syscall(ef358d28) at syscall+0x4f Xint0x80_syscall() at Xint0x80_syscall+0x21 --- syscall (7, FreeBSD ELF32, wait4), eip = 0x2812393b, esp = 0xbfbfe2cc, ebp = 0xbfbfe2e8 --- Tracing command md5 pid 2421 tid 100169 td 0xc745e2e0 sched_switch(c745e2e0,0,104,191,1a322cd4,...) at sched_switch+0x3bc mi_switch(104,0,c0e94f60,1f3,5c,...) at mi_switch+0x1eb sleepq_switch(c745e2e0,0,c0e94f60,268,0,...) at sleepq_switch+0x162 sleepq_wait(c95ec000,5c,c0e3b5d1,0,0,...) at sleepq_wait+0x63 _sleep(c95ec000,c95ec020,25c,c0e3b5d1,0,...) at _sleep+0x372 md_kthread(c95ec000,ef34bd28,c0e8a0d8,390,c97b8578,...) at md_kthread+0x11a fork_exit(c072b150,c95ec000,ef34bd28) at fork_exit+0xb8 fork_trampoline() at fork_trampoline+0x8 --- trap 0, eip = 0, esp = 0xef34bd60, ebp = 0 --- Tracing command sh pid 2408 tid 100158 td 0xc7f5e2e0 sched_switch(c7f5e2e0,0,104,191,dc67a8b5,...) at sched_switch+0x3bc mi_switch(104,0,c0e94f60,1f3,6c,...) at mi_switch+0x1eb sleepq_switch(c7f5e2e0,0,c0e94f60,1a7,6c,...) at sleepq_switch+0x162 sleepq_catch_signals(c0e94f60,160,0,100,100,...) at sleepq_catch_signals+0xf9 sleepq_wait_sig(c7f19578,6c,c0e97d3e,100,0,...) at sleepq_wait_sig+0x17 _sleep(c7f19578,c7f19600,16c,c0e97d3e,0,...) at _sleep+0x35c kern_wait(c7f5e2e0,ffffffff,ef32ac44,2,0,...) at kern_wait+0xbe6 wait4(c7f5e2e0,ef32acec,ef32ad28,c0e958ea,0,...) at wait4+0x3b syscallenter(c7f5e2e0,ef32ace4,ef32ace4,0,0,...) at syscallenter+0x263 syscall(ef32ad28) at syscall+0x4f Xint0x80_syscall() at Xint0x80_syscall+0x21 --- syscall (7, FreeBSD ELF32, wait4), eip = 0x2816a93b, esp = 0xbfbfe76c, ebp = 0xbfbfe788 --- Tracing command bash pid 2353 tid 100164 td 0xc7f5d000 sched_switch(c7f5d000,0,104,191,aba393a3,...) at sched_switch+0x3bc mi_switch(104,0,c0e94f60,1f3,6c,...) at mi_switch+0x1eb sleepq_switch(c7f5d000,0,c0e94f60,1a7,6c,...) at sleepq_switch+0x162 sleepq_catch_signals(c0e94f60,160,0,100,100,...) at sleepq_catch_signals+0xf9 sleepq_wait_sig(c7f182bc,6c,c0e97d3e,100,0,...) at sleepq_wait_sig+0x17 _sleep(c7f182bc,c7f18344,16c,c0e97d3e,0,...) at _sleep+0x35c kern_wait(c7f5d000,ffffffff,ef33cc44,6,0,...) at kern_wait+0xbe6 wait4(c7f5d000,ef33ccec,ef33cd28,c0e958ea,0,...) at wait4+0x3b syscallenter(c7f5d000,ef33cce4,ef33cce4,0,0,...) at syscallenter+0x263 syscall(ef33cd28) at syscall+0x4f Xint0x80_syscall() at Xint0x80_syscall+0x21 --- syscall (7, FreeBSD ELF32, wait4), eip = 0x282c393b, esp = 0xbfbfe76c, ebp = 0xbfbfe788 --- Tracing command csh pid 2349 tid 100093 td 0xc74a6000 sched_switch(c74a6000,0,104,191,8253dfc3,...) at sched_switch+0x3bc mi_switch(104,0,c0e94f60,1f3,74,...) at mi_switch+0x1eb sleepq_switch(c74a6000,0,c0e94f60,1a7,74,...) at sleepq_switch+0x162 sleepq_catch_signals(c0e94f60,160,0,100,100,...) at sleepq_catch_signals+0xf9 sleepq_wait_sig(c776588c,74,c0d2796e,100,0,...) at sleepq_wait_sig+0x17 _sleep(c776588c,c77658bc,174,c0d2796e,0,...) at _sleep+0x35c kern_sigsuspend(c74a6000,0,0,0,0,...) at kern_sigsuspend+0xba sigsuspend(c74a6000,ef204cec,ef204d28,c0e958ea,0,...) at sigsuspend+0x4d syscallenter(c74a6000,ef204ce4,ef204ce4,0,0,...) at syscallenter+0x263 syscall(ef204d28) at syscall+0x4f Xint0x80_syscall() at Xint0x80_syscall+0x21 --- syscall (4, FreeBSD ELF32, write), eip = 0x2818ac7b, esp = 0xbfbfe58c, ebp = 0xbfbfe5f8 --- Tracing command su pid 2348 tid 100165 td 0xc7be4b80 sched_switch(c7be4b80,0,104,191,2bfb252d,...) at sched_switch+0x3bc mi_switch(104,0,c0e94f60,1f3,6c,...) at mi_switch+0x1eb sleepq_switch(c7be4b80,0,c0e94f60,1a7,6c,...) at sleepq_switch+0x162 sleepq_catch_signals(c0e94f60,160,0,100,100,...) at sleepq_catch_signals+0xf9 sleepq_wait_sig(c7f18000,6c,c0e97d3e,100,0,...) at sleepq_wait_sig+0x17 _sleep(c7f18000,c7f18088,16c,c0e97d3e,0,...) at _sleep+0x35c kern_wait(c7be4b80,92d,ef33fc44,2,0,...) at kern_wait+0xbe6 wait4(c7be4b80,ef33fcec,281c8d28,1,0,...) at wait4+0x3b syscallenter(c7be4b80,ef33fce4,c0cd942d,c101b570,0,...) at syscallenter+0x263 syscall(ef33fd28) at syscall+0x4f Xint0x80_syscall() at Xint0x80_syscall+0x21 --- syscall (7, FreeBSD ELF32, wait4), eip = 0x2812393b, esp = 0xbfbfe5bc, ebp = 0xbfbfe5d8 --- Tracing command bash pid 2316 tid 100102 td 0xc742e8a0 sched_switch(c742e8a0,0,104,191,b730541,...) at sched_switch+0x3bc mi_switch(104,0,c0e94f60,1f3,6c,...) at mi_switch+0x1eb sleepq_switch(c742e8a0,0,c0e94f60,1a7,6c,...) at sleepq_switch+0x162 sleepq_catch_signals(c0e94f60,160,0,100,100,...) at sleepq_catch_signals+0xf9 sleepq_wait_sig(c7428834,6c,c0e97d3e,100,0,...) at sleepq_wait_sig+0x17 _sleep(c7428834,c74288bc,16c,c0e97d3e,0,...) at _sleep+0x35c kern_wait(c742e8a0,ffffffff,ef235c44,6,0,...) at kern_wait+0xbe6 wait4(c742e8a0,ef235cec,ef235d28,c0e958ea,0,...) at wait4+0x3b syscallenter(c742e8a0,ef235ce4,ef235ce4,0,0,...) at syscallenter+0x263 syscall(ef235d28) at syscall+0x4f Xint0x80_syscall() at Xint0x80_syscall+0x21 --- syscall (7, FreeBSD ELF32, wait4), eip = 0x282c393b, esp = 0xbfbfe97c, ebp = 0xbfbfe998 --- Tracing command sshd pid 2315 tid 100078 td 0xc7466b80 sched_switch(c7466b80,0,104,191,d6f8bd3,...) at sched_switch+0x3bc mi_switch(104,0,c0e94f60,1f3,0,...) at mi_switch+0x1eb sleepq_switch(c7466b80,0,c0e94f60,1a7,0,...) at sleepq_switch+0x162 sleepq_catch_signals(c099d34a,c7b47290,0,c0e8dd67,c7466b80,...) at sleepq_catch_signals+0xf9 sleepq_wait_sig(c7b472a4,0,ef19da4c,101,0,...) at sleepq_wait_sig+0x17 _cv_wait_sig(c7b472a4,c7b47290,c0e975b1,627,c744e5e8,...) at _cv_wait_sig+0x243 seltdwait(c744e5e8,58,c7e1e080,c7466b80,246,...) at seltdwait+0xa2 kern_select(c7466b80,c,288060b4,288060bc,0,0,20,c745daf0,c745daf0) at kern_select+0x504 select(c7466b80,ef19dcec,ef19dd28,c0e958ea,0,...) at select+0x66 syscallenter(c7466b80,ef19dce4,ef19dce4,0,c1029b00,...) at syscallenter+0x263 syscall(ef19dd28) at syscall+0x4f Xint0x80_syscall() at Xint0x80_syscall+0x21 --- syscall (93, FreeBSD ELF32, select), eip = 0x284c45c3, esp = 0xbfbfe19c, ebp = 0xbfbfe1e8 --- Tracing command sshd pid 2313 tid 100157 td 0xc7f5e5c0 sched_switch(c7f5e5c0,0,104,191,c862c5b3,...) at sched_switch+0x3bc mi_switch(104,0,c0e94f60,1f3,68,...) at mi_switch+0x1eb sleepq_switch(c7f5e5c0,0,c0e94f60,1a7,68,...) at sleepq_switch+0x162 sleepq_catch_signals(c0e94f60,160,0,100,100,...) at sleepq_catch_signals+0xf9 sleepq_wait_sig(c776ac18,68,c0e9b401,100,0,...) at sleepq_wait_sig+0x17 _sleep(c776ac18,c776abd8,168,c0e9b401,0) at _sleep+0x35c sbwait(c776abb4,4,c0e9b4d9,5ec,c776abd8,...) at sbwait+0x76 soreceive_generic(c776ab60,0,ef327c28,0,0,...) at soreceive_generic+0x3f0 soreceive(c776ab60,0,ef327c28,0,0,0) at soreceive+0x38 soo_read(c74b06c8,ef327c28,c73f7680,0,c7f5e5c0,...) at soo_read+0x4e dofileread(ef327c28,ffffffff,ffffffff,0,c74b06c8,...) at dofileread+0x9e kern_readv(c7f5e5c0,5,ef327c28,ef327c48,1,...) at kern_readv+0x58 read(c7f5e5c0,ef327cec,ef327d28,c0e958ea,0,...) at read+0x4f syscallenter(c7f5e5c0,ef327ce4,ef327ce4,0,0,...) at syscallenter+0x263 syscall(ef327d28) at syscall+0x4f Xint0x80_syscall() at Xint0x80_syscall+0x21 --- syscall (3, FreeBSD ELF32, read), eip = 0x284c4643, esp = 0xbfbfdd3c, ebp = 0xbfbfdd78 --- Tracing command getty pid 2251 tid 100152 td 0xc71772e0 sched_switch(c71772e0,0,104,191,83410365,...) at sched_switch+0x3bc mi_switch(104,0,c0e94f60,1f3,0,...) at mi_switch+0x1eb sleepq_switch(c71772e0,0,c0e94f60,1a7,0,...) at sleepq_switch+0x162 sleepq_catch_signals(c0e94f60,160,0,c71772e0,c71772e0,...) at sleepq_catch_signals+0xf9 sleepq_wait_sig(c7181070,0,c0e99c7e,101,0,...) at sleepq_wait_sig+0x17 _cv_wait_sig(c7181070,c101b570,c0e9961c,514,0,...) at _cv_wait_sig+0x243 tty_wait(c7181000,c7181070,ef318c28,1,0,...) at tty_wait+0x71 ttydisc_read(c7181000,ef318c28,0,9f,0,...) at ttydisc_read+0x22c ttydev_read(c705e600,ef318c28,0,0,1,...) at ttydev_read+0xaa devfs_read_f(c7873c40,ef318c28,c6d9fe00,0,c71772e0,...) at devfs_read_f+0x7e dofileread(ef318c28,ffffffff,ffffffff,0,c7873c40,...) at dofileread+0x9e kern_readv(c71772e0,0,ef318c28,ef318c48,1,...) at kern_readv+0x58 read(c71772e0,ef318cec,ef318d28,c0e958ea,0,...) at read+0x4f syscallenter(c71772e0,ef318ce4,ef318ce4,0,0,...) at syscallenter+0x263 syscall(ef318d28) at syscall+0x4f Xint0x80_syscall() at Xint0x80_syscall+0x21 --- syscall (3, FreeBSD ELF32, read), eip = 0x28196643, esp = 0xbfbfed8c, ebp = 0xbfbfedb8 --- Tracing command getty pid 2250 tid 100151 td 0xc71775c0 sched_switch(c71775c0,0,104,191,833bb4ba,...) at sched_switch+0x3bc mi_switch(104,0,c0e94f60,1f3,0,...) at mi_switch+0x1eb sleepq_switch(c71775c0,0,c0e94f60,1a7,0,...) at sleepq_switch+0x162 sleepq_catch_signals(c0e94f60,160,0,c71775c0,c71775c0,...) at sleepq_catch_signals+0xf9 sleepq_wait_sig(c7181270,0,c0e99c7e,101,0,...) at sleepq_wait_sig+0x17 _cv_wait_sig(c7181270,c101b570,c0e9961c,514,0,...) at _cv_wait_sig+0x243 tty_wait(c7181200,c7181270,ef315c28,1,0,...) at tty_wait+0x71 ttydisc_read(c7181200,ef315c28,0,9f,0,...) at ttydisc_read+0x22c ttydev_read(c705e700,ef315c28,0,0,1,...) at ttydev_read+0xaa devfs_read_f(c7873738,ef315c28,c6d9fe00,0,c71775c0,...) at devfs_read_f+0x7e dofileread(ef315c28,ffffffff,ffffffff,0,c7873738,...) at dofileread+0x9e kern_readv(c71775c0,0,ef315c28,ef315c48,1,...) at kern_readv+0x58 read(c71775c0,ef315cec,ef315d28,c0e958ea,0,...) at read+0x4f syscallenter(c71775c0,ef315ce4,ef315ce4,0,0,...) at syscallenter+0x263 syscall(ef315d28) at syscall+0x4f Xint0x80_syscall() at Xint0x80_syscall+0x21 --- syscall (3, FreeBSD ELF32, read), eip = 0x28196643, esp = 0xbfbfed8c, ebp = 0xbfbfedb8 --- Tracing command getty pid 2249 tid 100097 td 0xc74a52e0 sched_switch(c74a52e0,0,104,191,833dff01,...) at sched_switch+0x3bc mi_switch(104,0,c0e94f60,1f3,0,...) at mi_switch+0x1eb sleepq_switch(c74a52e0,0,c0e94f60,1a7,0,...) at sleepq_switch+0x162 sleepq_catch_signals(c0e94f60,160,0,c74a52e0,c74a52e0,...) at sleepq_catch_signals+0xf9 sleepq_wait_sig(c7181470,0,c0e99c7e,101,0,...) at sleepq_wait_sig+0x17 _cv_wait_sig(c7181470,c101b570,c0e9961c,514,0,...) at _cv_wait_sig+0x243 tty_wait(c7181400,c7181470,ef21ac28,1,0,...) at tty_wait+0x71 ttydisc_read(c7181400,ef21ac28,0,9f,0,...) at ttydisc_read+0x22c ttydev_read(c705e800,ef21ac28,0,0,1,...) at ttydev_read+0xaa devfs_read_f(c7b36310,ef21ac28,c6d9fe00,0,c74a52e0,...) at devfs_read_f+0x7e dofileread(ef21ac28,ffffffff,ffffffff,0,c7b36310,...) at dofileread+0x9e kern_readv(c74a52e0,0,ef21ac28,ef21ac48,1,...) at kern_readv+0x58 read(c74a52e0,ef21acec,ef21ad28,c0e958ea,0,...) at read+0x4f syscallenter(c74a52e0,ef21ace4,ef21ace4,0,0,...) at syscallenter+0x263 syscall(ef21ad28) at syscall+0x4f Xint0x80_syscall() at Xint0x80_syscall+0x21 --- syscall (3, FreeBSD ELF32, read), eip = 0x28196643, esp = 0xbfbfed8c, ebp = 0xbfbfedb8 --- Tracing command getty pid 2248 tid 100077 td 0xc742eb80 sched_switch(c742eb80,0,104,191,832b4e77,...) at sched_switch+0x3bc mi_switch(104,0,c0e94f60,1f3,0,...) at mi_switch+0x1eb sleepq_switch(c742eb80,0,c0e94f60,1a7,0,...) at sleepq_switch+0x162 sleepq_catch_signals(c0e94f60,160,0,c742eb80,c742eb80,...) at sleepq_catch_signals+0xf9 sleepq_wait_sig(c6f59070,0,c0e99c7e,101,0,...) at sleepq_wait_sig+0x17 _cv_wait_sig(c6f59070,c101b570,c0e9961c,514,0,...) at _cv_wait_sig+0x243 tty_wait(c6f59000,c6f59070,ef199c28,1,0,...) at tty_wait+0x71 ttydisc_read(c6f59000,ef199c28,0,9f,0,...) at ttydisc_read+0x22c ttydev_read(c705e900,ef199c28,0,0,1,...) at ttydev_read+0xaa devfs_read_f(c7868c08,ef199c28,c6d9fe00,0,c742eb80,...) at devfs_read_f+0x7e dofileread(ef199c28,ffffffff,ffffffff,0,c7868c08,...) at dofileread+0x9e kern_readv(c742eb80,0,ef199c28,ef199c48,1,...) at kern_readv+0x58 read(c742eb80,ef199cec,ef199d28,c0e958ea,0,...) at read+0x4f syscallenter(c742eb80,ef199ce4,ef199ce4,0,0,...) at syscallenter+0x263 syscall(ef199d28) at syscall+0x4f Xint0x80_syscall() at Xint0x80_syscall+0x21 --- syscall (3, FreeBSD ELF32, read), eip = 0x28196643, esp = 0xbfbfed8c, ebp = 0xbfbfedb8 --- Tracing command getty pid 2247 tid 100092 td 0xc74a62e0 sched_switch(c74a62e0,0,104,191,83517652,...) at sched_switch+0x3bc mi_switch(104,0,c0e94f60,1f3,0,...) at mi_switch+0x1eb sleepq_switch(c74a62e0,0,c0e94f60,1a7,0,...) at sleepq_switch+0x162 sleepq_catch_signals(c0e94f60,160,0,c74a62e0,c74a62e0,...) at sleepq_catch_signals+0xf9 sleepq_wait_sig(c6f59270,0,c0e99c7e,101,0,...) at sleepq_wait_sig+0x17 _cv_wait_sig(c6f59270,c101b570,c0e9961c,514,0,...) at _cv_wait_sig+0x243 tty_wait(c6f59200,c6f59270,ef1f7c28,1,0,...) at tty_wait+0x71 ttydisc_read(c6f59200,ef1f7c28,0,9f,0,...) at ttydisc_read+0x22c ttydev_read(c705ea00,ef1f7c28,0,0,1,...) at ttydev_read+0xaa devfs_read_f(c7868af0,ef1f7c28,c6d9fe00,0,c74a62e0,...) at devfs_read_f+0x7e dofileread(ef1f7c28,ffffffff,ffffffff,0,c7868af0,...) at dofileread+0x9e kern_readv(c74a62e0,0,ef1f7c28,ef1f7c48,1,...) at kern_readv+0x58 read(c74a62e0,ef1f7cec,ef1f7d28,c0e958ea,0,...) at read+0x4f syscallenter(c74a62e0,ef1f7ce4,ef1f7ce4,0,0,...) at syscallenter+0x263 syscall(ef1f7d28) at syscall+0x4f Xint0x80_syscall() at Xint0x80_syscall+0x21 --- syscall (3, FreeBSD ELF32, read), eip = 0x28196643, esp = 0xbfbfed8c, ebp = 0xbfbfedb8 --- Tracing command getty pid 2246 tid 100098 td 0xc74a5000 sched_switch(c74a5000,0,104,191,8326c531,...) at sched_switch+0x3bc mi_switch(104,0,c0e94f60,1f3,0,...) at mi_switch+0x1eb sleepq_switch(c74a5000,0,c0e94f60,1a7,0,...) at sleepq_switch+0x162 sleepq_catch_signals(c0e94f60,160,0,c74a5000,c74a5000,...) at sleepq_catch_signals+0xf9 sleepq_wait_sig(c6f59470,0,c0e99c7e,101,0,...) at sleepq_wait_sig+0x17 _cv_wait_sig(c6f59470,c101b570,c0e9961c,514,0,...) at _cv_wait_sig+0x243 tty_wait(c6f59400,c6f59470,ef220c28,1,0,...) at tty_wait+0x71 ttydisc_read(c6f59400,ef220c28,0,9f,0,...) at ttydisc_read+0x22c ttydev_read(c705eb00,ef220c28,0,0,1,...) at ttydev_read+0xaa devfs_read_f(c7873380,ef220c28,c6d9fe00,0,c74a5000,...) at devfs_read_f+0x7e dofileread(ef220c28,ffffffff,ffffffff,0,c7873380,...) at dofileread+0x9e kern_readv(c74a5000,0,ef220c28,ef220c48,1,...) at kern_readv+0x58 read(c74a5000,ef220cec,ef220d28,c0e958ea,0,...) at read+0x4f syscallenter(c74a5000,ef220ce4,ef220ce4,0,0,...) at syscallenter+0x263 syscall(ef220d28) at syscall+0x4f Xint0x80_syscall() at Xint0x80_syscall+0x21 --- syscall (3, FreeBSD ELF32, read), eip = 0x28196643, esp = 0xbfbfed8c, ebp = 0xbfbfedb8 --- Tracing command getty pid 2245 tid 100103 td 0xc742e5c0 sched_switch(c742e5c0,0,104,191,832ca271,...) at sched_switch+0x3bc mi_switch(104,0,c0e94f60,1f3,0,...) at mi_switch+0x1eb sleepq_switch(c742e5c0,0,c0e94f60,1a7,0,...) at sleepq_switch+0x162 sleepq_catch_signals(c0e94f60,160,0,c742e5c0,c742e5c0,...) at sleepq_catch_signals+0xf9 sleepq_wait_sig(c6f59670,0,c0e99c7e,101,0,...) at sleepq_wait_sig+0x17 _cv_wait_sig(c6f59670,c101b570,c0e9961c,514,0,...) at _cv_wait_sig+0x243 tty_wait(c6f59600,c6f59670,ef239c28,1,0,...) at tty_wait+0x71 ttydisc_read(c6f59600,ef239c28,0,9f,0,...) at ttydisc_read+0x22c ttydev_read(c705ec00,ef239c28,0,0,1,...) at ttydev_read+0xaa devfs_read_f(c7873850,ef239c28,c6d9fe00,0,c742e5c0,...) at devfs_read_f+0x7e dofileread(ef239c28,ffffffff,ffffffff,0,c7873850,...) at dofileread+0x9e kern_readv(c742e5c0,0,ef239c28,ef239c48,1,...) at kern_readv+0x58 read(c742e5c0,ef239cec,ef239d28,c0e958ea,0,...) at read+0x4f syscallenter(c742e5c0,ef239ce4,ef239ce4,0,0,...) at syscallenter+0x263 syscall(ef239d28) at syscall+0x4f Xint0x80_syscall() at Xint0x80_syscall+0x21 --- syscall (3, FreeBSD ELF32, read), eip = 0x28196643, esp = 0xbfbfed8c, ebp = 0xbfbfedb8 --- Tracing command getty pid 2244 tid 100112 td 0xc7870000 sched_switch(c7870000,0,104,191,833076f8,...) at sched_switch+0x3bc mi_switch(104,0,c0e94f60,1f3,0,...) at mi_switch+0x1eb sleepq_switch(c7870000,0,c0e94f60,1a7,0,...) at sleepq_switch+0x162 sleepq_catch_signals(c0e94f60,160,0,c7870000,c7870000,...) at sleepq_catch_signals+0xf9 sleepq_wait_sig(c6f59870,0,c0e99c7e,101,0,...) at sleepq_wait_sig+0x17 _cv_wait_sig(c6f59870,c101b570,c0e9961c,514,0,...) at _cv_wait_sig+0x243 tty_wait(c6f59800,c6f59870,ef271c28,1,0,...) at tty_wait+0x71 ttydisc_read(c6f59800,ef271c28,0,9f,0,...) at ttydisc_read+0x22c ttydev_read(c705ed00,ef271c28,0,0,1,...) at ttydev_read+0xaa devfs_read_f(c7b36230,ef271c28,c6d9fe00,0,c7870000,...) at devfs_read_f+0x7e dofileread(ef271c28,ffffffff,ffffffff,0,c7b36230,...) at dofileread+0x9e kern_readv(c7870000,0,ef271c28,ef271c48,1,...) at kern_readv+0x58 read(c7870000,ef271cec,ef271d28,c0e958ea,0,...) at read+0x4f syscallenter(c7870000,ef271ce4,ef271ce4,0,0,...) at syscallenter+0x263 syscall(ef271d28) at syscall+0x4f Xint0x80_syscall() at Xint0x80_syscall+0x21 --- syscall (3, FreeBSD ELF32, read), eip = 0x28196643, esp = 0xbfbfed8c, ebp = 0xbfbfedb8 --- Tracing command getty pid 2243 tid 100109 td 0xc74a32e0 sched_switch(c74a32e0,0,104,191,2c97cac0,...) at sched_switch+0x3bc mi_switch(104,0,c0e94f60,1f3,0,...) at mi_switch+0x1eb sleepq_switch(c74a32e0,0,c0e94f60,1a7,0,...) at sleepq_switch+0x162 sleepq_catch_signals(c099d34a,c6f59a04,0,c0e8dd67,c74a32e0,...) at sleepq_catch_signals+0xf9 sleepq_wait_sig(c6f59a70,0,ef268ad8,101,0,...) at sleepq_wait_sig+0x17 _cv_wait_sig(c6f59a70,c6f59a04,c0e9961c,514,0,...) at _cv_wait_sig+0x243 tty_wait(c6f59a00,c6f59a70,ef268c28,1,0,...) at tty_wait+0x71 ttydisc_read(c6f59a00,ef268c28,0,9f,0,...) at ttydisc_read+0x22c ttydev_read(c6ec7e00,ef268c28,0,0,1,...) at ttydev_read+0xaa devfs_read_f(c74b0af0,ef268c28,c6d9fe00,0,c74a32e0,...) at devfs_read_f+0x7e dofileread(ef268c28,ffffffff,ffffffff,0,c74b0af0,...) at dofileread+0x9e kern_readv(c74a32e0,0,ef268c28,ef268c48,1,...) at kern_readv+0x58 read(c74a32e0,ef268cec,ef268d28,c0e958ea,0,...) at read+0x4f syscallenter(c74a32e0,ef268ce4,ef268ce4,0,0,...) at syscallenter+0x263 syscall(ef268d28) at syscall+0x4f Xint0x80_syscall() at Xint0x80_syscall+0x21 --- syscall (3, FreeBSD ELF32, read), eip = 0x28196643, esp = 0xbfbfed8c, ebp = 0xbfbfedb8 --- Tracing command inetd pid 2203 tid 100107 td 0xc74298a0 sched_switch(c74298a0,0,104,191,51e815d8,...) at sched_switch+0x3bc mi_switch(104,0,c0e94f60,1f3,0,...) at mi_switch+0x1eb sleepq_switch(c74298a0,0,c0e94f60,1a7,0,...) at sleepq_switch+0x162 sleepq_catch_signals(c099d34a,c74649d0,0,c0e8dd67,c74298a0,...) at sleepq_catch_signals+0xf9 sleepq_wait_sig(c74649e4,0,ef260a4c,101,0,...) at sleepq_wait_sig+0x17 _cv_wait_sig(c74649e4,c74649d0,c0e975b1,627,c7868d20,...) at _cv_wait_sig+0x243 seltdwait(c7868d20,58,c6d9fe00,c74298a0,c0e8dd67,...) at seltdwait+0xa2 kern_select(c74298a0,6,bfbfdfa0,0,0,0,20,c73a3834,c73a3834) at kern_select+0x504 select(c74298a0,ef260cec,ef260d28,c0e958ea,0,...) at select+0x66 syscallenter(c74298a0,ef260ce4,ef260ce4,0,0,...) at syscallenter+0x263 syscall(ef260d28) at syscall+0x4f Xint0x80_syscall() at Xint0x80_syscall+0x21 --- syscall (93, FreeBSD ELF32, select), eip = 0x281a85c3, esp = 0xbfbfdf5c, ebp = 0xbfbfede8 --- Tracing command watchdogd pid 2179 tid 100086 td 0xc74a6b80 sched_switch(c74a6b80,0,104,191,18c9f807,...) at sched_switch+0x3bc mi_switch(104,0,c0e94f60,1f3,6c,...) at mi_switch+0x1eb sleepq_switch(c74a6b80,0,c0e94f60,1a7,6c,...) at sleepq_switch+0x162 sleepq_catch_signals(c0e94f60,160,0,100,100,...) at sleepq_catch_signals+0xf9 sleepq_wait_sig(c7024af0,6c,c0e97d3e,100,0,...) at sleepq_wait_sig+0x17 _sleep(c7024af0,c7024b78,16c,c0e97d3e,0,...) at _sleep+0x35c kern_wait(c74a6b80,9de,ef1bdc44,0,0,...) at kern_wait+0xbe6 wait4(c74a6b80,ef1bdcec,bfbfec4c,1,0,...) at wait4+0x3b syscallenter(c74a6b80,ef1bdce4,c0cd942d,c101b570,0,...) at syscallenter+0x263 syscall(ef1bdd28) at syscall+0x4f Xint0x80_syscall() at Xint0x80_syscall+0x21 --- syscall (7, FreeBSD ELF32, wait4), eip = 0x2811c93b, esp = 0xbfbfec3c, ebp = 0xbfbfece8 --- Tracing command cron pid 2132 tid 100119 td 0xc786e8a0 sched_switch(c786e8a0,0,104,191,17827f1e,...) at sched_switch+0x3bc mi_switch(104,0,c0e94f60,1f3,6c,...) at mi_switch+0x1eb sleepq_switch(c786e8a0,0,c0e94f60,1a7,6c,...) at sleepq_switch+0x162 sleepq_catch_signals(e679,c09ec5a0,c786e8a0,3,100,...) at sleepq_catch_signals+0xf9 sleepq_timedwait_sig(c101ce84,6c,c0e90cb7,100,0,...) at sleepq_timedwait_sig+0x1a _sleep(c101ce84,0,16c,c0e90cb7,e679,...) at _sleep+0x328 kern_nanosleep(c786e8a0,ef286c34,ef286c3c,3b,0,...) at kern_nanosleep+0xc1 nanosleep(c786e8a0,ef286cec,ef286d28,c0e958ea,0,...) at nanosleep+0x6f syscallenter(c786e8a0,ef286ce4,ef286ce4,0,0,...) at syscallenter+0x263 syscall(ef286d28) at syscall+0x4f Xint0x80_syscall() at Xint0x80_syscall+0x21 --- syscall (240, FreeBSD ELF32, nanosleep), eip = 0x28184b77, esp = 0xbfbfec4c, ebp = 0xbfbfec78 --- Tracing command sendmail pid 2124 tid 100131 td 0xc74a85c0 sched_switch(c74a85c0,0,104,191,7cc19d1c,...) at sched_switch+0x3bc mi_switch(104,0,c0e94f60,1f3,74,...) at mi_switch+0x1eb sleepq_switch(c74a85c0,0,c0e94f60,1a7,74,...) at sleepq_switch+0x162 sleepq_catch_signals(c0e94f60,160,0,100,100,...) at sleepq_catch_signals+0xf9 sleepq_wait_sig(c7b52314,74,c0d2796e,100,0,...) at sleepq_wait_sig+0x17 _sleep(c7b52314,c7b52344,174,c0d2796e,0,...) at _sleep+0x35c kern_sigsuspend(c74a85c0,0,0,0,0,...) at kern_sigsuspend+0xba sigsuspend(c74a85c0,ef2c7cec,ef2c7d28,c0e958ea,0,...) at sigsuspend+0x4d syscallenter(c74a85c0,ef2c7ce4,ef2c7ce4,0,0,...) at syscallenter+0x263 syscall(ef2c7d28) at syscall+0x4f Xint0x80_syscall() at Xint0x80_syscall+0x21 --- syscall (4, FreeBSD ELF32, write), eip = 0x28338c7b, esp = 0xbfbfcf9c, ebp = 0xbfbfcfc8 --- Tracing command sendmail pid 2118 tid 100088 td 0xc74652e0 sched_switch(c74652e0,0,104,191,63db2d6b,...) at sched_switch+0x3bc mi_switch(104,0,c0e94f60,1f3,0,...) at mi_switch+0x1eb sleepq_switch(c74652e0,0,c0e94f60,1a7,0,...) at sleepq_switch+0x162 sleepq_catch_signals(ef1c5a14,c099d34a,c7463c50,0,c74652e0,...) at sleepq_catch_signals+0xf9 sleepq_timedwait_sig(c7463c64,0,ef1c5a4c,101,0,...) at sleepq_timedwait_sig+0x1a _cv_timedwait_sig(c7463c64,c7463c50,1389,627,c7433700,...) at _cv_timedwait_sig+0x252 seltdwait(ef1c5bf8,ef1c5c00,c73f7380,c74652e0,ef1c5af8,...) at seltdwait+0x8a kern_select(c74652e0,5,bfbfc510,0,0,ef1c5c40,20,5,0) at kern_select+0x504 select(c74652e0,ef1c5cec,ef1c5d28,c0e958ea,0,...) at select+0x66 syscallenter(c74652e0,ef1c5ce4,ef1c5ce4,0,74b,...) at syscallenter+0x263 syscall(ef1c5d28) at syscall+0x4f Xint0x80_syscall() at Xint0x80_syscall+0x21 --- syscall (93, FreeBSD ELF32, select), eip = 0x283e05c3, esp = 0xbfbfc47c, ebp = 0xbfbfcfa8 --- Tracing command sshd pid 2110 tid 100136 td 0xc7be25c0 sched_switch(c7be25c0,0,104,191,9b2199b4,...) at sched_switch+0x3bc mi_switch(104,0,c0e94f60,1f3,0,...) at mi_switch+0x1eb sleepq_switch(c7be25c0,0,c0e94f60,1a7,0,...) at sleepq_switch+0x162 sleepq_catch_signals(c099d34a,c7464a90,0,c0e8dd67,c7be25c0,...) at sleepq_catch_signals+0xf9 sleepq_wait_sig(c7464aa4,0,ef2d6a4c,101,0,...) at sleepq_wait_sig+0x17 _cv_wait_sig(c7464aa4,c7464a90,c0e975b1,627,c7433690,...) at _cv_wait_sig+0x243 seltdwait(c7433690,58,c7455080,c7be25c0,f33,...) at seltdwait+0xa2 kern_select(c7be25c0,5,288cc0b4,0,0,0,20,c7b512bc,c7b512bc) at kern_select+0x504 select(c7be25c0,ef2d6cec,2880a070,1,0,...) at select+0x66 syscallenter(c7be25c0,ef2d6ce4,c0cd942d,c101b570,0,...) at syscallenter+0x263 syscall(ef2d6d28) at syscall+0x4f Xint0x80_syscall() at Xint0x80_syscall+0x21 --- syscall (93, FreeBSD ELF32, select), eip = 0x284c45c3, esp = 0xbfbfe25c, ebp = 0xbfbfedf8 --- Tracing command moused pid 2050 tid 100108 td 0xc74295c0 sched_switch(c74295c0,0,104,191,fa711e9a,...) at sched_switch+0x3bc mi_switch(104,0,c0e94f60,1f3,0,...) at mi_switch+0x1eb sleepq_switch(c74295c0,0,c0e94f60,1a7,0,...) at sleepq_switch+0x162 sleepq_catch_signals(c099d34a,c7464ad0,0,c0e8dd67,c74295c0,...) at sleepq_catch_signals+0xf9 sleepq_wait_sig(c7464ae4,0,ef264a4c,101,0,...) at sleepq_wait_sig+0x17 _cv_wait_sig(c7464ae4,c7464ad0,c0e975b1,627,c7868690,...) at _cv_wait_sig+0x243 seltdwait(c7868690,58,c6d9fe00,c74295c0,14,...) at seltdwait+0xa2 kern_select(c74295c0,6,bfbfea04,0,0,0,20,c73a3578,c73a3578) at kern_select+0x504 select(c74295c0,ef264cec,ef264d28,c0e958ea,0,...) at select+0x66 syscallenter(c74295c0,ef264ce4,ef264ce4,0,0,...) at syscallenter+0x263 syscall(ef264d28) at syscall+0x4f Xint0x80_syscall() at Xint0x80_syscall+0x21 --- syscall (93, FreeBSD ELF32, select), eip = 0x281b35c3, esp = 0xbfbfe99c, ebp = 0xbfbfeb28 --- Tracing command ntpd pid 1990 tid 100132 td 0xc74a82e0 sched_switch(c74a82e0,0,104,191,63c08ee5,...) at sched_switch+0x3bc mi_switch(104,0,c0e94f60,1f3,0,...) at mi_switch+0x1eb sleepq_switch(c74a82e0,0,c0e94f60,1a7,0,...) at sleepq_switch+0x162 sleepq_catch_signals(c099d34a,c7b472d0,0,c0e8dd67,c74a82e0,...) at sleepq_catch_signals+0xf9 sleepq_wait_sig(c7b472e4,0,ef2caa4c,101,0,...) at sleepq_wait_sig+0x17 _cv_wait_sig(c7b472e4,c7b472d0,c0e975b1,627,c7432578,...) at _cv_wait_sig+0x243 seltdwait(c7432578,58,c6d9fe00,c74a82e0,0,...) at seltdwait+0xa2 kern_select(c74a82e0,1c,bfbfece8,0,0,0,20,c7b52000,c7b52000) at kern_select+0x504 select(c74a82e0,ef2cacec,ef2cad80,ef2cac88,0,...) at select+0x66 syscallenter(c74a82e0,ef2cace4,c0cd90e6,fffffffe,246,...) at syscallenter+0x263 syscall(ef2cad28) at syscall+0x4f Xint0x80_syscall() at Xint0x80_syscall+0x21 --- syscall (93, FreeBSD ELF32, select), eip = 0x283625c3, esp = 0xbfbfecbc, ebp = 0xbfbfed88 --- Tracing command nfsd pid 1874 tid 100125 td 0xc71778a0 sched_switch(c71778a0,0,104,191,63bf03b2,...) at sched_switch+0x3bc mi_switch(104,0,c0e94f60,1f3,0,...) at mi_switch+0x1eb sleepq_switch(c71778a0,0,c0e94f60,1a7,0,...) at sleepq_switch+0x162 sleepq_catch_signals(ef2b3be0,c099d34a,c703db80,0,c71778a0,...) at sleepq_catch_signals+0xf9 sleepq_timedwait_sig(c74b35d0,0,ef2b3c18,101,0,...) at sleepq_timedwait_sig+0x1a _cv_timedwait_sig(c74b35d0,c703db80,1388,3b1,0,...) at _cv_timedwait_sig+0x252 svc_run_internal(ef2b3d14,c0980608,c703db80,ef2b3d28,c0e8a0d8,...) at svc_run_internal+0x356 svc_thread_start(c703db80,ef2b3d28,c0e8a0d8,390,c7b53000,...) at svc_thread_start+0x10 fork_exit(c0b90c90,c703db80,ef2b3d28) at fork_exit+0xb8 fork_trampoline() at fork_trampoline+0x8 --- trap 0x804c12e, eip = 0xc, esp = 0x33, ebp = 0x1 --- Tracing command nfsd pid 1874 tid 100124 td 0xc7177b80 sched_switch(c7177b80,0,104,191,dea64e1,...) at sched_switch+0x3bc mi_switch(104,0,c0e94f60,1f3,0,...) at mi_switch+0x1eb sleepq_switch(c7177b80,0,c0e94f60,1a7,0,...) at sleepq_switch+0x162 sleepq_catch_signals(ef2b0be0,c099d34a,c703db80,0,c7177b80,...) at sleepq_catch_signals+0xf9 sleepq_timedwait_sig(c74b3610,0,ef2b0c18,101,0,...) at sleepq_timedwait_sig+0x1a _cv_timedwait_sig(c74b3610,c703db80,1388,3b1,0,...) at _cv_timedwait_sig+0x252 svc_run_internal(ef2b0d14,c0980608,c703db80,ef2b0d28,c0e8a0d8,...) at svc_run_internal+0x356 svc_thread_start(c703db80,ef2b0d28,c0e8a0d8,390,c7b53000,...) at svc_thread_start+0x10 fork_exit(c0b90c90,c703db80,ef2b0d28) at fork_exit+0xb8 fork_trampoline() at fork_trampoline+0x8 --- trap 0x804c12e, eip = 0xc, esp = 0x33, ebp = 0x1 --- Tracing command nfsd pid 1874 tid 100123 td 0xc7429000 sched_switch(c7429000,0,104,191,4cc99db9,...) at sched_switch+0x3bc mi_switch(104,0,c0e94f60,1f3,0,...) at mi_switch+0x1eb sleepq_switch(c7429000,0,c0e94f60,1a7,0,...) at sleepq_switch+0x162 sleepq_catch_signals(ef2adbe0,c099d34a,c703db80,0,c7429000,...) at sleepq_catch_signals+0xf9 sleepq_timedwait_sig(c74b3650,0,ef2adc18,101,0,...) at sleepq_timedwait_sig+0x1a _cv_timedwait_sig(c74b3650,c703db80,1388,3b1,0,...) at _cv_timedwait_sig+0x252 svc_run_internal(ef2add14,c0980608,c703db80,ef2add28,c0e8a0d8,...) at svc_run_internal+0x356 svc_thread_start(c703db80,ef2add28,c0e8a0d8,390,c7b53000,...) at svc_thread_start+0x10 fork_exit(c0b90c90,c703db80,ef2add28) at fork_exit+0xb8 fork_trampoline() at fork_trampoline+0x8 --- trap 0x804c12e, eip = 0xc, esp = 0x33, ebp = 0x1 --- Tracing command nfsd pid 1874 tid 100122 td 0xc786e2e0 sched_switch(c786e2e0,0,104,191,b8141cad,...) at sched_switch+0x3bc mi_switch(104,0,c0e94f60,1f3,0,...) at mi_switch+0x1eb sleepq_switch(c786e2e0,0,c0e94f60,1a7,0,...) at sleepq_switch+0x162 sleepq_catch_signals(ef2aa5b4,c099d34a,c703db80,0,c786e2e0,...) at sleepq_catch_signals+0xf9 sleepq_timedwait_sig(c74de3d0,0,ef2aa5ec,101,0,...) at sleepq_timedwait_sig+0x1a _cv_timedwait_sig(c74de3d0,c703db80,1388,3b1,ef2aa634,...) at _cv_timedwait_sig+0x252 svc_run_internal(c786e490,14,c0ebddda,c0e81d9b,ef2aa7f4,...) at svc_run_internal+0x356 svc_run(c703db80,0,c0e81d76,19d,ef2aac38,...) at svc_run+0x7b nfsrvd_nfsd(c786e2e0,ef2aa7f4,c,804cacc,804cb64,...) at nfsrvd_nfsd+0x8e nfssvc_nfsd(c786e2e0,ef2aacec,c7b53000,0,ef2aac7c,...) at nfssvc_nfsd+0x167 nfssvc(c786e2e0,ef2aacec,ef2aad28,c0e958ea,0,...) at nfssvc+0xeb syscallenter(c786e2e0,ef2aace4,ef2aace4,0,0,...) at syscallenter+0x263 syscall(ef2aad28) at syscall+0x4f Xint0x80_syscall() at Xint0x80_syscall+0x21 --- syscall (155, FreeBSD ELF32, nfssvc), eip = 0x280dd85b, esp = 0xbfbfe82c, ebp = 0xbfbfea98 --- Tracing command nfsd pid 1873 tid 100085 td 0xc74658a0 sched_switch(c74658a0,0,104,191,d7f1ce28,...) at sched_switch+0x3bc mi_switch(104,0,c0e94f60,1f3,0,...) at mi_switch+0x1eb sleepq_switch(c74658a0,0,c0e94f60,1a7,0,...) at sleepq_switch+0x162 sleepq_catch_signals(c099d34a,c7872150,0,c0e8dd67,c74658a0,...) at sleepq_catch_signals+0xf9 sleepq_wait_sig(c7872164,0,ef1b9a4c,101,0,...) at sleepq_wait_sig+0x17 _cv_wait_sig(c7872164,c7872150,c0e975b1,627,c7873000,...) at _cv_wait_sig+0x243 seltdwait(c7873000,58,c6d9fe00,c74658a0,f33,...) at seltdwait+0xa2 kern_select(c74658a0,7,bfbfecb4,0,0,0,20,c745a834,c745a834) at kern_select+0x504 select(c74658a0,ef1b9cec,bfbffff4,1,0,...) at select+0x66 syscallenter(c74658a0,ef1b9ce4,c0cd942d,c101b570,0,...) at syscallenter+0x263 syscall(ef1b9d28) at syscall+0x4f Xint0x80_syscall() at Xint0x80_syscall+0x21 --- syscall (93, FreeBSD ELF32, select), eip = 0x281845c3, esp = 0xbfbfea9c, ebp = 0xbfbfede8 --- Tracing command mountd pid 1863 tid 100120 td 0xc786e5c0 sched_switch(c786e5c0,0,104,191,c14bc796,...) at sched_switch+0x3bc mi_switch(104,0,c0e94f60,1f3,0,...) at mi_switch+0x1eb sleepq_switch(c786e5c0,0,c0e94f60,1a7,0,...) at sleepq_switch+0x162 sleepq_catch_signals(c099d34a,c7b476d0,0,c0e8dd67,c786e5c0,...) at sleepq_catch_signals+0xf9 sleepq_wait_sig(c7b476e4,0,ef289a4c,101,0,...) at sleepq_wait_sig+0x17 _cv_wait_sig(c7b476e4,c7b476d0,c0e975b1,627,c7b36188,...) at _cv_wait_sig+0x243 seltdwait(c7b36188,58,c6d9fe00,c786e5c0,c0e974b7,...) at seltdwait+0xa2 kern_select(c786e5c0,9,bfbfed3c,0,0,0,20,c77662bc,c77662bc) at kern_select+0x504 select(c786e5c0,ef289cec,ef289d28,c0e958ea,0,...) at select+0x66 syscallenter(c786e5c0,ef289ce4,ef289ce4,0,0,...) at syscallenter+0x263 syscall(ef289d28) at syscall+0x4f Xint0x80_syscall() at Xint0x80_syscall+0x21 --- syscall (93, FreeBSD ELF32, select), eip = 0x2819a5c3, esp = 0xbfbfed0c, ebp = 0xbfbfedd8 --- Tracing command rpcbind pid 1764 tid 100111 td 0xc78702e0 sched_switch(c78702e0,0,104,191,2cda27da,...) at sched_switch+0x3bc mi_switch(104,0,c0e94f60,1f3,0,...) at mi_switch+0x1eb sleepq_switch(c78702e0,0,c0e94f60,1a7,0,...) at sleepq_switch+0x162 sleepq_catch_signals(ef26ea6c,c099d34a,c7463d10,0,c78702e0,...) at sleepq_catch_signals+0xf9 sleepq_timedwait_sig(c7463d24,0,ef26eaa4,101,0,...) at sleepq_timedwait_sig+0x1a _cv_timedwait_sig(c7463d24,c7463d10,7531,627,ef26eb5c,...) at _cv_timedwait_sig+0x252 seltdwait(ef26ec2c,ef26ec34,535,c78702e0,ef26eb2c,...) at seltdwait+0x8a poll(c78702e0,ef26ecec,ef26ed28,c0e958ea,0,...) at poll+0x300 syscallenter(c78702e0,ef26ece4,ef26ece4,0,74b,...) at syscallenter+0x263 syscall(ef26ed28) at syscall+0x4f Xint0x80_syscall() at Xint0x80_syscall+0x21 --- syscall (209, FreeBSD ELF32, poll), eip = 0x2813f7ab, esp = 0xbfbfcbac, ebp = 0xbfbfed78 --- Tracing command syslogd pid 1717 tid 100110 td 0xc74a3000 sched_switch(c74a3000,0,104,191,2b5a042c,...) at sched_switch+0x3bc mi_switch(104,0,c0e94f60,1f3,0,...) at mi_switch+0x1eb sleepq_switch(c74a3000,0,c0e94f60,1a7,0,...) at sleepq_switch+0x162 sleepq_catch_signals(c099d34a,c7872290,0,c0e8dd67,c74a3000,...) at sleepq_catch_signals+0xf9 sleepq_wait_sig(c78722a4,0,ef26ba4c,101,0,...) at sleepq_wait_sig+0x17 _cv_wait_sig(c78722a4,c7872290,c0e975b1,627,c74b08f8,...) at _cv_wait_sig+0x243 seltdwait(c74b08f8,58,c6d9fe00,c74a3000,0,...) at seltdwait+0xa2 kern_select(c74a3000,9,2847f0ac,0,0,0,20,c786d2bc,c786d2bc) at kern_select+0x504 select(c74a3000,ef26bcec,ef26bd28,c0e958ea,0,...) at select+0x66 syscallenter(c74a3000,ef26bce4,ef26bce4,0,246,...) at syscallenter+0x263 syscall(ef26bd28) at syscall+0x4f Xint0x80_syscall() at Xint0x80_syscall+0x21 --- syscall (93, FreeBSD ELF32, select), eip = 0x281995c3, esp = 0xbfbfe29c, ebp = 0xbfbfede8 --- Tracing command devd pid 1516 tid 100121 td 0xc74292e0 sched_switch(c74292e0,0,104,191,4693ad95,...) at sched_switch+0x3bc mi_switch(104,0,c0e94f60,1f3,0,...) at mi_switch+0x1eb sleepq_switch(c74292e0,0,c0e94f60,1a7,0,...) at sleepq_switch+0x162 sleepq_catch_signals(c099d34a,c78722d0,0,c0e8dd67,c74292e0,...) at sleepq_catch_signals+0xf9 sleepq_wait_sig(c78722e4,0,ef28ca4c,101,0,...) at sleepq_wait_sig+0x17 _cv_wait_sig(c78722e4,c78722d0,c0e975b1,627,c74325e8,...) at _cv_wait_sig+0x243 seltdwait(c74325e8,58,c6d9fe00,c74292e0,c0ec7609,...) at seltdwait+0xa2 kern_select(c74292e0,5,bfbfe960,0,0,0,20,c73a32bc,c73a32bc) at kern_select+0x504 select(c74292e0,ef28ccec,c09d229c,c1029b30,0,...) at select+0x66 syscallenter(c74292e0,ef28cce4,ef28ccc0,c09d4938,c102a800,...) at syscallenter+0x263 syscall(ef28cd28) at syscall+0x4f Xint0x80_syscall() at Xint0x80_syscall+0x21 --- syscall (93, FreeBSD ELF32, select), eip = 0x808b98b, esp = 0xbfbfe92c, ebp = 0xbfbfee08 --- Tracing command softdepflush pid 18 tid 100075 td 0xc7045b80 sched_switch(c7045b80,0,104,191,235eb17b,...) at sched_switch+0x3bc mi_switch(104,0,c0e94f60,1f3,54,...) at mi_switch+0x1eb sleepq_switch(c7045b80,0,c0e94f60,28b,0,...) at sleepq_switch+0x162 sleepq_timedwait(c1199680,54,c0ec4c3a,0,0,...) at sleepq_timedwait+0x6b _sleep(c1199680,c1199630,54,c0ec4c3a,3e8,...) at _sleep+0x342 softdep_flush(0,ecfa6d28,c0e8a0d8,390,c73a12bc,...) at softdep_flush+0x256 fork_exit(c0bdf1a0,0,ecfa6d28) at fork_exit+0xb8 fork_trampoline() at fork_trampoline+0x8 --- trap 0, eip = 0, esp = 0xecfa6d60, ebp = 0 --- Tracing command syncer pid 17 tid 100074 td 0xc7175000 sched_switch(c7175000,0,104,191,273471fe,...) at sched_switch+0x3bc mi_switch(104,0,c0e94f60,1f3,0,...) at mi_switch+0x1eb sleepq_switch(c7175000,0,c0e94f60,28b,c7175000,...) at sleepq_switch+0x162 sleepq_timedwait(c1193074,0,ecfa3c78,1,0,...) at sleepq_timedwait+0x6b _cv_timedwait(c1193074,c1193060,3e8,768,4e20,...) at _cv_timedwait+0x252 sched_sync(0,ecfa3d28,c0e8a0d8,390,c73a1578,...) at sched_sync+0x595 fork_exit(c0a47d40,0,ecfa3d28) at fork_exit+0xb8 fork_trampoline() at fork_trampoline+0x8 --- trap 0, eip = 0, esp = 0xecfa3d60, ebp = 0 --- Tracing command vnlru pid 16 tid 100073 td 0xc71752e0 sched_switch(c71752e0,0,104,191,235e5451,...) at sched_switch+0x3bc mi_switch(104,0,c0e94f60,1f3,60,...) at mi_switch+0x1eb sleepq_switch(c71752e0,0,c0e94f60,28b,0,...) at sleepq_switch+0x162 sleepq_timedwait(c73a1834,60,c0e9fc24,0,0,...) at sleepq_timedwait+0x6b _sleep(c73a1834,c1193034,260,c0e9fc24,3e8,...) at _sleep+0x342 vnlru_proc(0,ecfa0d28,c0e8a0d8,390,c73a1834,...) at vnlru_proc+0xe7 fork_exit(c0a49d70,0,ecfa0d28) at fork_exit+0xb8 fork_trampoline() at fork_trampoline+0x8 --- trap 0, eip = 0, esp = 0xecfa0d60, ebp = 0 --- Tracing command bufdaemon pid 9 tid 100072 td 0xc71755c0 sched_switch(c71755c0,0,104,191,e2fe8494,...) at sched_switch+0x3bc mi_switch(104,0,c0e94f60,1f3,54,...) at mi_switch+0x1eb sleepq_switch(c71755c0,0,c0e94f60,28b,0,...) at sleepq_switch+0x162 sleepq_timedwait(c1192d08,54,c0e9cc52,0,0,...) at sleepq_timedwait+0x6b _sleep(c1192d08,c1192d10,54,c0e9cc52,3e8,...) at _sleep+0x342 buf_daemon(0,ecf9dd28,c0e8a0d8,390,c73a1af0,...) at buf_daemon+0x175 fork_exit(c0a2f4b0,0,ecf9dd28) at fork_exit+0xb8 fork_trampoline() at fork_trampoline+0x8 --- trap 0, eip = 0, esp = 0xecf9dd60, ebp = 0 --- Tracing command pagezero pid 8 tid 100071 td 0xc71758a0 sched_switch(c71758a0,0,104,191,d46e529a,...) at sched_switch+0x3bc mi_switch(104,0,c0e94f60,1f3,0,...) at mi_switch+0x1eb sleepq_switch(c71758a0,0,c0e94f60,28b,0,...) at sleepq_switch+0x162 sleepq_timedwait(c119b4dc,0,c0ecb0c8,0,0,...) at sleepq_timedwait+0x6b _sleep(c119b4dc,c1199f80,0,c0ecb0c8,493e0,...) at _sleep+0x342 vm_pagezero(0,ecf9ad28,c0e8a0d8,390,c73a3000,...) at vm_pagezero+0xdc fork_exit(c0c21530,0,ecf9ad28) at fork_exit+0xb8 fork_trampoline() at fork_trampoline+0x8 --- trap 0, eip = 0, esp = 0xecf9ad60, ebp = 0 --- Tracing command vmdaemon pid 7 tid 100070 td 0xc7175b80 sched_switch(c7175b80,0,104,191,c07ac650,...) at sched_switch+0x3bc mi_switch(104,0,c0e94f60,1f3,74,...) at mi_switch+0x1eb sleepq_switch(c7175b80,0,c0e94f60,268,0,...) at sleepq_switch+0x162 sleepq_wait(c119b0c8,74,c0e9cc52,0,0,...) at sleepq_wait+0x63 _sleep(c119b0c8,c119b0cc,74,c0e9cc52,0,...) at _sleep+0x372 vm_daemon(0,ecf97d28,c0e8a0d8,390,c6dbd2bc,...) at vm_daemon+0x59 fork_exit(c0c1b0f0,0,ecf97d28) at fork_exit+0xb8 fork_trampoline() at fork_trampoline+0x8 --- trap 0, eip = 0, esp = 0xecf97d60, ebp = 0 --- Tracing command pagedaemon pid 6 tid 100069 td 0xc7176000 sched_switch(c7176000,0,104,191,dea3ded,...) at sched_switch+0x3bc mi_switch(104,0,c0e94f60,1f3,54,...) at mi_switch+0x1eb sleepq_switch(c7176000,0,c0e94f60,28b,0,...) at sleepq_switch+0x162 sleepq_timedwait(c119b090,54,c0e9cc52,0,0,...) at sleepq_timedwait+0x6b _sleep(c119b090,c1199f80,54,c0e9cc52,1388,...) at _sleep+0x342 vm_pageout(0,ecf94d28,c0e8a0d8,390,c6dbd578,...) at vm_pageout+0x2c7 fork_exit(c0c1c110,0,ecf94d28) at fork_exit+0xb8 fork_trampoline() at fork_trampoline+0x8 --- trap 0, eip = 0, esp = 0xecf94d60, ebp = 0 --- Tracing command xpt_thrd pid 5 tid 100068 td 0xc71762e0 sched_switch(c71762e0,0,104,191,bc25fda8,...) at sched_switch+0x3bc mi_switch(104,0,c0e94f60,1f3,5c,...) at mi_switch+0x1eb sleepq_switch(c71762e0,0,c0e94f60,268,0,...) at sleepq_switch+0x162 sleepq_wait(c0fe1d54,5c,c0d005b2,0,0,...) at sleepq_wait+0x63 _sleep(c0fe1d54,c0fe1d98,5c,c0d005b2,0,...) at _sleep+0x372 xpt_scanner_thread(0,ecf91d28,c0e8a0d8,390,c6dbd834,...) at xpt_scanner_thread+0x47 fork_exit(c048c310,0,ecf91d28) at fork_exit+0xb8 fork_trampoline() at fork_trampoline+0x8 --- trap 0, eip = 0, esp = 0xecf91d60, ebp = 0 --- Tracing command sctp_iterator pid 4 tid 100067 td 0xc71765c0 sched_switch(c71765c0,0,104,191,30429693,...) at sched_switch+0x3bc mi_switch(104,0,c0e94f60,1f3,0,...) at mi_switch+0x1eb sleepq_switch(c71765c0,0,c0e94f60,268,0,...) at sleepq_switch+0x162 sleepq_wait(c1194b98,0,c0eb2e7f,0,0,...) at sleepq_wait+0x63 _sleep(c1194b98,c1194b60,0,c0eb2e7f,0,...) at _sleep+0x372 sctp_iterator_thread(0,ecf8ed28,c0e8a0d8,390,c6dbdaf0,...) at sctp_iterator_thread+0x5c fork_exit(c0ad96a0,0,ecf8ed28) at fork_exit+0xb8 fork_trampoline() at fork_trampoline+0x8 --- trap 0, eip = 0, esp = 0xecf8ed60, ebp = 0 --- Tracing command fdc0 pid 3 tid 100063 td 0xc70372e0 sched_switch(c70372e0,0,104,191,63bf4432,...) at sched_switch+0x3bc mi_switch(104,0,c0e94f60,1f3,5c,...) at mi_switch+0x1eb sleepq_switch(c70372e0,0,c0e94f60,28b,0,...) at sleepq_switch+0x162 sleepq_timedwait(c6fe9e3c,5c,c0e82852,0,0,...) at sleepq_timedwait+0x6b _sleep(c6fe9e3c,c6fe9ef0,5c,c0e82852,3e8,...) at _sleep+0x342 fdc_thread(c6fe9e00,ecf82d28,c0e8a0d8,390,c7024000,...) at fdc_thread+0x27d fork_exit(c0ca0750,c6fe9e00,ecf82d28) at fork_exit+0xb8 fork_trampoline() at fork_trampoline+0x8 --- trap 0, eip = 0, esp = 0xecf82d60, ebp = 0 --- Tracing command fw0_probe pid 2 tid 100061 td 0xc70378a0 sched_switch(c70378a0,0,104,191,bca9da7e,...) at sched_switch+0x3bc mi_switch(104,0,c0e94f60,1f3,6c,...) at mi_switch+0x1eb sleepq_switch(c70378a0,0,c0e94f60,1a7,6c,...) at sleepq_switch+0x162 sleepq_catch_signals(c0e94f60,160,0,100,100,...) at sleepq_catch_signals+0xf9 sleepq_wait_sig(c706b000,6c,c0e82852,100,0,...) at sleepq_wait_sig+0x17 _sleep(c706b000,c706f488,16c,c0e82852,0,...) at _sleep+0x35c fw_bus_probe_thread(c706b000,ecf72d28,c0e8a0d8,390,c70242bc,...) at fw_bus_probe_thread+0xa08 fork_exit(c06ae4e0,c706b000,ecf72d28) at fork_exit+0xb8 fork_trampoline() at fork_trampoline+0x8 --- trap 0, eip = 0, esp = 0xecf72d60, ebp = 0 --- Tracing command usb pid 15 tid 100057 td 0xc70435c0 sched_switch(c70435c0,0,104,191,a99eadf2,...) at sched_switch+0x3bc mi_switch(104,0,c0e94f60,1f3,0,...) at mi_switch+0x1eb sleepq_switch(c70435c0,0,c0e94f60,268,c70435c0,...) at sleepq_switch+0x162 sleepq_wait(c704cd34,0,ecf5fcac,1,0,...) at sleepq_wait+0x63 _cv_wait(c704cd34,c704cdd4,c0e60e1e,6b,c704cd3c,...) at _cv_wait+0x243 usb_process(c704cd2c,ecf5fd28,c0e8a0d8,390,c7024578,...) at usb_process+0x193 fork_exit(c0853fd0,c704cd2c,ecf5fd28) at fork_exit+0xb8 fork_trampoline() at fork_trampoline+0x8 --- trap 0, eip = 0, esp = 0xecf5fd60, ebp = 0 --- Tracing command usb pid 15 tid 100056 td 0xc70438a0 sched_switch(c70438a0,0,104,191,2361d27c,...) at sched_switch+0x3bc mi_switch(104,0,c0e94f60,1f3,0,...) at mi_switch+0x1eb sleepq_switch(c70438a0,0,c0e94f60,268,c70438a0,...) at sleepq_switch+0x162 sleepq_wait(c704cd04,0,ecf5ccac,1,0,...) at sleepq_wait+0x63 _cv_wait(c704cd04,c704cdd4,c0e60e1e,6b,c704cd0c,...) at _cv_wait+0x243 usb_process(c704ccfc,ecf5cd28,c0e8a0d8,390,c7024578,...) at usb_process+0x193 fork_exit(c0853fd0,c704ccfc,ecf5cd28) at fork_exit+0xb8 fork_trampoline() at fork_trampoline+0x8 --- trap 0, eip = 0, esp = 0xecf5cd60, ebp = 0 --- Tracing command usb pid 15 tid 100055 td 0xc7043b80 sched_switch(c7043b80,0,104,191,a9378f7f,...) at sched_switch+0x3bc mi_switch(104,0,c0e94f60,1f3,0,...) at mi_switch+0x1eb sleepq_switch(c7043b80,0,c0e94f60,268,c7043b80,...) at sleepq_switch+0x162 sleepq_wait(c704ccd4,0,ecf59cac,1,0,...) at sleepq_wait+0x63 _cv_wait(c704ccd4,c704cdd4,c0e60e1e,6b,c704ccdc,...) at _cv_wait+0x243 usb_process(c704cccc,ecf59d28,c0e8a0d8,390,c7024578,...) at usb_process+0x193 fork_exit(c0853fd0,c704cccc,ecf59d28) at fork_exit+0xb8 fork_trampoline() at fork_trampoline+0x8 --- trap 0, eip = 0, esp = 0xecf59d60, ebp = 0 --- Tracing command usb pid 15 tid 100054 td 0xc7045000 sched_switch(c7045000,0,104,191,a9377d64,...) at sched_switch+0x3bc mi_switch(104,0,c0e94f60,1f3,0,...) at mi_switch+0x1eb sleepq_switch(c7045000,0,c0e94f60,268,c7045000,...) at sleepq_switch+0x162 sleepq_wait(c704cca4,0,ecf56cac,1,0,...) at sleepq_wait+0x63 _cv_wait(c704cca4,c704cdd4,c0e60e1e,6b,c704ccac,...) at _cv_wait+0x243 usb_process(c704cc9c,ecf56d28,c0e8a0d8,390,c7024578,...) at usb_process+0x193 fork_exit(c0853fd0,c704cc9c,ecf56d28) at fork_exit+0xb8 fork_trampoline() at fork_trampoline+0x8 --- trap 0, eip = 0, esp = 0xecf56d60, ebp = 0 --- Tracing command usb pid 15 tid 100052 td 0xc70455c0 sched_switch(c70455c0,0,104,191,a93767d3,...) at sched_switch+0x3bc mi_switch(104,0,c0e94f60,1f3,0,...) at mi_switch+0x1eb sleepq_switch(c70455c0,0,c0e94f60,268,c70455c0,...) at sleepq_switch+0x162 sleepq_wait(c703eb5c,0,ecf4dcac,1,0,...) at sleepq_wait+0x63 _cv_wait(c703eb5c,c703ebfc,c0e60e1e,6b,c703eb64,...) at _cv_wait+0x243 usb_process(c703eb54,ecf4dd28,c0e8a0d8,390,c7024578,...) at usb_process+0x193 fork_exit(c0853fd0,c703eb54,ecf4dd28) at fork_exit+0xb8 fork_trampoline() at fork_trampoline+0x8 --- trap 0, eip = 0, esp = 0xecf4dd60, ebp = 0 --- Tracing command usb pid 15 tid 100051 td 0xc7035000 sched_switch(c7035000,0,104,191,2360ffc8,...) at sched_switch+0x3bc mi_switch(104,0,c0e94f60,1f3,0,...) at mi_switch+0x1eb sleepq_switch(c7035000,0,c0e94f60,268,c7035000,...) at sleepq_switch+0x162 sleepq_wait(c703eb2c,0,ecf4acac,1,0,...) at sleepq_wait+0x63 _cv_wait(c703eb2c,c703ebfc,c0e60e1e,6b,c703eb34,...) at _cv_wait+0x243 usb_process(c703eb24,ecf4ad28,c0e8a0d8,390,c7024578,...) at usb_process+0x193 fork_exit(c0853fd0,c703eb24,ecf4ad28) at fork_exit+0xb8 fork_trampoline() at fork_trampoline+0x8 --- trap 0, eip = 0, esp = 0xecf4ad60, ebp = 0 --- Tracing command usb pid 15 tid 100050 td 0xc70352e0 sched_switch(c70352e0,0,104,191,a8d38f62,...) at sched_switch+0x3bc mi_switch(104,0,c0e94f60,1f3,0,...) at mi_switch+0x1eb sleepq_switch(c70352e0,0,c0e94f60,268,c70352e0,...) at sleepq_switch+0x162 sleepq_wait(c703eafc,0,ecf47cac,1,0,...) at sleepq_wait+0x63 _cv_wait(c703eafc,c703ebfc,c0e60e1e,6b,c703eb04,...) at _cv_wait+0x243 usb_process(c703eaf4,ecf47d28,c0e8a0d8,390,c7024578,...) at usb_process+0x193 fork_exit(c0853fd0,c703eaf4,ecf47d28) at fork_exit+0xb8 fork_trampoline() at fork_trampoline+0x8 --- trap 0, eip = 0, esp = 0xecf47d60, ebp = 0 --- Tracing command usb pid 15 tid 100049 td 0xc70355c0 sched_switch(c70355c0,0,104,191,a8d37c78,...) at sched_switch+0x3bc mi_switch(104,0,c0e94f60,1f3,0,...) at mi_switch+0x1eb sleepq_switch(c70355c0,0,c0e94f60,268,c70355c0,...) at sleepq_switch+0x162 sleepq_wait(c703eacc,0,ecf44cac,1,0,...) at sleepq_wait+0x63 _cv_wait(c703eacc,c703ebfc,c0e60e1e,6b,c703ead4,...) at _cv_wait+0x243 usb_process(c703eac4,ecf44d28,c0e8a0d8,390,c7024578,...) at usb_process+0x193 fork_exit(c0853fd0,c703eac4,ecf44d28) at fork_exit+0xb8 fork_trampoline() at fork_trampoline+0x8 --- trap 0, eip = 0, esp = 0xecf44d60, ebp = 0 --- Tracing command usb pid 15 tid 100048 td 0xc70358a0 sched_switch(c70358a0,0,104,191,a8d3691c,...) at sched_switch+0x3bc mi_switch(104,0,c0e94f60,1f3,0,...) at mi_switch+0x1eb sleepq_switch(c70358a0,0,c0e94f60,268,c70358a0,...) at sleepq_switch+0x162 sleepq_wait(c7038b5c,0,ecf40cac,1,0,...) at sleepq_wait+0x63 _cv_wait(c7038b5c,c7038bfc,c0e60e1e,6b,c7038b64,...) at _cv_wait+0x243 usb_process(c7038b54,ecf40d28,c0e8a0d8,390,c7024578,...) at usb_process+0x193 fork_exit(c0853fd0,c7038b54,ecf40d28) at fork_exit+0xb8 fork_trampoline() at fork_trampoline+0x8 --- trap 0, eip = 0, esp = 0xecf40d60, ebp = 0 --- Tracing command usb pid 15 tid 100047 td 0xc7035b80 sched_switch(c7035b80,0,104,191,2360a469,...) at sched_switch+0x3bc mi_switch(104,0,c0e94f60,1f3,0,...) at mi_switch+0x1eb sleepq_switch(c7035b80,0,c0e94f60,268,c7035b80,...) at sleepq_switch+0x162 sleepq_wait(c7038b2c,0,ecf3dcac,1,0,...) at sleepq_wait+0x63 _cv_wait(c7038b2c,c7038bfc,c0e60e1e,6b,c7038b34,...) at _cv_wait+0x243 usb_process(c7038b24,ecf3dd28,c0e8a0d8,390,c7024578,...) at usb_process+0x193 fork_exit(c0853fd0,c7038b24,ecf3dd28) at fork_exit+0xb8 fork_trampoline() at fork_trampoline+0x8 --- trap 0, eip = 0, esp = 0xecf3dd60, ebp = 0 --- Tracing command usb pid 15 tid 100046 td 0xc7036000 sched_switch(c7036000,0,104,191,a306a0b7,...) at sched_switch+0x3bc mi_switch(104,0,c0e94f60,1f3,0,...) at mi_switch+0x1eb sleepq_switch(c7036000,0,c0e94f60,268,c7036000,...) at sleepq_switch+0x162 sleepq_wait(c7038afc,0,ecf3acac,1,0,...) at sleepq_wait+0x63 _cv_wait(c7038afc,c7038bfc,c0e60e1e,6b,c7038b04,...) at _cv_wait+0x243 usb_process(c7038af4,ecf3ad28,c0e8a0d8,390,c7024578,...) at usb_process+0x193 fork_exit(c0853fd0,c7038af4,ecf3ad28) at fork_exit+0xb8 fork_trampoline() at fork_trampoline+0x8 --- trap 0, eip = 0, esp = 0xecf3ad60, ebp = 0 --- Tracing command usb pid 15 tid 100045 td 0xc70362e0 sched_switch(c70362e0,0,104,191,a3068e96,...) at sched_switch+0x3bc mi_switch(104,0,c0e94f60,1f3,0,...) at mi_switch+0x1eb sleepq_switch(c70362e0,0,c0e94f60,268,c70362e0,...) at sleepq_switch+0x162 sleepq_wait(c7038acc,0,ecf37cac,1,0,...) at sleepq_wait+0x63 _cv_wait(c7038acc,c7038bfc,c0e60e1e,6b,c7038ad4,...) at _cv_wait+0x243 usb_process(c7038ac4,ecf37d28,c0e8a0d8,390,c7024578,...) at usb_process+0x193 fork_exit(c0853fd0,c7038ac4,ecf37d28) at fork_exit+0xb8 fork_trampoline() at fork_trampoline+0x8 --- trap 0, eip = 0, esp = 0xecf37d60, ebp = 0 --- Tracing command usb pid 15 tid 100044 td 0xc70365c0 sched_switch(c70365c0,0,104,191,a3067b50,...) at sched_switch+0x3bc mi_switch(104,0,c0e94f60,1f3,0,...) at mi_switch+0x1eb sleepq_switch(c70365c0,0,c0e94f60,268,c70365c0,...) at sleepq_switch+0x162 sleepq_wait(c702fb5c,0,ecf33cac,1,0,...) at sleepq_wait+0x63 _cv_wait(c702fb5c,c702fbfc,c0e60e1e,6b,c702fb64,...) at _cv_wait+0x243 usb_process(c702fb54,ecf33d28,c0e8a0d8,390,c7024578,...) at usb_process+0x193 fork_exit(c0853fd0,c702fb54,ecf33d28) at fork_exit+0xb8 fork_trampoline() at fork_trampoline+0x8 --- trap 0, eip = 0, esp = 0xecf33d60, ebp = 0 --- Tracing command usb pid 15 tid 100043 td 0xc70368a0 sched_switch(c70368a0,0,104,191,2360736c,...) at sched_switch+0x3bc mi_switch(104,0,c0e94f60,1f3,0,...) at mi_switch+0x1eb sleepq_switch(c70368a0,0,c0e94f60,268,c70368a0,...) at sleepq_switch+0x162 sleepq_wait(c702fb2c,0,e0bffcac,1,0,...) at sleepq_wait+0x63 _cv_wait(c702fb2c,c702fbfc,c0e60e1e,6b,c702fb34,...) at _cv_wait+0x243 usb_process(c702fb24,e0bffd28,c0e8a0d8,390,c7024578,...) at usb_process+0x193 fork_exit(c0853fd0,c702fb24,e0bffd28) at fork_exit+0xb8 fork_trampoline() at fork_trampoline+0x8 --- trap 0, eip = 0, esp = 0xe0bffd60, ebp = 0 --- Tracing command usb pid 15 tid 100042 td 0xc7036b80 sched_switch(c7036b80,0,104,191,a2a2958a,...) at sched_switch+0x3bc mi_switch(104,0,c0e94f60,1f3,0,...) at mi_switch+0x1eb sleepq_switch(c7036b80,0,c0e94f60,268,c7036b80,...) at sleepq_switch+0x162 sleepq_wait(c702fafc,0,e0bfccac,1,0,...) at sleepq_wait+0x63 _cv_wait(c702fafc,c702fbfc,c0e60e1e,6b,c702fb04,...) at _cv_wait+0x243 usb_process(c702faf4,e0bfcd28,c0e8a0d8,390,c7024578,...) at usb_process+0x193 fork_exit(c0853fd0,c702faf4,e0bfcd28) at fork_exit+0xb8 fork_trampoline() at fork_trampoline+0x8 --- trap 0, eip = 0, esp = 0xe0bfcd60, ebp = 0 --- Tracing command usb pid 15 tid 100041 td 0xc7037000 sched_switch(c7037000,0,104,191,a2a28214,...) at sched_switch+0x3bc mi_switch(104,0,c0e94f60,1f3,0,...) at mi_switch+0x1eb sleepq_switch(c7037000,0,c0e94f60,268,c7037000,...) at sleepq_switch+0x162 sleepq_wait(c702facc,0,e0bf9cac,1,0,...) at sleepq_wait+0x63 _cv_wait(c702facc,c702fbfc,c0e60e1e,6b,c702fad4,...) at _cv_wait+0x243 usb_process(c702fac4,e0bf9d28,c0e8a0d8,390,c7024578,...) at usb_process+0x193 fork_exit(c0853fd0,c702fac4,e0bf9d28) at fork_exit+0xb8 fork_trampoline() at fork_trampoline+0x8 --- trap 0, eip = 0, esp = 0xe0bf9d60, ebp = 0 --- Tracing command usb pid 15 tid 100039 td 0xc70252e0 sched_switch(c70252e0,0,104,191,a2a26b1f,...) at sched_switch+0x3bc mi_switch(104,0,c0e94f60,1f3,0,...) at mi_switch+0x1eb sleepq_switch(c70252e0,0,c0e94f60,268,c70252e0,...) at sleepq_switch+0x162 sleepq_wait(c7028b5c,0,e0bf2cac,1,0,...) at sleepq_wait+0x63 _cv_wait(c7028b5c,c7028bfc,c0e60e1e,6b,c7028b64,...) at _cv_wait+0x243 usb_process(c7028b54,e0bf2d28,c0e8a0d8,390,c7024578,...) at usb_process+0x193 fork_exit(c0853fd0,c7028b54,e0bf2d28) at fork_exit+0xb8 fork_trampoline() at fork_trampoline+0x8 --- trap 0, eip = 0, esp = 0xe0bf2d60, ebp = 0 --- Tracing command usb pid 15 tid 100038 td 0xc70255c0 sched_switch(c70255c0,0,104,191,235fcd9a,...) at sched_switch+0x3bc mi_switch(104,0,c0e94f60,1f3,0,...) at mi_switch+0x1eb sleepq_switch(c70255c0,0,c0e94f60,268,c70255c0,...) at sleepq_switch+0x162 sleepq_wait(c7028b2c,0,e0befcac,1,0,...) at sleepq_wait+0x63 _cv_wait(c7028b2c,c7028bfc,c0e60e1e,6b,c7028b34,...) at _cv_wait+0x243 usb_process(c7028b24,e0befd28,c0e8a0d8,390,c7024578,...) at usb_process+0x193 fork_exit(c0853fd0,c7028b24,e0befd28) at fork_exit+0xb8 fork_trampoline() at fork_trampoline+0x8 --- trap 0, eip = 0, esp = 0xe0befd60, ebp = 0 --- Tracing command usb pid 15 tid 100037 td 0xc70258a0 sched_switch(c70258a0,0,104,191,a23ec4d6,...) at sched_switch+0x3bc mi_switch(104,0,c0e94f60,1f3,0,...) at mi_switch+0x1eb sleepq_switch(c70258a0,0,c0e94f60,268,c70258a0,...) at sleepq_switch+0x162 sleepq_wait(c7028afc,0,e0beccac,1,0,...) at sleepq_wait+0x63 _cv_wait(c7028afc,c7028bfc,c0e60e1e,6b,c7028b04,...) at _cv_wait+0x243 usb_process(c7028af4,e0becd28,c0e8a0d8,390,c7024578,...) at usb_process+0x193 fork_exit(c0853fd0,c7028af4,e0becd28) at fork_exit+0xb8 fork_trampoline() at fork_trampoline+0x8 --- trap 0, eip = 0, esp = 0xe0becd60, ebp = 0 --- Tracing command usb pid 15 tid 100036 td 0xc7025b80 sched_switch(c7025b80,0,104,191,a23eb3bf,...) at sched_switch+0x3bc mi_switch(104,0,c0e94f60,1f3,0,...) at mi_switch+0x1eb sleepq_switch(c7025b80,0,c0e94f60,268,c7025b80,...) at sleepq_switch+0x162 sleepq_wait(c7028acc,0,e0be9cac,1,0,...) at sleepq_wait+0x63 _cv_wait(c7028acc,c7028bfc,c0e60e1e,6b,c7028ad4,...) at _cv_wait+0x243 usb_process(c7028ac4,e0be9d28,c0e8a0d8,390,c7024578,...) at usb_process+0x193 fork_exit(c0853fd0,c7028ac4,e0be9d28) at fork_exit+0xb8 fork_trampoline() at fork_trampoline+0x8 --- trap 0, eip = 0, esp = 0xe0be9d60, ebp = 0 --- Tracing command usb pid 15 tid 100034 td 0xc70272e0 sched_switch(c70272e0,0,104,191,a23e9f68,...) at sched_switch+0x3bc mi_switch(104,0,c0e94f60,1f3,0,...) at mi_switch+0x1eb sleepq_switch(c70272e0,0,c0e94f60,268,c70272e0,...) at sleepq_switch+0x162 sleepq_wait(c701fb5c,0,e0be2cac,1,0,...) at sleepq_wait+0x63 _cv_wait(c701fb5c,c701fbfc,c0e60e1e,6b,c701fb64,...) at _cv_wait+0x243 usb_process(c701fb54,e0be2d28,c0e8a0d8,390,c7024578,...) at usb_process+0x193 fork_exit(c0853fd0,c701fb54,e0be2d28) at fork_exit+0xb8 fork_trampoline() at fork_trampoline+0x8 --- trap 0, eip = 0, esp = 0xe0be2d60, ebp = 0 --- Tracing command usb pid 15 tid 100033 td 0xc70275c0 sched_switch(c70275c0,0,104,191,235f70a9,...) at sched_switch+0x3bc mi_switch(104,0,c0e94f60,1f3,0,...) at mi_switch+0x1eb sleepq_switch(c70275c0,0,c0e94f60,268,c70275c0,...) at sleepq_switch+0x162 sleepq_wait(c701fb2c,0,e0bdfcac,1,0,...) at sleepq_wait+0x63 _cv_wait(c701fb2c,c701fbfc,c0e60e1e,6b,c701fb34,...) at _cv_wait+0x243 usb_process(c701fb24,e0bdfd28,c0e8a0d8,390,c7024578,...) at usb_process+0x193 fork_exit(c0853fd0,c701fb24,e0bdfd28) at fork_exit+0xb8 fork_trampoline() at fork_trampoline+0x8 --- trap 0, eip = 0, esp = 0xe0bdfd60, ebp = 0 --- Tracing command usb pid 15 tid 100032 td 0xc70278a0 sched_switch(c70278a0,0,104,191,a1dac5c6,...) at sched_switch+0x3bc mi_switch(104,0,c0e94f60,1f3,0,...) at mi_switch+0x1eb sleepq_switch(c70278a0,0,c0e94f60,268,c70278a0,...) at sleepq_switch+0x162 sleepq_wait(c701fafc,0,e0bdccac,1,0,...) at sleepq_wait+0x63 _cv_wait(c701fafc,c701fbfc,c0e60e1e,6b,c701fb04,...) at _cv_wait+0x243 usb_process(c701faf4,e0bdcd28,c0e8a0d8,390,c7024578,...) at usb_process+0x193 fork_exit(c0853fd0,c701faf4,e0bdcd28) at fork_exit+0xb8 fork_trampoline() at fork_trampoline+0x8 --- trap 0, eip = 0, esp = 0xe0bdcd60, ebp = 0 --- Tracing command usb pid 15 tid 100031 td 0xc7027b80 sched_switch(c7027b80,0,104,191,a1dab2e7,...) at sched_switch+0x3bc mi_switch(104,0,c0e94f60,1f3,0,...) at mi_switch+0x1eb sleepq_switch(c7027b80,0,c0e94f60,268,c7027b80,...) at sleepq_switch+0x162 sleepq_wait(c701facc,0,e0bd9cac,1,0,...) at sleepq_wait+0x63 _cv_wait(c701facc,c701fbfc,c0e60e1e,6b,c701fad4,...) at _cv_wait+0x243 usb_process(c701fac4,e0bd9d28,c0e8a0d8,390,c7024578,...) at usb_process+0x193 fork_exit(c0853fd0,c701fac4,e0bd9d28) at fork_exit+0xb8 fork_trampoline() at fork_trampoline+0x8 --- trap 0, eip = 0, esp = 0xe0bd9d60, ebp = 0 --- Tracing command yarrow pid 14 tid 100017 td 0xc6ece5c0 sched_switch(c6ece5c0,0,104,191,83ee343e,...) at sched_switch+0x3bc mi_switch(104,0,c0e94f60,1f3,0,...) at mi_switch+0x1eb sleepq_switch(c6ece5c0,0,c0e94f60,28b,2,...) at sleepq_switch+0x162 sleepq_timedwait(c101bc84,0,c0e82852,2,0,...) at sleepq_timedwait+0x6b _sleep(c101bc84,0,0,c0e82852,64,...) at _sleep+0x342 pause(c0e82852,64,c0e4f7ee,111,0,...) at pause+0x47 random_kthread(0,c6b65d28,c0e8a0d8,390,c6dbc000,...) at random_kthread+0x1ef fork_exit(c07bf0b0,0,c6b65d28) at fork_exit+0xb8 fork_trampoline() at fork_trampoline+0x8 --- trap 0, eip = 0, esp = 0xc6b65d60, ebp = 0 --- Tracing command geom pid 13 tid 100015 td 0xc6eceb80 sched_switch(c6eceb80,0,104,191,272c1cc0,...) at sched_switch+0x3bc mi_switch(104,0,c0e94f60,1f3,5c,...) at mi_switch+0x1eb sleepq_switch(c6eceb80,0,c0e94f60,268,0,...) at sleepq_switch+0x162 sleepq_wait(c10198a8,5c,c0e82852,0,0,...) at sleepq_wait+0x63 _sleep(c10198a8,c1019808,25c,c0e82852,0,...) at _sleep+0x372 g_io_schedule_down(c6eceb80,0,c0e843a5,6c,c6b5fd14,...) at g_io_schedule_down+0x5b g_down_procbody(0,c6b5fd28,c0e8a0d8,390,c6dbc2bc,...) at g_down_procbody+0x9d fork_exit(c0942c70,0,c6b5fd28) at fork_exit+0xb8 fork_trampoline() at fork_trampoline+0x8 --- trap 0, eip = 0, esp = 0xc6b5fd60, ebp = 0 --- Tracing command geom pid 13 tid 100014 td 0xc6ed0000 sched_switch(c6ed0000,0,104,191,27335210,...) at sched_switch+0x3bc mi_switch(104,0,c0e94f60,1f3,5c,...) at mi_switch+0x1eb sleepq_switch(c6ed0000,0,c0e94f60,268,0,...) at sleepq_switch+0x162 sleepq_wait(c10198a4,5c,c0e82852,0,0,...) at sleepq_wait+0x63 _sleep(c10198a4,c1019828,25c,c0e82852,0,...) at _sleep+0x372 g_io_schedule_up(c6ed0000,0,c0e843a5,5f,c6b5cd14,...) at g_io_schedule_up+0x134 g_up_procbody(0,c6b5cd28,c0e8a0d8,390,c6dbc2bc,...) at g_up_procbody+0x9d fork_exit(c0942d10,0,c6b5cd28) at fork_exit+0xb8 fork_trampoline() at fork_trampoline+0x8 --- trap 0, eip = 0, esp = 0xc6b5cd60, ebp = 0 --- Tracing command geom pid 13 tid 100013 td 0xc6dbf2e0 sched_switch(c6dbf2e0,0,104,191,c0c7a3c5,...) at sched_switch+0x3bc mi_switch(104,0,c0e94f60,1f3,5c,...) at mi_switch+0x1eb sleepq_switch(c6dbf2e0,0,c0e94f60,268,0,...) at sleepq_switch+0x162 sleepq_wait(c101989c,5c,c0e82852,0,0,...) at sleepq_wait+0x63 _sleep(c101989c,c10197cc,25c,c0e82852,0,...) at _sleep+0x372 g_run_events(c1029b00,0,c0e843a5,79,c6b59d14,...) at g_run_events+0x526 g_event_procbody(0,c6b59d28,c0e8a0d8,390,c6dbc2bc,...) at g_event_procbody+0x90 fork_exit(c0942db0,0,c6b59d28) at fork_exit+0xb8 fork_trampoline() at fork_trampoline+0x8 --- trap 0, eip = 0, esp = 0xc6b59d60, ebp = 0 --- Tracing command intr pid 12 tid 100065 td 0xc7176b80 fork_trampoline() at fork_trampoline Tracing command intr pid 12 tid 100064 td 0xc7177000 sched_switch(c7177000,0,109,191,a1d7af86,...) at sched_switch+0x3bc mi_switch(109,0,c0e8a3fd,554,c7177000,...) at mi_switch+0x1eb ithread_loop(c6dbaa00,ecf85d28,c0e8a0d8,390,c6dbc578,...) at ithread_loop+0x1fb fork_exit(c0984190,c6dbaa00,ecf85d28) at fork_exit+0xb8 fork_trampoline() at fork_trampoline+0x8 --- trap 0, eip = 0, esp = 0xecf85d60, ebp = 0 --- Tracing command intr pid 12 tid 100062 td 0xc70375c0 sched_switch(c70375c0,0,109,191,2c979d30,...) at sched_switch+0x3bc mi_switch(109,0,c0e8a3fd,554,c70375c0,...) at mi_switch+0x1eb ithread_loop(c6dbaa10,ecf75d28,c0e8a0d8,390,c6dbc578,...) at ithread_loop+0x1fb fork_exit(c0984190,c6dbaa10,ecf75d28) at fork_exit+0xb8 fork_trampoline() at fork_trampoline+0x8 --- trap 0, eip = 0, esp = 0xecf75d60, ebp = 0 --- Tracing command intr pid 12 tid 100059 td 0xc7043000 sched_switch(c7043000,0,109,191,a1d6fcf0,...) at sched_switch+0x3bc mi_switch(109,0,c0e8a3fd,554,c7043000,...) at mi_switch+0x1eb ithread_loop(c6dbaa40,ecf69d28,c0e8a0d8,390,c6dbc578,...) at ithread_loop+0x1fb fork_exit(c0984190,c6dbaa40,ecf69d28) at fork_exit+0xb8 fork_trampoline() at fork_trampoline+0x8 --- trap 0, eip = 0, esp = 0xecf69d60, ebp = 0 --- Tracing command intr pid 12 tid 100058 td 0xc70432e0 sched_switch(c70432e0,0,109,191,bd71ddcd,...) at sched_switch+0x3bc mi_switch(109,0,c0e8a3fd,554,c70432e0,...) at mi_switch+0x1eb ithread_loop(c6dbaa70,ecf65d28,c0e8a0d8,390,c6dbc578,...) at ithread_loop+0x1fb fork_exit(c0984190,c6dbaa70,ecf65d28) at fork_exit+0xb8 fork_trampoline() at fork_trampoline+0x8 --- trap 0, eip = 0, esp = 0xecf65d60, ebp = 0 --- Tracing command intr pid 12 tid 100053 td 0xc70452e0 fork_trampoline() at fork_trampoline Tracing command intr pid 12 tid 100040 td 0xc7025000 sched_switch(c7025000,0,109,191,c68058eb,...) at sched_switch+0x3bc mi_switch(109,0,c0e8a3fd,554,c7025000,...) at mi_switch+0x1eb ithread_loop(c6dbaa90,e0bf6d28,c0e8a0d8,390,c6dbc578,...) at ithread_loop+0x1fb fork_exit(c0984190,c6dbaa90,e0bf6d28) at fork_exit+0xb8 fork_trampoline() at fork_trampoline+0x8 --- trap 0, eip = 0, esp = 0xe0bf6d60, ebp = 0 --- Tracing command intr pid 12 tid 100035 td 0xc7027000 sched_switch(c7027000,0,109,191,c159f0ba,...) at sched_switch+0x3bc mi_switch(109,0,c0e8a3fd,554,c7027000,...) at mi_switch+0x1eb ithread_loop(c6dbaaa0,e0be6d28,c0e8a0d8,390,c6dbc578,...) at ithread_loop+0x1fb fork_exit(c0984190,c6dbaaa0,e0be6d28) at fork_exit+0xb8 fork_trampoline() at fork_trampoline+0x8 --- trap 0, eip = 0, esp = 0xe0be6d60, ebp = 0 --- Tracing command intr pid 12 tid 100030 td 0xc6ed02e0 sched_switch(c6ed02e0,0,109,191,bf86f4d7,...) at sched_switch+0x3bc mi_switch(109,0,c0e8a3fd,554,c6ed02e0,...) at mi_switch+0x1eb ithread_loop(c6dbaab0,e0bd6d28,c0e8a0d8,390,c6dbc578,...) at ithread_loop+0x1fb fork_exit(c0984190,c6dbaab0,e0bd6d28) at fork_exit+0xb8 fork_trampoline() at fork_trampoline+0x8 --- trap 0, eip = 0, esp = 0xe0bd6d60, ebp = 0 --- Tracing command intr pid 12 tid 100029 td 0xc6ed05c0 sched_switch(c6ed05c0,0,109,191,27321890,...) at sched_switch+0x3bc mi_switch(109,0,c0e8a3fd,554,c6ed05c0,...) at mi_switch+0x1eb ithread_loop(c6dbab40,e0a80d28,c0e8a0d8,390,c6dbc578,...) at ithread_loop+0x1fb fork_exit(c0984190,c6dbab40,e0a80d28) at fork_exit+0xb8 fork_trampoline() at fork_trampoline+0x8 --- trap 0, eip = 0, esp = 0xe0a80d60, ebp = 0 --- Tracing command intr pid 12 tid 100028 td 0xc6ed08a0 sched_switch(c6ed08a0,0,109,191,18cdf8ec,...) at sched_switch+0x3bc mi_switch(109,0,c0e8a3fd,554,c6ed08a0,...) at mi_switch+0x1eb ithread_loop(c6dbab50,e0a7cd28,c0e8a0d8,390,c6dbc578,...) at ithread_loop+0x1fb fork_exit(c0984190,c6dbab50,e0a7cd28) at fork_exit+0xb8 fork_trampoline() at fork_trampoline+0x8 --- trap 0, eip = 0, esp = 0xe0a7cd60, ebp = 0 --- Tracing command intr pid 12 tid 100027 td 0xc6ed0b80 sched_switch(c6ed0b80,0,109,191,2732bc4b,...) at sched_switch+0x3bc mi_switch(109,0,c0e8a3fd,554,c6ed0b80,...) at mi_switch+0x1eb ithread_loop(c6dbab70,c6b83d28,c0e8a0d8,390,c6dbc578,...) at ithread_loop+0x1fb fork_exit(c0984190,c6dbab70,c6b83d28) at fork_exit+0xb8 fork_trampoline() at fork_trampoline+0x8 --- trap 0, eip = 0, esp = 0xc6b83d60, ebp = 0 --- Tracing command intr pid 12 tid 100022 td 0xc6fb3b80 sched_switch(c6fb3b80,0,109,191,70e4507,...) at sched_switch+0x3bc mi_switch(109,0,c0e8a3fd,554,c6fb3b80,...) at mi_switch+0x1eb ithread_loop(c6dbabb0,c6b74d28,c0e8a0d8,390,c6dbc578,...) at ithread_loop+0x1fb fork_exit(c0984190,c6dbabb0,c6b74d28) at fork_exit+0xb8 fork_trampoline() at fork_trampoline+0x8 --- trap 0, eip = 0, esp = 0xc6b74d60, ebp = 0 --- Tracing command intr pid 12 tid 100020 td 0xc6e04b80 fork_trampoline() at fork_trampoline Tracing command intr pid 12 tid 100018 td 0xc6ece2e0 fork_trampoline() at fork_trampoline Tracing command intr pid 12 tid 100012 td 0xc6dbf5c0 sched_switch(c6dbf5c0,0,109,191,38d37335,...) at sched_switch+0x3bc mi_switch(109,0,c0e8a3fd,554,c6dbf5c0,...) at mi_switch+0x1eb ithread_loop(c6dbabe0,c6b56d28,c0e8a0d8,390,c6dbc578,...) at ithread_loop+0x1fb fork_exit(c0984190,c6dbabe0,c6b56d28) at fork_exit+0xb8 fork_trampoline() at fork_trampoline+0x8 --- trap 0, eip = 0, esp = 0xc6b56d60, ebp = 0 --- Tracing command intr pid 12 tid 100011 td 0xc6dbf8a0 sched_switch(c6dbf8a0,0,109,191,793335aa,...) at sched_switch+0x3bc mi_switch(109,0,c0e8a3fd,554,c6dbf8a0,...) at mi_switch+0x1eb ithread_loop(c6dbabf0,c6b53d28,c0e8a0d8,390,c6dbc578,...) at ithread_loop+0x1fb fork_exit(c0984190,c6dbabf0,c6b53d28) at fork_exit+0xb8 fork_trampoline() at fork_trampoline+0x8 --- trap 0, eip = 0, esp = 0xc6b53d60, ebp = 0 --- Tracing command intr pid 12 tid 100010 td 0xc6dbfb80 sched_switch(c6dbfb80,0,109,191,83edd7f1,...) at sched_switch+0x3bc mi_switch(109,0,c0e8a3fd,554,c6dbfb80,...) at mi_switch+0x1eb ithread_loop(c6dbac00,c6b50d28,c0e8a0d8,390,c6dbc578,...) at ithread_loop+0x1fb fork_exit(c0984190,c6dbac00,c6b50d28) at fork_exit+0xb8 fork_trampoline() at fork_trampoline+0x8 --- trap 0, eip = 0, esp = 0xc6b50d60, ebp = 0 --- Tracing command intr pid 12 tid 100009 td 0xc6e04000 cpustop_handler(8,c6b4db50,c0cd8ce6,f4,0,...) at cpustop_handler+0x49 ipi_nmi_handler(f4,0,1ac67aa,c099d517,c6dbc578,...) at ipi_nmi_handler+0x44 trap(c6b4db5c) at trap+0x36 calltrap() at calltrap+0x6 --- trap 0x13, eip = 0xc099d509, esp = 0xc6b4db9c, ebp = 0xc6b4dbb8 --- _mtx_lock_sleep(c101b570,c6e04000,0,c0e8dd67,93,...) at _mtx_lock_sleep+0x99 _mtx_lock_flags(c101b570,0,c0e8dd67,93,c6b4dc90,...) at _mtx_lock_flags+0xf7 lock_mtx(c101b570,1,c0e90e5e,20f,c102b2c0,...) at lock_mtx+0x29 softclock(c101cec0,c6b4dcb8,c099cf24,c1029b00,c6d89b38,...) at softclock+0x1ea intr_event_execute_handlers(c6dbc578,c6d89b00,c0e8a3fd,55e,c6e04000,...) at intr_event_execute_handlers+0x125 ithread_loop(c6dbac10,c6b4dd28,c0e8a0d8,390,c6dbc578,...) at ithread_loop+0xa9 fork_exit(c0984190,c6dbac10,c6b4dd28) at fork_exit+0xb8 fork_trampoline() at fork_trampoline+0x8 --- trap 0, eip = 0, esp = 0xc6b4dd60, ebp = 0 --- Tracing command intr pid 12 tid 100008 td 0xc6e042e0 sched_switch(c6e042e0,0,109,191,36e03e7,...) at sched_switch+0x3bc mi_switch(109,0,c0e8a3fd,554,c6e042e0,...) at mi_switch+0x1eb ithread_loop(c6dbac20,c6b4ad28,c0e8a0d8,390,c6dbc578,...) at ithread_loop+0x1fb fork_exit(c0984190,c6dbac20,c6b4ad28) at fork_exit+0xb8 fork_trampoline() at fork_trampoline+0x8 --- trap 0, eip = 0, esp = 0xc6b4ad60, ebp = 0 --- Tracing command intr pid 12 tid 100007 td 0xc6e045c0 fork_trampoline() at fork_trampoline Tracing command idle pid 11 tid 100006 td 0xc6dbe000 sched_switch(c6dbe000,0,108,18c,38d39059,...) at sched_switch+0x3bc mi_switch(108,0,c0e9178b,3b9,c6dbe000,...) at mi_switch+0x1eb sched_idletd(0,c6b43d28,c0e8a0d8,390,c6dbc834,...) at sched_idletd+0x19f fork_exit(c09d3050,0,c6b43d28) at fork_exit+0xb8 fork_trampoline() at fork_trampoline+0x8 --- trap 0, eip = 0, esp = 0xc6b43d60, ebp = 0 --- Tracing command idle pid 11 tid 100005 td 0xc6dbe2e0 cpustop_handler(4,c6b40c04,c0cd8ce6,f4,0,...) at cpustop_handler+0x49 ipi_nmi_handler(f4,0,0,c11be5f8,c6dbc834,...) at ipi_nmi_handler+0x44 trap(c6b40c10) at trap+0x36 calltrap() at calltrap+0x6 --- trap 0x13, eip = 0xc0cbdbf5, esp = 0xc6b40c50, ebp = 0xc6b40c50 --- acpi_cpu_c1(c6b40c6c,c0fe1fd0,2,300,1178,...) at acpi_cpu_c1+0x5 acpi_cpu_idle(0,c6b40ca0,c0ccbe19,0,ffffffff,...) at acpi_cpu_idle+0x122 cpu_idle_acpi(0,ffffffff,c102a800,2,c6b40ce8,...) at cpu_idle_acpi+0x2f cpu_idle(0,c6b40cc4,c0e9178b,3bb,c6dbe2e0,...) at cpu_idle+0x89 sched_idletd(0,c6b40d28,c0e8a0d8,390,c6dbc834,...) at sched_idletd+0x263 fork_exit(c09d3050,0,c6b40d28) at fork_exit+0xb8 fork_trampoline() at fork_trampoline+0x8 --- trap 0, eip = 0, esp = 0xc6b40d60, ebp = 0 --- Tracing command idle pid 11 tid 100004 td 0xc6dbe5c0 cpustop_handler(2,c6b3dc04,c0cd8ce6,f4,0,...) at cpustop_handler+0x49 ipi_nmi_handler(f4,0,1e0cc94,c0cbdbf5,c6dbc834,...) at ipi_nmi_handler+0x44 trap(c6b3dc10) at trap+0x36 calltrap() at calltrap+0x6 --- trap 0x13, eip = 0xc0cbdbf5, esp = 0xc6b3dc50, ebp = 0xc6b3dc50 --- acpi_cpu_c1(c6b3dc6c,c0fe1fd0,1,300,1178,...) at acpi_cpu_c1+0x5 acpi_cpu_idle(0,c6b3dca0,c0ccbe19,0,ffffffff,...) at acpi_cpu_idle+0x122 cpu_idle_acpi(0,ffffffff,c102a180,2,c6b3dce8,...) at cpu_idle_acpi+0x2f cpu_idle(0,c6b3dcc4,c0e9178b,a05,c6dbe5c0,...) at cpu_idle+0x89 sched_idletd(0,c6b3dd28,c0e8a0d8,390,c6dbc834,...) at sched_idletd+0x263 fork_exit(c09d3050,0,c6b3dd28) at fork_exit+0xb8 fork_trampoline() at fork_trampoline+0x8 --- trap 0, eip = 0, esp = 0xc6b3dd60, ebp = 0 --- Tracing command idle pid 11 tid 100003 td 0xc6dbe8a0 sched_switch(c6dbe8a0,0,108,18c,2360b731,...) at sched_switch+0x3bc mi_switch(108,0,c0e9178b,3b9,c6dbe8a0,...) at mi_switch+0x1eb sched_idletd(0,c6b3ad28,c0e8a0d8,390,c6dbc834,...) at sched_idletd+0x19f fork_exit(c09d3050,0,c6b3ad28) at fork_exit+0xb8 fork_trampoline() at fork_trampoline+0x8 --- trap 0, eip = 0, esp = 0xc6b3ad60, ebp = 0 --- Tracing command init pid 1 tid 100002 td 0xc6dbeb80 sched_switch(c6dbeb80,0,104,191,c5487f2c,...) at sched_switch+0x3bc mi_switch(104,0,c0e94f60,1f3,6c,...) at mi_switch+0x1eb sleepq_switch(c6dbeb80,0,c0e94f60,1a7,6c,...) at sleepq_switch+0x162 sleepq_catch_signals(c0e94f60,160,0,100,100,...) at sleepq_catch_signals+0xf9 sleepq_wait_sig(c6dbcaf0,6c,c0e97d3e,100,0,...) at sleepq_wait_sig+0x17 _sleep(c6dbcaf0,c6dbcb78,16c,c0e97d3e,0,...) at _sleep+0x35c kern_wait(c6dbeb80,ffffffff,c6b36c44,0,0,...) at kern_wait+0xbe6 wait4(c6dbeb80,c6b36cec,c6b36d28,c0e958ea,0,...) at wait4+0x3b syscallenter(c6dbeb80,c6b36ce4,c6b36ce4,0,0,...) at syscallenter+0x263 syscall(c6b36d28) at syscall+0x4f Xint0x80_syscall() at Xint0x80_syscall+0x21 --- syscall (7, FreeBSD ELF32, wait4), eip = 0x8060df7, esp = 0xbfbfe8bc, ebp = 0xbfbfe8d8 --- Tracing command audit pid 10 tid 100001 td 0xc6dbf000 sched_switch(c6dbf000,0,104,191,a1d8845a,...) at sched_switch+0x3bc mi_switch(104,0,c0e94f60,1f3,0,...) at mi_switch+0x1eb sleepq_switch(c6dbf000,0,c0e94f60,268,c6dbf000,...) at sleepq_switch+0x162 sleepq_wait(c1198e00,0,c6b33c8c,1,0,...) at sleepq_wait+0x63 _cv_wait(c1198e00,c1198de4,c0ebf857,194,0,...) at _cv_wait+0x243 audit_worker(0,c6b33d28,c0e8a0d8,390,c6dbd000,...) at audit_worker+0x84 fork_exit(c0ba0de0,0,c6b33d28) at fork_exit+0xb8 fork_trampoline() at fork_trampoline+0x8 --- trap 0, eip = 0, esp = 0xc6b33d60, ebp = 0 --- Tracing command kernel pid 0 tid 100076 td 0xc70458a0 sched_switch(c70458a0,0,104,191,c794796f,...) at sched_switch+0x3bc mi_switch(104,0,c0e94f60,1f3,0,...) at mi_switch+0x1eb sleepq_switch(c70458a0,0,c0e94f60,268,0,...) at sleepq_switch+0x162 sleepq_wait(c73729c0,0,c0e82852,0,0,...) at sleepq_wait+0x63 _sleep(c73729c0,c73729d8,0,c0e82852,0,...) at _sleep+0x372 taskqueue_thread_loop(c11f0920,ecfa9d28,c0e8a0d8,390,c1019980,...) at taskqueue_thread_loop+0xb5 fork_exit(c09efcc0,c11f0920,ecfa9d28) at fork_exit+0xb8 fork_trampoline() at fork_trampoline+0x8 --- trap 0, eip = 0, esp = 0xecfa9d60, ebp = 0 --- Tracing command kernel pid 0 tid 100066 td 0xc71768a0 sched_switch(c71768a0,0,104,191,77b700af,...) at sched_switch+0x3bc mi_switch(104,0,c0e94f60,1f3,0,...) at mi_switch+0x1eb sleepq_switch(c71768a0,0,c0e94f60,28b,2,...) at sleepq_switch+0x162 sleepq_timedwait(c101bc84,0,c0e82852,2,0,...) at sleepq_timedwait+0x6b _sleep(c101bc84,0,0,c0e82852,bb8,...) at _sleep+0x342 pause(c0e82852,bb8,124,122,c1019a08,...) at pause+0x47 deadlkres(0,ecf8bd28,c0e8a0d8,390,c1019980,...) at deadlkres+0x324 fork_exit(c0964860,0,ecf8bd28) at fork_exit+0xb8 fork_trampoline() at fork_trampoline+0x8 --- trap 0, eip = 0, esp = 0xecf8bd60, ebp = 0 --- Tracing command kernel pid 0 tid 100060 td 0xc7037b80 sched_switch(c7037b80,0,104,191,38d3abfd,...) at sched_switch+0x3bc mi_switch(104,0,c0e94f60,1f3,0,...) at mi_switch+0x1eb sleepq_switch(c7037b80,0,c0e94f60,268,c74a68a0,...) at sleepq_switch+0x162 sleepq_wait(c7034480,0,c0e904e1,c0e82852,0,...) at sleepq_wait+0x63 msleep_spin(c7034480,c7034498,c0e82852,0,c0e8dd67,...) at msleep_spin+0x21d taskqueue_thread_loop(c706f49c,ecf6fd28,c0e8a0d8,390,c1019980,...) at taskqueue_thread_loop+0x8f fork_exit(c09efcc0,c706f49c,ecf6fd28) at fork_exit+0xb8 fork_trampoline() at fork_trampoline+0x8 --- trap 0, eip = 0, esp = 0xecf6fd60, ebp = 0 --- Tracing command kernel pid 0 tid 100026 td 0xc6fb3000 sched_switch(c6fb3000,0,104,191,bc2b682a,...) at sched_switch+0x3bc mi_switch(104,0,c0e94f60,1f3,0,...) at mi_switch+0x1eb sleepq_switch(c6fb3000,0,c0e94f60,268,0,...) at sleepq_switch+0x162 sleepq_wait(c6f50500,0,c0e904e1,c0e82852,0,...) at sleepq_wait+0x63 msleep_spin(c6f50500,c6f50518,c0e82852,0,c0e8dd67,...) at msleep_spin+0x21d taskqueue_thread_loop(c0fe4c38,c6b80d28,c0e8a0d8,390,c1019980,...) at taskqueue_thread_loop+0x8f fork_exit(c09efcc0,c0fe4c38,c6b80d28) at fork_exit+0xb8 fork_trampoline() at fork_trampoline+0x8 --- trap 0, eip = 0, esp = 0xc6b80d60, ebp = 0 --- Tracing command kernel pid 0 tid 100025 td 0xc6fb32e0 sched_switch(c6fb32e0,0,104,191,bc2b596b,...) at sched_switch+0x3bc mi_switch(104,0,c0e94f60,1f3,0,...) at mi_switch+0x1eb sleepq_switch(c6fb32e0,0,c0e94f60,268,0,...) at sleepq_switch+0x162 sleepq_wait(c6f50500,0,c0e904e1,c0e82852,0,...) at sleepq_wait+0x63 msleep_spin(c6f50500,c6f50518,c0e82852,0,c0e8dd67,...) at msleep_spin+0x21d taskqueue_thread_loop(c0fe4c38,c6b7dd28,c0e8a0d8,390,c1019980,...) at taskqueue_thread_loop+0x8f fork_exit(c09efcc0,c0fe4c38,c6b7dd28) at fork_exit+0xb8 fork_trampoline() at fork_trampoline+0x8 --- trap 0, eip = 0, esp = 0xc6b7dd60, ebp = 0 --- Tracing command kernel pid 0 tid 100024 td 0xc6fb35c0 sched_switch(c6fb35c0,0,104,191,bc2b47a6,...) at sched_switch+0x3bc mi_switch(104,0,c0e94f60,1f3,0,...) at mi_switch+0x1eb sleepq_switch(c6fb35c0,0,c0e94f60,268,0,...) at sleepq_switch+0x162 sleepq_wait(c6f50500,0,c0e904e1,c0e82852,0,...) at sleepq_wait+0x63 msleep_spin(c6f50500,c6f50518,c0e82852,0,c0e8dd67,...) at msleep_spin+0x21d taskqueue_thread_loop(c0fe4c38,c6b7ad28,c0e8a0d8,390,c1019980,...) at taskqueue_thread_loop+0x8f fork_exit(c09efcc0,c0fe4c38,c6b7ad28) at fork_exit+0xb8 fork_trampoline() at fork_trampoline+0x8 --- trap 0, eip = 0, esp = 0xc6b7ad60, ebp = 0 --- Tracing command kernel pid 0 tid 100023 td 0xc6fb38a0 sched_switch(c6fb38a0,0,104,191,bc268ade,...) at sched_switch+0x3bc mi_switch(104,0,c0e94f60,1f3,0,...) at mi_switch+0x1eb sleepq_switch(c6fb38a0,0,c0e94f60,268,0,...) at sleepq_switch+0x162 sleepq_wait(c6f50540,0,c0e82852,0,0,...) at sleepq_wait+0x63 _sleep(c6f50540,c6f50558,0,c0e82852,0,...) at _sleep+0x372 taskqueue_thread_loop(c101a318,c6b77d28,c0e8a0d8,390,c1019980,...) at taskqueue_thread_loop+0xb5 fork_exit(c09efcc0,c101a318,c6b77d28) at fork_exit+0xb8 fork_trampoline() at fork_trampoline+0x8 --- trap 0, eip = 0, esp = 0xc6b77d60, ebp = 0 --- Tracing command kernel pid 0 tid 100021 td 0xc6e048a0 sched_switch(c6e048a0,0,104,191,bc26781f,...) at sched_switch+0x3bc mi_switch(104,0,c0e94f60,1f3,0,...) at mi_switch+0x1eb sleepq_switch(c6e048a0,0,c0e94f60,268,0,...) at sleepq_switch+0x162 sleepq_wait(c6f505c0,0,c0e82852,0,0,...) at sleepq_wait+0x63 _sleep(c6f505c0,c6f505d8,0,c0e82852,0,...) at _sleep+0x372 taskqueue_thread_loop(c11993e4,c6b71d28,c0e8a0d8,390,c1019980,...) at taskqueue_thread_loop+0xb5 fork_exit(c09efcc0,c11993e4,c6b71d28) at fork_exit+0xb8 fork_trampoline() at fork_trampoline+0x8 --- trap 0, eip = 0, esp = 0xc6b71d60, ebp = 0 --- Tracing command kernel pid 0 tid 100019 td 0xc6ece000 sched_switch(c6ece000,0,104,191,bf088990,...) at sched_switch+0x3bc mi_switch(104,0,c0e94f60,1f3,0,...) at mi_switch+0x1eb sleepq_switch(c6ece000,0,c0e94f60,268,0,...) at sleepq_switch+0x162 sleepq_wait(c6f50640,0,c0e82852,0,0,...) at sleepq_wait+0x63 _sleep(c6f50640,c6f50658,0,c0e82852,0,...) at _sleep+0x372 taskqueue_thread_loop(c1038888,c6b6bd28,c0e8a0d8,390,c1019980,...) at taskqueue_thread_loop+0xb5 fork_exit(c09efcc0,c1038888,c6b6bd28) at fork_exit+0xb8 fork_trampoline() at fork_trampoline+0x8 --- trap 0, eip = 0, esp = 0xc6b6bd60, ebp = 0 --- Tracing command kernel pid 0 tid 100016 td 0xc6ece8a0 sched_switch(c6ece8a0,0,104,191,e773ca29,...) at sched_switch+0x3bc mi_switch(104,0,c0e94f60,1f3,0,...) at mi_switch+0x1eb sleepq_switch(c6ece8a0,0,c0e94f60,268,0,...) at sleepq_switch+0x162 sleepq_wait(c6d78b40,0,c0e82852,0,0,...) at sleepq_wait+0x63 _sleep(c6d78b40,c6d78b58,0,c0e82852,0,...) at _sleep+0x372 taskqueue_thread_loop(c10372a0,c6b62d28,c0e8a0d8,390,c1019980,...) at taskqueue_thread_loop+0xb5 fork_exit(c09efcc0,c10372a0,c6b62d28) at fork_exit+0xb8 fork_trampoline() at fork_trampoline+0x8 --- trap 0, eip = 0, esp = 0xc6b62d60, ebp = 0 --- Tracing command kernel pid 0 tid 100000 td 0xc1019c40 sched_switch(c1019c40,0,104,191,9fa2185e,...) at sched_switch+0x3bc mi_switch(104,0,c0e94f60,1f3,54,...) at mi_switch+0x1eb sleepq_switch(c1019c40,0,c0e94f60,28b,0,...) at sleepq_switch+0x162 sleepq_timedwait(c1019980,54,c0e9209d,0,0,...) at sleepq_timedwait+0x6b _sleep(c1019980,0,54,c0e9209d,2710,...) at _sleep+0x342 scheduler(0,141ec00,141ec00,141e000,1425000,...) at scheduler+0x240 mi_startup() at mi_startup+0xac begin() at begin+0x2c db:0:allt> call doadump Physical memory: 3439 MB Physical memory: 3439 MB Dumping 247 MB:Dumping 247 MB:lock order reversal: lock order reversal: 1st 0xc95f9634 vnode interlock (vnode interlock) @ kern/vfs_subr.c:2140 1st 0xc95f9634 vnode interlock (vnode interlock) @ kern/vfs_subr.c:2140 2nd 0xc6ec9804 AHCI channel lock (AHCI channel lock) @ cam/cam_periph.h:188 2nd 0xc6ec9804 AHCI channel lock (AHCI channel lock) @ cam/cam_periph.h:188 KDB: stack backtrace: KDB: stack backtrace: db_trace_self_wrapper(c0e93696,20402029,2f6d6163,5f6d6163,69726570,...) at db_trace_self_wrapper+0x26 kdb_backtrace(c09e5dcb,c0e9709f,c6d5b1e0,c6d5fd08,ef1c8a74,...) at kdb_backtrace+0x2a _witness_debugger(c0e9709f,c6ec9804,c0d23f14,c6d5fd08,c0d01bab,...) at _witness_debugger+0x25 witness_checkorder(c6ec9804,9,c0d01ba2,bc,0,...) at witness_checkorder+0x839 _mtx_lock_flags(c6ec9804,0,c0d01ba2,bc,0,...) at _mtx_lock_flags+0xc4 adadump(c6d97400,c11b3fe0,0,70849a00,4,...) at adadump+0x67 dump_write(c101b9c0,c11b3fe0,0,70849a00,4,...) at dump_write+0x8b minidumpsys(c101b9c0,c04dfa03,c1361e4f,ef1c904c,ef1c904c,...) at minidumpsys+0x356 dumpsys(c101b9c0,ef1c90fc,c04de5c9,ef1c90a4,0,...) at dumpsys+0x2b doadump(ef1c90a4,0,0,0,0,...) at doadump+0x6c db_fncall(c09e15fa,0,ffffffff,ef1c9138,0,...) at db_fncall+0x149 db_command(c0fe3d08,ef1c9228,c04e2df0,c0fe3d08,0,...) at db_command+0x3bf db_command_script(c0fe3d08,0,c0fe3660,c0fe3d07,c0fe3660,...) at db_command_script+0x34 db_script_exec(ef1c9420,ef1c92f8,c04de9c1,1,0,...) at db_script_exec+0x130 db_run_cmd(1,0,c11bb900,ef1c9270,1,...) at db_run_cmd+0x41 db_command(c0d16113,ef1c9358,c04e0b0d,c0d1643e,fb,...) at db_command+0x381 db_command_loop(c0d1643e,fb,3,0,0,...) at db_command_loop+0x5a db_trap(3,0,1,46,e,...) at db_trap+0xdd kdb_trap(3,0,ef1c9420,ef1c93a0,c7024834,...) at kdb_trap+0x92 trap(ef1c9420) at trap+0x66b calltrap() at calltrap+0x6 --- trap 0x3, eip = 0xc09e15fa, esp = 0xef1c9460, ebp = 0xef1c9468 --- kdb_enter(c0d1643e,c0e595b0,0,c716a080,0,...) at kdb_enter+0x3a uart_intr(c716a000,c6d5b1e0,c6d61f28,c,0,...) at uart_intr+0x126 intr_event_handle(c6d88800,ef1c9500,ef1c94d8,c74a68a0,c95f9634,...) at intr_event_handle+0x76 intr_execute_handlers(c6e020d0,ef1c9500,0,ef1c955c,c0cc25f5,...) at intr_execute_handlers+0x49 lapic_handle_intr(3b,ef1c9500) at lapic_handle_intr+0x36 Xapic_isr1() at Xapic_isr1+0x35 --- interrupt, eip = 0xc099d27e, esp = 0xef1c9540, ebp = 0xef1c955c --- _mtx_unlock_flags(c95f9634,0,c0e9ecb2,86b,c95f9634,...) at _mtx_unlock_flags+0x9e vget(c95f9570,80100,c74a68a0,419,c77362d4,...) at vget+0x1b3 qsync(c77362d4,ef1c9614,c74a68a0,574,0,...) at qsync+0x19d ffs_sync(c77362d4,1,277,c0ea0542,0,...) at ffs_sync+0x584 vfs_write_suspend(c77362d4,ef1c98b8,0,4000,c6da0000,...) at vfs_write_suspend+0x122 ffs_snapshot(c77362d4,c7405320,c0ec5490,174,ef1c9980,...) at ffs_snapshot+0xc91 ffs_mount(c77362d4,c7beb800,ff,393,0,...) at ffs_mount+0x1590 vfs_donmount(c74a68a0,213300,c7b3cc80,c7b3cc80,c7024834,...) at vfs_donmount+0x1147 nmount(c74a68a0,ef1c9cec,ef1c9d28,c0e958ea,0,...) at nmount+0x84 syscallenter(c74a68a0,ef1c9ce4,ef1c9ce4,0,74b,...) at syscallenter+0x263 syscall(ef1c9d28) at syscall+0x4f Xint0x80_syscall() at Xint0x80_syscall+0x21 --- syscall (378, FreeBSD ELF32, nmount), eip = 0x280da9db, esp = 0xbfbfe0ac, ebp = 0xbfbfe828 --- 232 232 216 216 200 200 184 184 168 168 152 152 136 136 120 120 104 104 88 88 72 72 56 56 40 40 24 24 8 8 Dump complete Dump complete = 0 db:0:doadump> reset (kgdb) proc 2479 [Switching to thread 147 (Thread 100089)]#0 doadump (textdump=0xef1c90a4) at pcpu.h:244 244 __asm("movl %%fs:0,%0" : "=r" (td)); (kgdb) bt #0 doadump (textdump=0xef1c90a4) at pcpu.h:244 #1 0xc04de5c9 in db_fncall (dummy1=0xc09e15fa, dummy2=0x0, dummy3=0xffffffff, dummy4=0xef1c9138 "L\221\034ï") at ../../../ddb/db_command.c:572 #2 0xc04de9ff in db_command (last_cmdp=0xc0fe2dfc, cmd_table=0x0, dopager=0x0) at ../../../ddb/db_command.c:448 #3 0xc04deab4 in db_command_script (command=0xc0fe3d08 "call doadump") at ../../../ddb/db_command.c:519 #4 0xc04e2df0 in db_script_exec (scriptname=0xc0fe3660 "doadump", warnifnotfound=Variable "warnifnotfound" is not available. ) at ../../../ddb/db_script.c:302 #5 0xc04e2e81 in db_run_cmd (addr=0x1, have_addr=0x0, count=0xc11bb900, modif=0xef1c9270 "") at ../../../ddb/db_script.c:375 #6 0xc04de9c1 in db_command (last_cmdp=0xc0fe2dfc, cmd_table=0x0, dopager=0x1) at ../../../ddb/db_command.c:448 #7 0xc04deb1a in db_command_loop () at ../../../ddb/db_command.c:501 #8 0xc04e0b0d in db_trap (type=0x3, code=0x0) at ../../../ddb/db_main.c:229 #9 0xc09e1772 in kdb_trap (type=0x3, code=0x0, tf=0xef1c9420) at ../../../kern/subr_kdb.c:534 #10 0xc0cd931b in trap (frame=0xef1c9420) at ../../../i386/i386/trap.c:719 #11 0xc0cc222c in calltrap () at ../../../i386/i386/exception.s:168 #12 0xc09e15fa in kdb_enter (why=0xc0d1643e "break", msg=0xc0e595b0 "Line break on console") at cpufunc.h:71 #13 0xc0826466 in uart_intr (arg=0xc716a000) at ../../../dev/uart/uart_core.c:123 #14 0xc0984af6 in intr_event_handle (ie=0xc6d88800, frame=0xef1c9500) at ../../../kern/kern_intr.c:1430 #15 0xc0cc7489 in intr_execute_handlers (isrc=0xc6e020d0, frame=0xef1c9500) at ../../../i386/i386/intr_machdep.c:251 #16 0xc0cf1b66 in lapic_handle_intr (vector=0x3b, frame=0xef1c9500) at ../../../x86/x86/local_apic.c:780 #17 0xc0cc25f5 in Xapic_isr1 () at apic_vector.s:89 #18 0xc099d27e in _mtx_unlock_flags (m=0xc95f9634, opts=0x0, file=0xc0e9ecb2 "../../../kern/vfs_subr.c", line=0x86b) at pcpu.h:244 #19 0xc0a48633 in vget (vp=0xc95f9570, flags=0x80100, td=0xc74a68a0) at ../../../kern/vfs_subr.c:2155 #20 0xc0bf3cad in qsync (mp=0xc77362d4) at ../../../ufs/ufs/ufs_quota.c:1055 #21 0xc0be2b34 in ffs_sync (mp=0xc77362d4, waitfor=0x1) at ../../../ufs/ffs/ffs_vfsops.c:1410 #22 0xc0a551b2 in vfs_write_suspend (mp=0xc77362d4) at ../../../kern/vfs_vnops.c:1149 #23 0xc0bc79b1 in ffs_snapshot (mp=0xc77362d4, snapfile=0xc7405320 "/mnt/.snap/snap3") at ../../../ufs/ffs/ffs_snapshot.c:415 #24 0xc0be4780 in ffs_mount (mp=0xc77362d4) at ../../../ufs/ffs/ffs_vfsops.c:395 #25 0xc0a3ec07 in vfs_donmount (td=0xc74a68a0, fsflags=0x213300, fsoptions=0xc7b3cc80) at ../../../kern/vfs_mount.c:924 #26 0xc0a3f274 in nmount (td=0xc74a68a0, uap=0xef1c9cec) at ../../../kern/vfs_mount.c:409 #27 0xc09f0083 in syscallenter (td=0xc74a68a0, sa=0xef1c9ce4) at ../../../kern/subr_trap.c:344 #28 0xc0cd8bcf in syscall (frame=0xef1c9d28) at ../../../i386/i386/trap.c:1082 #29 0xc0cc2291 in Xint0x80_syscall () at ../../../i386/i386/exception.s:266 #30 0x00000033 in ?? () Previous frame inner to this frame (corrupt stack?) (kgdb) f 21 #21 0xc0be2b34 in ffs_sync (mp=0xc77362d4, waitfor=0x1) at ../../../ufs/ffs/ffs_vfsops.c:1410 1410 qsync(mp); (kgdb) l 1405 MNT_ILOCK(mp); 1406 goto loop; 1407 } 1408 } 1409 #ifdef QUOTA 1410 qsync(mp); 1411 #endif 1412 devvp = ump->um_devvp; 1413 bo = &devvp->v_bufobj; 1414 BO_LOCK(bo); (kgdb) (kgdb) f 20 #20 0xc0bf3cad in qsync (mp=0xc77362d4) at ../../../ufs/ufs/ufs_quota.c:1055 1055 error = vget(vp, LK_EXCLUSIVE | LK_INTERLOCK, td); (kgdb) l 1050 if (vp->v_type == VNON) { 1051 VI_UNLOCK(vp); 1052 MNT_ILOCK(mp); 1053 continue; 1054 } 1055 error = vget(vp, LK_EXCLUSIVE | LK_INTERLOCK, td); 1056 if (error) { 1057 MNT_ILOCK(mp); 1058 if (error == ENOENT) { 1059 MNT_VNODE_FOREACH_ABORT_ILOCKED(mp, mvp); (kgdb) info loc ump = Variable "ump" is not available. (kgdb) p *mp $1 = {mnt_mtx = {lock_object = {lo_name = 0xc0e81fb1 "struct mount mtx", lo_flags = 0x1030000, lo_data = 0x0, lo_witness = 0xc6d5b450}, mtx_lock = 0x4}, mnt_gen = 0x1, mnt_list = {tqe_next = 0x0, tqe_prev = 0xc77372ec}, mnt_op = 0xc0fc5700, mnt_vfc = 0xc0fc5560, mnt_vnodecovered = 0xc777a828, mnt_syncer = 0xc88de15c, mnt_ref = 0x4e, mnt_nvnodelist = {tqh_first = 0xc88de414, tqh_last = 0xc92f76e0}, mnt_nvnodelistsize = 0x33, mnt_writeopcount = 0x0, mnt_kern_flag = 0x68000144, mnt_flag = 0x1213300, mnt_xflag = 0x0, mnt_noasync = 0x1, mnt_opt = 0xc74b8ae0, mnt_optnew = 0xc74b8be0, mnt_maxsymlinklen = 0x78, mnt_stat = {f_version = 0x20030518, f_type = 0x2, f_flags = 0x203300, f_bsize = 0x800, f_iosize = 0x4000, f_blocks = 0x7ba73, f_bfree = 0x70aa7, f_bavail = 0x66c61, f_files = 0x227fe, f_ffree = 0x227cc, f_syncwrites = 0x0, f_asyncwrites = 0x0, f_syncreads = 0x0, f_asyncreads = 0x0, f_spare = {0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0}, f_namemax = 0xff, f_owner = 0x0, f_fsid = {val = {0x4df0fca3, 0xa9254090}}, f_charspare = '\0' , f_fstypename = "ufs", '\0' , f_mntfromname = "/dev/md5a", '\0' , f_mntonname = "/mnt", '\0' }, mnt_cred = 0xc73f7600, mnt_data = 0xc97ba900, mnt_time = 0x0, mnt_iosize_max = 0x20000, mnt_export = 0xc74f3a00, mnt_label = 0x0, mnt_hashseed = 0x563d619, mnt_lockref = 0x1, mnt_secondary_writes = 0x0, mnt_secondary_accwrites = 0x221a, mnt_susp_owner = 0xc74a68a0, mnt_gjprovider = 0x0, mnt_explock = {lock_object = {lo_name = 0xc0e81fc2 "explock", lo_flags = 0x5730000, lo_data = 0x0, lo_witness = 0xc6d60ad8}, lk_lock = 0x1, lk_exslpfail = 0x0, lk_timo = 0x0, lk_pri = 0x60, lk_stack = {depth = 0x7, pcs = {0xc099548e, 0xc0a36b37, 0xc0a3ec56, 0xc0a3f274, 0xc09f0083, 0xc0cd8bcf, 0xc0cc2291, 0x0 }}}} (kgdb) p *vp $2 = {v_type = VDIR, v_tag = 0xc0e86454 "ufs", v_op = 0xc0fc5960, v_data = 0xc95f7d24, v_mount = 0xc77362d4, v_nmntvnodes = {tqe_next = 0xc99ede00, tqe_prev = 0xc88de014}, v_un = {vu_mount = 0x0, vu_socket = 0x0, vu_cdev = 0x0, vu_fifoinfo = 0x0}, v_hashlist = {le_next = 0x0, le_prev = 0xc724b870}, v_hash = 0x3, v_cache_src = {lh_first = 0xc97cc000}, v_cache_dst = {tqh_first = 0xc97b3d38, tqh_last = 0xc97b3d48}, v_cache_dd = 0xc97b3d38, v_cstart = 0x0, v_lasta = 0x0, v_lastw = 0x0, v_clen = 0x0, v_lock = {lock_object = {lo_name = 0xc0e86454 "ufs", lo_flags = 0x57b0000, lo_data = 0x0, lo_witness = 0xc6d61f28}, lk_lock = 0xc74a68a0, lk_exslpfail = 0x0, lk_timo = 0x33, lk_pri = 0x60, lk_stack = {depth = 0xf, pcs = {0xc099548e, 0xc0be7391, 0xc0cfb5e5, 0xc0a553d8, 0xc0a4853b, 0xc0bf3cad, 0xc0be2b34, 0xc0a551b2, 0xc0bc79b1, 0xc0be4780, 0xc0a3ec07, 0xc0a3f274, 0xc09f0083, 0xc0cd8bcf, 0xc0cc2291, 0x0, 0x0, 0x0}}}, v_interlock = {lock_object = {lo_name = 0xc0e97299 "vnode interlock", lo_flags = 0x1030000, lo_data = 0x0, lo_witness = 0xc6d5b1e0}, mtx_lock = 0xc74a68a0}, v_vnlock = 0xc95f95c8, v_holdcnt = 0x5, v_usecount = 0x2, v_iflag = 0x0, v_vflag = 0x0, v_writecount = 0x0, v_freelist = {tqe_next = 0xc7214c3c, tqe_prev = 0xc959ee88}, v_bufobj = {bo_mtx = {lock_object = {lo_name = 0xc0e9fbf9 "bufobj interlock", lo_flags = 0x1030000, lo_data = 0x0, lo_witness = 0xc6d60798}, mtx_lock = 0x4}, bo_clean = {bv_hd = {tqh_first = 0xe07c8d00, tqh_last = 0xe07c8d38}, bv_root = 0xe07c8d00, bv_cnt = 0x1}, bo_dirty = {bv_hd = {tqh_first = 0x0, tqh_last = 0xc95f968c}, bv_root = 0x0, bv_cnt = 0x0}, bo_numoutput = 0x0, bo_flag = 0x0, bo_ops = 0xc0fb2ae0, bo_bsize = 0x4000, bo_object = 0xc7f447f8, bo_synclist = {le_next = 0xc92f7254, le_prev = 0xc98e2d7c}, bo_private = 0xc95f9570, __bo_vnode = 0xc95f9570}, v_pollinfo = 0x0, v_label = 0x0, v_lockf = 0x0} (kgdb) $ svn diff -x -p /usr/src/sys Index: /usr/src/sys/ufs/ufs/quota.h =================================================================== --- /usr/src/sys/ufs/ufs/quota.h (revision 222894) +++ /usr/src/sys/ufs/ufs/quota.h (working copy) @@ -30,7 +30,7 @@ * SUCH DAMAGE. * * @(#)quota.h 8.3 (Berkeley) 8/19/94 - * $FreeBSD$ + * $FreeBSD: head/sys/ufs/ufs/quota.h 207736 2010-05-07 00:41:12Z mckusick $ */ #ifndef _UFS_UFS_QUOTA_H_ @@ -239,6 +239,12 @@ int setuse(struct thread *, struct mount *, u_long int getquotasize(struct thread *, struct mount *, u_long, int, void *); vfs_quotactl_t ufs_quotactl; +#ifdef SOFTUPDATES +int quotaref(struct vnode *, struct dquot **); +void quotarele(struct dquot **); +void quotaadj(struct dquot **, struct ufsmount *, int64_t); +#endif /* SOFTUPDATES */ + #else /* !_KERNEL */ #include Index: /usr/src/sys/ufs/ufs/inode.h =================================================================== --- /usr/src/sys/ufs/ufs/inode.h (revision 222894) +++ /usr/src/sys/ufs/ufs/inode.h (working copy) @@ -32,7 +32,7 @@ * SUCH DAMAGE. * * @(#)inode.h 8.9 (Berkeley) 5/14/95 - * $FreeBSD$ + * $FreeBSD: head/sys/ufs/ufs/inode.h 209717 2010-07-06 07:11:04Z jeff $ */ #ifndef _UFS_UFS_INODE_H_ @@ -127,6 +127,8 @@ struct inode { #define IN_EA_LOCKED 0x0200 #define IN_EA_LOCKWAIT 0x0400 +#define IN_TRUNCATED 0x0800 /* Journaled truncation pending. */ + #define i_devvp i_ump->um_devvp #define i_umbufobj i_ump->um_bo #define i_dirhash i_un.dirhash Index: /usr/src/sys/ufs/ufs/ufs_quota.c =================================================================== --- /usr/src/sys/ufs/ufs/ufs_quota.c (revision 222894) +++ /usr/src/sys/ufs/ufs/ufs_quota.c (working copy) @@ -33,7 +33,7 @@ */ #include -__FBSDID("$FreeBSD$"); +__FBSDID("$FreeBSD: head/sys/ufs/ufs/ufs_quota.c 219388 2011-03-07 22:36:11Z kib $"); #include "opt_ffs.h" @@ -1613,6 +1613,101 @@ dqflush(struct vnode *vp) } /* + * The following three functions are provided for the adjustment of + * quotas by the soft updates code. + */ +#ifdef SOFTUPDATES +/* + * Acquire a reference to the quota structures associated with a vnode. + * Return count of number of quota structures found. + */ +int +quotaref(vp, qrp) + struct vnode *vp; + struct dquot **qrp; +{ + struct inode *ip; + struct dquot *dq; + int i, found; + + for (i = 0; i < MAXQUOTAS; i++) + qrp[i] = NODQUOT; + /* + * Disk quotas must be turned off for system files. Currently + * snapshot and quota files. + */ + if ((vp->v_vflag & VV_SYSTEM) != 0) + return (0); + /* + * Iterate through and copy active quotas. + */ + found = 0; + ip = VTOI(vp); + for (i = 0; i < MAXQUOTAS; i++) { + if ((dq = ip->i_dquot[i]) == NODQUOT) + continue; + DQREF(dq); + qrp[i] = dq; + found++; + } + return (found); +} + +/* + * Release a set of quota structures obtained from a vnode. + */ +void +quotarele(qrp) + struct dquot **qrp; +{ + struct dquot *dq; + int i; + + for (i = 0; i < MAXQUOTAS; i++) { + if ((dq = qrp[i]) == NODQUOT) + continue; + dqrele(NULL, dq); + } +} + +/* + * Adjust the number of blocks associated with a quota. + * Positive numbers when adding blocks; negative numbers when freeing blocks. + */ +void +quotaadj(qrp, ump, blkcount) + struct dquot **qrp; + struct ufsmount *ump; + int64_t blkcount; +{ + struct dquot *dq; + ufs2_daddr_t ncurblocks; + int i; + + if (blkcount == 0) + return; + for (i = 0; i < MAXQUOTAS; i++) { + if ((dq = qrp[i]) == NODQUOT) + continue; + DQI_LOCK(dq); + DQI_WAIT(dq, PINOD+1, "adjqta"); + ncurblocks = dq->dq_curblocks + blkcount; + if (ncurblocks >= 0) + dq->dq_curblocks = ncurblocks; + else + dq->dq_curblocks = 0; + if (blkcount < 0) + dq->dq_flags &= ~DQ_BLKS; + else if (dq->dq_curblocks + blkcount >= dq->dq_bsoftlimit && + dq->dq_curblocks < dq->dq_bsoftlimit) + dq->dq_btime = time_second + ump->um_btime[i]; + dq->dq_flags |= DQ_MOD; + DQI_UNLOCK(dq); + } +} +#endif /* SOFTUPDATES */ + +/* * 32-bit / 64-bit conversion functions. * * 32-bit quota records are stored in native byte order. Attention must Index: /usr/src/sys/ufs/ufs/ufsmount.h =================================================================== --- /usr/src/sys/ufs/ufs/ufsmount.h (revision 222894) +++ /usr/src/sys/ufs/ufs/ufsmount.h (working copy) @@ -61,6 +61,7 @@ struct jblocks; struct inodedep; TAILQ_HEAD(inodedeplst, inodedep); +LIST_HEAD(bmsafemaphd, bmsafemap); /* This structure describes the UFS specific mount structure data. */ struct ufsmount { @@ -82,10 +83,10 @@ struct ufsmount { struct workhead softdep_journal_pending; /* journal work queue */ struct worklist *softdep_journal_tail; /* Tail pointer for above */ struct jblocks *softdep_jblocks; /* Journal block information */ - struct inodedeplst softdep_unlinked; /* Unlinked inodes */ + struct inodedeplst softdep_unlinked; /* Unlinked inodes */ + struct bmsafemaphd softdep_dirtycg; /* Dirty CGs */ int softdep_on_journal; /* Items on the journal list */ int softdep_on_worklist; /* Items on the worklist */ - int softdep_on_worklist_inprogress; /* Busy items on worklist */ int softdep_deps; /* Total dependency count */ int softdep_accdeps; /* accumulated dep count */ int softdep_req; /* Wakeup when deps hits 0. */ Index: /usr/src/sys/ufs/ufs/ufs_lookup.c =================================================================== --- /usr/src/sys/ufs/ufs/ufs_lookup.c (revision 222894) +++ /usr/src/sys/ufs/ufs/ufs_lookup.c (working copy) @@ -967,7 +967,7 @@ ufs_direnter(dvp, tvp, dirp, cnp, newdirbp, isrena return (0); if (tvp != NULL) VOP_UNLOCK(tvp, 0); - error = VOP_FSYNC(dvp, MNT_WAIT, td); + (void) VOP_FSYNC(dvp, MNT_WAIT, td); if (tvp != NULL) vn_lock(tvp, LK_EXCLUSIVE | LK_RETRY); return (error); Index: /usr/src/sys/ufs/ffs/ffs_vfsops.c =================================================================== --- /usr/src/sys/ufs/ffs/ffs_vfsops.c (revision 222894) +++ /usr/src/sys/ufs/ffs/ffs_vfsops.c (working copy) @@ -2034,12 +2034,10 @@ ffs_geom_strategy(struct bufobj *bo, struct buf *b static void db_print_ffs(struct ufsmount *ump) { - db_printf("mp %p %s devvp %p fs %p su_wl %d su_wl_in %d su_deps %d " - "su_req %d\n", + db_printf("mp %p %s devvp %p fs %p su_wl %d su_deps %d su_req %d\n", ump->um_mountp, ump->um_mountp->mnt_stat.f_mntonname, ump->um_devvp, ump->um_fs, ump->softdep_on_worklist, - ump->softdep_on_worklist_inprogress, ump->softdep_deps, - ump->softdep_req); + ump->softdep_deps, ump->softdep_req); } DB_SHOW_COMMAND(ffs, db_show_ffs) Index: /usr/src/sys/ufs/ffs/ffs_softdep.c =================================================================== --- /usr/src/sys/ufs/ffs/ffs_softdep.c (revision 222894) +++ /usr/src/sys/ufs/ffs/ffs_softdep.c (working copy) @@ -52,6 +52,8 @@ __FBSDID("$FreeBSD$"); #define DEBUG #endif +/* #define SUJ_DEBUG 1 */ + #include #include #include @@ -214,6 +216,25 @@ softdep_setup_allocindir_meta(nbp, ip, bp, ptrno, } void +softdep_journal_freeblocks(ip, cred, length, flags) + struct inode *ip; + struct ucred *cred; + off_t length; + int flags; +{ + + panic("softdep_journal_freeblocks called"); +} + +void +softdep_journal_fsync(ip) + struct inode *ip; +{ + + panic("softdep_journal_fsync called"); +} + +void softdep_setup_freeblocks(ip, length, flags) struct inode *ip; off_t length; @@ -282,29 +303,6 @@ softdep_setup_directory_change(bp, dp, ip, newinum panic("softdep_setup_directory_change called"); } -void * -softdep_setup_trunc(vp, length, flags) - struct vnode *vp; - off_t length; - int flags; -{ - - panic("%s called", __FUNCTION__); - - return (NULL); -} - -int -softdep_complete_trunc(vp, cookie) - struct vnode *vp; - void *cookie; -{ - - panic("%s called", __FUNCTION__); - - return (0); -} - void softdep_setup_blkfree(mp, bp, blkno, frags, wkhd) struct mount *mp; @@ -499,6 +497,13 @@ softdep_sync_metadata(struct vnode *vp) } int +softdep_sync_buf(struct vnode *vp, struct buf *bp, int waitfor) +{ + + return (0); +} + +int softdep_slowdown(vp) struct vnode *vp; { @@ -614,10 +619,13 @@ FEATURE(softupdates, "FFS soft-updates support"); #define D_JSEGDEP 23 #define D_SBDEP 24 #define D_JTRUNC 25 -#define D_LAST D_JTRUNC +#define D_JFSYNC 26 +#define D_SENTINAL 27 +#define D_LAST D_SENTINAL unsigned long dep_current[D_LAST + 1]; unsigned long dep_total[D_LAST + 1]; +unsigned long dep_write[D_LAST + 1]; SYSCTL_NODE(_debug, OID_AUTO, softdep, CTLFLAG_RW, 0, "soft updates stats"); @@ -625,13 +633,17 @@ SYSCTL_NODE(_debug_softdep, OID_AUTO, total, CTLFL "total dependencies allocated"); SYSCTL_NODE(_debug_softdep, OID_AUTO, current, CTLFLAG_RW, 0, "current dependencies allocated"); +SYSCTL_NODE(_debug_softdep, OID_AUTO, write, CTLFLAG_RW, 0, + "current dependencies written"); #define SOFTDEP_TYPE(type, str, long) \ static MALLOC_DEFINE(M_ ## type, #str, long); \ SYSCTL_ULONG(_debug_softdep_total, OID_AUTO, str, CTLFLAG_RD, \ &dep_total[D_ ## type], 0, ""); \ SYSCTL_ULONG(_debug_softdep_current, OID_AUTO, str, CTLFLAG_RD, \ - &dep_current[D_ ## type], 0, ""); + &dep_current[D_ ## type], 0, ""); \ + SYSCTL_ULONG(_debug_softdep_write, OID_AUTO, str, CTLFLAG_RD, \ + &dep_write[D_ ## type], 0, ""); SOFTDEP_TYPE(PAGEDEP, pagedep, "File page dependencies"); SOFTDEP_TYPE(INODEDEP, inodedep, "Inode dependencies"); @@ -660,6 +672,7 @@ SOFTDEP_TYPE(JSEG, jseg, "Journal segment"); SOFTDEP_TYPE(JSEGDEP, jsegdep, "Journal segment complete"); SOFTDEP_TYPE(SBDEP, sbdep, "Superblock write dependency"); SOFTDEP_TYPE(JTRUNC, jtrunc, "Journal inode truncation"); +SOFTDEP_TYPE(JFSYNC, jfsync, "Journal fsync complete"); static MALLOC_DEFINE(M_SAVEDINO, "savedino", "Saved inodes"); static MALLOC_DEFINE(M_JBLOCKS, "jblocks", "Journal block locations"); @@ -694,7 +707,8 @@ static struct malloc_type *memtype[] = { M_JSEG, M_JSEGDEP, M_SBDEP, - M_JTRUNC + M_JTRUNC, + M_JFSYNC }; static LIST_HEAD(mkdirlist, mkdir) mkdirlisthd; @@ -734,10 +748,11 @@ static void clear_unlinked_inodedep(struct inodede static struct inodedep *first_unlinked_inodedep(struct ufsmount *); static int flush_pagedep_deps(struct vnode *, struct mount *, struct diraddhd *); -static void free_pagedep(struct pagedep *); +static int free_pagedep(struct pagedep *); static int flush_newblk_dep(struct vnode *, struct mount *, ufs_lbn_t); -static int flush_inodedep_deps(struct mount *, ino_t); +static int flush_inodedep_deps(struct vnode *, struct mount *, ino_t); static int flush_deplist(struct allocdirectlst *, int, int *); +static int sync_cgs(struct mount *, int); static int handle_written_filepage(struct pagedep *, struct buf *); static int handle_written_sbdep(struct sbdep *, struct buf *); static void initiate_write_sbdep(struct sbdep *); @@ -750,7 +765,7 @@ static void handle_written_jaddref(struct jaddref static void handle_written_jremref(struct jremref *); static void handle_written_jseg(struct jseg *, struct buf *); static void handle_written_jnewblk(struct jnewblk *); -static void handle_written_jfreeblk(struct jfreeblk *); +static void handle_written_jblkdep(struct jblkdep *); static void handle_written_jfreefrag(struct jfreefrag *); static void complete_jseg(struct jseg *); static void jseg_write(struct ufsmount *ump, struct jseg *, uint8_t *); @@ -758,6 +773,7 @@ static void jaddref_write(struct jaddref *, struct static void jremref_write(struct jremref *, struct jseg *, uint8_t *); static void jmvref_write(struct jmvref *, struct jseg *, uint8_t *); static void jtrunc_write(struct jtrunc *, struct jseg *, uint8_t *); +static void jfsync_write(struct jfsync *, struct jseg *, uint8_t *data); static void jnewblk_write(struct jnewblk *, struct jseg *, uint8_t *); static void jfreeblk_write(struct jfreeblk *, struct jseg *, uint8_t *); static void jfreefrag_write(struct jfreefrag *, struct jseg *, uint8_t *); @@ -768,7 +784,9 @@ static void handle_allocdirect_partdone(struct all static struct jnewblk *cancel_newblk(struct newblk *, struct worklist *, struct workhead *); static void indirdep_complete(struct indirdep *); -static int indirblk_inseg(struct mount *, ufs2_daddr_t); +static int indirblk_lookup(struct mount *, ufs2_daddr_t); +static void indirblk_insert(struct freework *); +static void indirblk_remove(struct freework *); static void handle_allocindir_partdone(struct allocindir *); static void initiate_write_filepage(struct pagedep *, struct buf *); static void initiate_write_indirdep(struct indirdep*, struct buf *); @@ -777,10 +795,12 @@ static void initiate_write_bmsafemap(struct bmsafe static void initiate_write_inodeblock_ufs1(struct inodedep *, struct buf *); static void initiate_write_inodeblock_ufs2(struct inodedep *, struct buf *); static void handle_workitem_freefile(struct freefile *); -static void handle_workitem_remove(struct dirrem *, struct vnode *); +static int handle_workitem_remove(struct dirrem *, int); static struct dirrem *newdirrem(struct buf *, struct inode *, struct inode *, int, struct dirrem **); -static void cancel_indirdep(struct indirdep *, struct buf *, struct inodedep *, +static struct indirdep *indirdep_lookup(struct mount *, struct inode *, + struct buf *); +static void cancel_indirdep(struct indirdep *, struct buf *, struct freeblks *); static void free_indirdep(struct indirdep *); static void free_diradd(struct diradd *, struct workhead *); @@ -795,8 +815,13 @@ static void cancel_diradd(struct diradd *, struct struct jremref *, struct jremref *); static void dirrem_journal(struct dirrem *, struct jremref *, struct jremref *, struct jremref *); -static void cancel_allocindir(struct allocindir *, struct inodedep *, - struct freeblks *); +static void cancel_allocindir(struct allocindir *, struct buf *bp, + struct freeblks *, int); +static int setup_trunc_indir(struct freeblks *, struct inode *, + ufs_lbn_t, ufs_lbn_t, ufs2_daddr_t); +static void complete_trunc_indir(struct freework *); +static void trunc_indirdep(struct indirdep *, struct freeblks *, struct buf *, + int); static void complete_mkdir(struct mkdir *); static void free_newdirblk(struct newdirblk *); static void free_jremref(struct jremref *); @@ -806,7 +831,7 @@ static void free_jsegs(struct jblocks *); static void rele_jseg(struct jseg *); static void free_jseg(struct jseg *, struct jblocks *); static void free_jnewblk(struct jnewblk *); -static void free_jfreeblk(struct jfreeblk *); +static void free_jblkdep(struct jblkdep *); static void free_jfreefrag(struct jfreefrag *); static void free_freedep(struct freedep *); static void journal_jremref(struct dirrem *, struct jremref *, @@ -818,30 +843,31 @@ static void cancel_jfreefrag(struct jfreefrag *); static inline void setup_freedirect(struct freeblks *, struct inode *, int, int); static inline void setup_freeext(struct freeblks *, struct inode *, int, int); -static inline void setup_freeindir(struct freeblks *, struct inode *, int i, +static inline void setup_freeindir(struct freeblks *, struct inode *, int, ufs_lbn_t, int); static inline struct freeblks *newfreeblks(struct mount *, struct inode *); static void indir_trunc(struct freework *, ufs2_daddr_t, ufs_lbn_t); -static void softdep_trunc_deps(struct vnode *, struct freeblks *, ufs_lbn_t, +ufs2_daddr_t blkcount(struct fs *, ufs2_daddr_t, off_t); +static void trunc_dependencies(struct inode *, struct freeblks *, ufs_lbn_t, int, int); -static int cancel_pagedep(struct pagedep *, struct inodedep *, - struct freeblks *); -static int deallocate_dependencies(struct buf *, struct inodedep *, - struct freeblks *, int off); +static int cancel_pagedep(struct pagedep *, struct freeblks *, int); +static int deallocate_dependencies(struct buf *, struct freeblks *, int); +static void newblk_freefrag(struct newblk*); static void free_newblk(struct newblk *); static void cancel_allocdirect(struct allocdirectlst *, - struct allocdirect *, struct freeblks *, int); + struct allocdirect *, struct freeblks *); static int check_inode_unwritten(struct inodedep *); static int free_inodedep(struct inodedep *); static void freework_freeblock(struct freework *); -static void handle_workitem_freeblocks(struct freeblks *, int); -static void handle_complete_freeblocks(struct freeblks *); +static void freework_enqueue(struct freework *); +static int handle_workitem_freeblocks(struct freeblks *, int); +static int handle_complete_freeblocks(struct freeblks *, int); static void handle_workitem_indirblk(struct freework *); -static void handle_written_freework(struct freework *); +static void handle_written_freework(struct freework *, int); static void merge_inode_lists(struct allocdirectlst *,struct allocdirectlst *); static struct worklist *jnewblk_merge(struct worklist *, struct worklist *, struct workhead *); -static void setup_allocindir_phase2(struct buf *, struct inode *, +static struct freefrag *setup_allocindir_phase2(struct buf *, struct inode *, struct inodedep *, struct allocindir *, ufs_lbn_t); static struct allocindir *newallocindir(struct inode *, int, ufs2_daddr_t, ufs2_daddr_t, ufs_lbn_t); @@ -862,16 +888,20 @@ static int newblk_lookup(struct mount *, ufs2_dadd static int inodedep_find(struct inodedep_hashhead *, struct fs *, ino_t, struct inodedep **); static int inodedep_lookup(struct mount *, ino_t, int, struct inodedep **); -static int pagedep_lookup(struct mount *, ino_t, ufs_lbn_t, int, - struct pagedep **); +static int pagedep_lookup(struct mount *, struct buf *bp, ino_t, ufs_lbn_t, + int, struct pagedep **); static int pagedep_find(struct pagedep_hashhead *, ino_t, ufs_lbn_t, struct mount *mp, int, struct pagedep **); static void pause_timer(void *); static int request_cleanup(struct mount *, int); -static int process_worklist_item(struct mount *, int); +static int process_worklist_item(struct mount *, int, int); static void process_removes(struct vnode *); +static void process_truncates(struct vnode *); static void jwork_move(struct workhead *, struct workhead *); +static void jwork_insert(struct workhead *, struct jsegdep *); static void add_to_worklist(struct worklist *, int); +static void wake_worklist(struct worklist *); +static void wait_worklist(struct worklist *, char *); static void remove_from_worklist(struct worklist *); static void softdep_flush(void); static int softdep_speedup(void); @@ -889,17 +919,20 @@ static struct jremref *newjremref(struct dirrem *, struct inode *ip, off_t, nlink_t); static struct jaddref *newjaddref(struct inode *, ino_t, off_t, int16_t, uint16_t); -static inline void newinoref(struct inoref *, ino_t, ino_t, off_t, nlink_t, +static inline void newinoref(struct inoref *, ino_t, ino_t, off_t, nlink_t, uint16_t); -static inline struct jsegdep *inoref_jseg(struct inoref *); +static inline struct jsegdep *inoref_jseg(struct inoref *); static struct jmvref *newjmvref(struct inode *, ino_t, off_t, off_t); static struct jfreeblk *newjfreeblk(struct freeblks *, ufs_lbn_t, ufs2_daddr_t, int); +static struct jtrunc *newjtrunc(struct freeblks *, off_t, int); +static void move_newblock_dep(struct jaddref *, struct inodedep *); +static void cancel_jfreeblk(struct freeblks *, ufs2_daddr_t); static struct jfreefrag *newjfreefrag(struct freefrag *, struct inode *, ufs2_daddr_t, long, ufs_lbn_t); static struct freework *newfreework(struct ufsmount *, struct freeblks *, - struct freework *, ufs_lbn_t, ufs2_daddr_t, int, int); -static void jwait(struct worklist *wk); + struct freework *, ufs_lbn_t, ufs2_daddr_t, int, int, int); +static int jwait(struct worklist *, int); static struct inodedep *inodedep_lookup_ip(struct inode *); static int bmsafemap_rollbacks(struct bmsafemap *); static struct freefile *handle_bufwait(struct inodedep *, struct workhead *); @@ -1064,6 +1097,30 @@ jwork_move(dst, src) } } +static void +jwork_insert(dst, jsegdep) + struct workhead *dst; + struct jsegdep *jsegdep; +{ + struct jsegdep *jsegdepn; + struct worklist *wk; + + LIST_FOREACH(wk, dst, wk_list) + if (wk->wk_type == D_JSEGDEP) + break; + if (wk == NULL) { + WORKLIST_INSERT(dst, &jsegdep->jd_list); + return; + } + jsegdepn = WK_JSEGDEP(wk); + if (jsegdep->jd_seg->js_seq < jsegdepn->jd_seg->js_seq) { + WORKLIST_REMOVE(wk); + free_jsegdep(jsegdepn); + WORKLIST_INSERT(dst, &jsegdep->jd_list); + } else + free_jsegdep(jsegdep); +} + /* * Routines for tracking and managing workitems. */ @@ -1088,6 +1145,8 @@ workitem_free(item, type) panic("workitem_free: type mismatch %s != %s", TYPENAME(item->wk_type), TYPENAME(type)); #endif + if (item->wk_state & IOWAITING) + wakeup(item); ump = VFSTOUFS(item->wk_mp); if (--ump->softdep_deps == 0 && ump->softdep_req) wakeup(&ump->softdep_deps); @@ -1101,14 +1160,18 @@ workitem_alloc(item, type, mp) int type; struct mount *mp; { + struct ufsmount *ump; + item->wk_type = type; item->wk_mp = mp; item->wk_state = 0; + + ump = VFSTOUFS(mp); ACQUIRE_LOCK(&lk); dep_current[type]++; dep_total[type]++; - VFSTOUFS(mp)->softdep_deps++; - VFSTOUFS(mp)->softdep_accdeps++; + ump->softdep_deps++; + ump->softdep_accdeps++; FREE_LOCK(&lk); } @@ -1270,8 +1333,7 @@ softdep_flush(void) vfslocked = VFS_LOCK_GIANT(mp); progress += softdep_process_worklist(mp, 0); ump = VFSTOUFS(mp); - remaining += ump->softdep_on_worklist - - ump->softdep_on_worklist_inprogress; + remaining += ump->softdep_on_worklist; VFS_UNLOCK_GIANT(vfslocked); mtx_lock(&mountlist_mtx); nmp = TAILQ_NEXT(mp, mnt_list); @@ -1314,10 +1376,14 @@ softdep_speedup(void) * The following routine is the only one that removes items * and does so in order from first to last. */ + +#define WK_HEAD 0x0001 /* Add to HEAD. */ +#define WK_NODELAY 0x0002 /* Process immediately. */ + static void -add_to_worklist(wk, nodelay) +add_to_worklist(wk, flags) struct worklist *wk; - int nodelay; + int flags; { struct ufsmount *ump; @@ -1327,13 +1393,17 @@ static void panic("add_to_worklist: %s(0x%X) already on list", TYPENAME(wk->wk_type), wk->wk_state); wk->wk_state |= ONWORKLIST; - if (LIST_EMPTY(&ump->softdep_workitem_pending)) + if (ump->softdep_on_worklist == 0) { LIST_INSERT_HEAD(&ump->softdep_workitem_pending, wk, wk_list); - else + ump->softdep_worklist_tail = wk; + } else if (flags & WK_HEAD) { + LIST_INSERT_HEAD(&ump->softdep_workitem_pending, wk, wk_list); + } else { LIST_INSERT_AFTER(ump->softdep_worklist_tail, wk, wk_list); - ump->softdep_worklist_tail = wk; + ump->softdep_worklist_tail = wk; + } ump->softdep_on_worklist += 1; - if (nodelay) + if (flags & WK_NODELAY) worklist_speedup(); } @@ -1346,19 +1416,35 @@ remove_from_worklist(wk) struct worklist *wk; { struct ufsmount *ump; - struct worklist *wkend; ump = VFSTOUFS(wk->wk_mp); WORKLIST_REMOVE(wk); - if (wk == ump->softdep_worklist_tail) { - LIST_FOREACH(wkend, &ump->softdep_workitem_pending, wk_list) - if (LIST_NEXT(wkend, wk_list) == NULL) - break; - ump->softdep_worklist_tail = wkend; - } + if (ump->softdep_worklist_tail == wk) + ump->softdep_worklist_tail = + (struct worklist *)wk->wk_list.le_prev; ump->softdep_on_worklist -= 1; } +static void +wake_worklist(wk) + struct worklist *wk; +{ + if (wk->wk_state & IOWAITING) { + wk->wk_state &= ~IOWAITING; + wakeup(wk); + } +} + +static void +wait_worklist(wk, wmesg) + struct worklist *wk; + char *wmesg; +{ + + wk->wk_state |= IOWAITING; + msleep(wk, &lk, PVM, wmesg, 0); +} + /* * Process that runs once per second to handle items in the background queue. * @@ -1389,7 +1475,7 @@ softdep_process_worklist(mp, full) starttime = time_second; softdep_process_journal(mp, NULL, full?MNT_WAIT:0); while (ump->softdep_on_worklist > 0) { - if ((cnt = process_worklist_item(mp, LK_NOWAIT)) == -1) + if ((cnt = process_worklist_item(mp, 10, LK_NOWAIT)) == 0) break; else matchcnt += cnt; @@ -1449,46 +1535,122 @@ process_removes(vp) mp = vp->v_mount; inum = VTOI(vp)->i_number; for (;;) { +top: if (inodedep_lookup(mp, inum, 0, &inodedep) == 0) return; - LIST_FOREACH(dirrem, &inodedep->id_dirremhd, dm_inonext) - if ((dirrem->dm_state & (COMPLETE | ONWORKLIST)) == + LIST_FOREACH(dirrem, &inodedep->id_dirremhd, dm_inonext) { + /* + * If another thread is trying to lock this vnode + * it will fail but we must wait for it to do so + * before we can proceed. + */ + if (dirrem->dm_state & INPROGRESS) { + wait_worklist(&dirrem->dm_list, "pwrwait"); + goto top; + } + if ((dirrem->dm_state & (COMPLETE | ONWORKLIST)) == (COMPLETE | ONWORKLIST)) break; + } if (dirrem == NULL) return; - /* - * If another thread is trying to lock this vnode it will - * fail but we must wait for it to do so before we can - * proceed. - */ - if (dirrem->dm_state & INPROGRESS) { - dirrem->dm_state |= IOWAITING; - msleep(&dirrem->dm_list, &lk, PVM, "pwrwait", 0); - continue; - } remove_from_worklist(&dirrem->dm_list); FREE_LOCK(&lk); if (vn_start_secondary_write(NULL, &mp, V_NOWAIT)) panic("process_removes: suspended filesystem"); - handle_workitem_remove(dirrem, vp); + handle_workitem_remove(dirrem, 0); vn_finished_secondary_write(mp); ACQUIRE_LOCK(&lk); } } /* + * Process all truncations associated with a vnode if we are running out + * of journal space. This is called when the vnode lock is already held + * and no other process can clear the truncation. This function returns + * a value greater than zero if it did any work. + */ +static void +process_truncates(vp) + struct vnode *vp; +{ + struct inodedep *inodedep; + struct freeblks *freeblks; + struct mount *mp; + ino_t inum; + int cgwait; + + mtx_assert(&lk, MA_OWNED); + + mp = vp->v_mount; + inum = VTOI(vp)->i_number; + for (;;) { + if (inodedep_lookup(mp, inum, 0, &inodedep) == 0) + return; + cgwait = 0; + TAILQ_FOREACH(freeblks, &inodedep->id_freeblklst, fb_next) { + /* Journal entries not yet written. */ + if (!LIST_EMPTY(&freeblks->fb_jblkdephd)) { + jwait(&LIST_FIRST( + &freeblks->fb_jblkdephd)->jb_list, + MNT_WAIT); + break; + } + /* Another thread is executing this item. */ + if (freeblks->fb_state & INPROGRESS) { + wait_worklist(&freeblks->fb_list, "ptrwait"); + break; + } + /* Freeblks is waiting on a inode write. */ + if ((freeblks->fb_state & COMPLETE) == 0) { + FREE_LOCK(&lk); + ffs_update(vp, 1); + ACQUIRE_LOCK(&lk); + break; + } + if ((freeblks->fb_state & (ALLCOMPLETE | ONWORKLIST)) == + (ALLCOMPLETE | ONWORKLIST)) { + remove_from_worklist(&freeblks->fb_list); + freeblks->fb_state |= INPROGRESS; + FREE_LOCK(&lk); + if (vn_start_secondary_write(NULL, &mp, + V_NOWAIT)) + panic("process_truncates: " + "suspended filesystem"); + handle_workitem_freeblocks(freeblks, 0); + vn_finished_secondary_write(mp); + ACQUIRE_LOCK(&lk); + break; + } + if (freeblks->fb_cgwait) + cgwait++; + } + if (cgwait) { + FREE_LOCK(&lk); + sync_cgs(mp, MNT_WAIT); + ACQUIRE_LOCK(&lk); + continue; + } + if (freeblks == NULL) + break; + } + return; +} + +/* * Process one item on the worklist. */ static int -process_worklist_item(mp, flags) +process_worklist_item(mp, target, flags) struct mount *mp; + int target; int flags; { + struct worklist sintenel; struct worklist *wk; struct ufsmount *ump; - struct vnode *vp; - int matchcnt = 0; + int matchcnt; + int error; mtx_assert(&lk, MA_OWNED); KASSERT(mp != NULL, ("process_worklist_item: NULL mp")); @@ -1499,77 +1661,79 @@ static int */ if (curthread->td_pflags & TDP_COWINPROGRESS) return (-1); - /* - * Normally we just process each item on the worklist in order. - * However, if we are in a situation where we cannot lock any - * inodes, we have to skip over any dirrem requests whose - * vnodes are resident and locked. - */ - vp = NULL; + PHOLD(curproc); /* Don't let the stack go away. */ ump = VFSTOUFS(mp); - LIST_FOREACH(wk, &ump->softdep_workitem_pending, wk_list) { + matchcnt = 0; + sintenel.wk_mp = NULL; + sintenel.wk_type = D_SENTINAL; + LIST_INSERT_HEAD(&ump->softdep_workitem_pending, &sintenel, wk_list); + for (wk = LIST_NEXT(&sintenel, wk_list); wk != NULL; + wk = LIST_NEXT(&sintenel, wk_list)) { + if (wk->wk_type == D_SENTINAL) { + LIST_REMOVE(&sintenel, wk_list); + LIST_INSERT_AFTER(wk, &sintenel, wk_list); + continue; + } if (wk->wk_state & INPROGRESS) - continue; - if ((flags & LK_NOWAIT) == 0 || wk->wk_type != D_DIRREM) - break; + panic("process_worklist_item: %p already in progress.", + wk); wk->wk_state |= INPROGRESS; - ump->softdep_on_worklist_inprogress++; + remove_from_worklist(wk); FREE_LOCK(&lk); - ffs_vgetf(mp, WK_DIRREM(wk)->dm_oldinum, - LK_NOWAIT | LK_EXCLUSIVE, &vp, FFSV_FORCEINSMQ); - ACQUIRE_LOCK(&lk); - if (wk->wk_state & IOWAITING) { - wk->wk_state &= ~IOWAITING; - wakeup(wk); - } - wk->wk_state &= ~INPROGRESS; - ump->softdep_on_worklist_inprogress--; - if (vp != NULL) + if (vn_start_secondary_write(NULL, &mp, V_NOWAIT)) + panic("process_worklist_item: suspended filesystem"); + switch (wk->wk_type) { + case D_DIRREM: + /* removal of a directory entry */ + error = handle_workitem_remove(WK_DIRREM(wk), flags); break; - } - if (wk == 0) - return (-1); - remove_from_worklist(wk); - FREE_LOCK(&lk); - if (vn_start_secondary_write(NULL, &mp, V_NOWAIT)) - panic("process_worklist_item: suspended filesystem"); - matchcnt++; - switch (wk->wk_type) { - case D_DIRREM: - /* removal of a directory entry */ - handle_workitem_remove(WK_DIRREM(wk), vp); - if (vp) - vput(vp); - break; + case D_FREEBLKS: + /* releasing blocks and/or fragments from a file */ + error = handle_workitem_freeblocks(WK_FREEBLKS(wk), + flags); + break; - case D_FREEBLKS: - /* releasing blocks and/or fragments from a file */ - handle_workitem_freeblocks(WK_FREEBLKS(wk), flags & LK_NOWAIT); - break; + case D_FREEFRAG: + /* releasing a fragment when replaced as a file grows */ + handle_workitem_freefrag(WK_FREEFRAG(wk)); + error = 0; + break; - case D_FREEFRAG: - /* releasing a fragment when replaced as a file grows */ - handle_workitem_freefrag(WK_FREEFRAG(wk)); - break; + case D_FREEFILE: + /* releasing an inode when its link count drops to 0 */ + handle_workitem_freefile(WK_FREEFILE(wk)); + error = 0; + break; - case D_FREEFILE: - /* releasing an inode when its link count drops to 0 */ - handle_workitem_freefile(WK_FREEFILE(wk)); - break; - - case D_FREEWORK: - /* Final block in an indirect was freed. */ - handle_workitem_indirblk(WK_FREEWORK(wk)); - break; - - default: - panic("%s_process_worklist: Unknown type %s", - "softdep", TYPENAME(wk->wk_type)); - /* NOTREACHED */ + default: + panic("%s_process_worklist: Unknown type %s", + "softdep", TYPENAME(wk->wk_type)); + /* NOTREACHED */ + } + vn_finished_secondary_write(mp); + ACQUIRE_LOCK(&lk); + if (error == 0) { + if (++matchcnt == target) + break; + continue; + } + /* + * We have to retry the worklist item later. Wake up any + * waiters who may be able to complete it immediately and + * add the item back to the head so we don't try to execute + * it again. + */ + wk->wk_state &= ~INPROGRESS; + wake_worklist(wk); + add_to_worklist(wk, WK_HEAD); } - vn_finished_secondary_write(mp); - ACQUIRE_LOCK(&lk); + LIST_REMOVE(&sintenel, wk_list); + /* Sentinal could've become the tail from remove_from_worklist. */ + if (ump->softdep_worklist_tail == &sintenel) + ump->softdep_worklist_tail = + (struct worklist *)sintenel.wk_list.le_prev; + PRELE(curproc); return (matchcnt); } @@ -1774,31 +1938,26 @@ pagedep_find(pagedephd, ino, lbn, mp, flags, paged { struct pagedep *pagedep; - LIST_FOREACH(pagedep, pagedephd, pd_hash) - if (ino == pagedep->pd_ino && - lbn == pagedep->pd_lbn && - mp == pagedep->pd_list.wk_mp) - break; - if (pagedep) { - *pagedeppp = pagedep; - if ((flags & DEPALLOC) != 0 && - (pagedep->pd_state & ONWORKLIST) == 0) - return (0); - return (1); + LIST_FOREACH(pagedep, pagedephd, pd_hash) { + if (ino == pagedep->pd_ino && lbn == pagedep->pd_lbn && + mp == pagedep->pd_list.wk_mp) { + *pagedeppp = pagedep; + return (1); + } } *pagedeppp = NULL; return (0); } /* - * Look up a pagedep. Return 1 if found, 0 if not found or found - * when asked to allocate but not associated with any buffer. + * Look up a pagedep. Return 1 if found, 0 otherwise. * If not found, allocate if DEPALLOC flag is passed. * Found or allocated entry is returned in pagedeppp. * This routine must be called with splbio interrupts blocked. */ static int -pagedep_lookup(mp, ino, lbn, flags, pagedeppp) +pagedep_lookup(mp, bp, ino, lbn, flags, pagedeppp) struct mount *mp; + struct buf *bp; ino_t ino; ufs_lbn_t lbn; int flags; @@ -1806,15 +1965,28 @@ static int { struct pagedep *pagedep; struct pagedep_hashhead *pagedephd; + struct worklist *wk; int ret; int i; mtx_assert(&lk, MA_OWNED); + if (bp) { + LIST_FOREACH(wk, &bp->b_dep, wk_list) { + if (wk->wk_type == D_PAGEDEP) { + *pagedeppp = WK_PAGEDEP(wk); + return (1); + } + } + } pagedephd = PAGEDEP_HASH(mp, ino, lbn); - ret = pagedep_find(pagedephd, ino, lbn, mp, flags, pagedeppp); - if (*pagedeppp || (flags & DEPALLOC) == 0) - return (ret); + if (ret) { + if (((*pagedeppp)->pd_state & ONWORKLIST) == 0 && bp) + WORKLIST_INSERT(&bp->b_dep, &(*pagedeppp)->pd_list); + return (1); + } + if ((flags & DEPALLOC) == 0) + return (0); FREE_LOCK(&lk); pagedep = malloc(sizeof(struct pagedep), M_PAGEDEP, M_SOFTDEP_FLAGS|M_ZERO); @@ -1822,6 +1994,10 @@ static int ACQUIRE_LOCK(&lk); ret = pagedep_find(pagedephd, ino, lbn, mp, flags, pagedeppp); if (*pagedeppp) { + /* + * This should never happen since we only create pagedeps + * with the vnode lock held. Could be an assert. + */ WORKITEM_FREE(pagedep, D_PAGEDEP); return (ret); } @@ -1832,6 +2008,7 @@ static int for (i = 0; i < DAHASHSZ; i++) LIST_INIT(&pagedep->pd_diraddhd[i]); LIST_INSERT_HEAD(pagedephd, pagedep, pd_hash); + WORKLIST_INSERT(&bp->b_dep, &pagedep->pd_list); *pagedeppp = pagedep; return (0); } @@ -1922,6 +2099,7 @@ inodedep_lookup(mp, inum, flags, inodedeppp) TAILQ_INIT(&inodedep->id_newinoupdt); TAILQ_INIT(&inodedep->id_extupdt); TAILQ_INIT(&inodedep->id_newextupdt); + TAILQ_INIT(&inodedep->id_freeblklst); LIST_INSERT_HEAD(inodedephd, inodedep, id_hash); *inodedeppp = inodedep; return (0); @@ -2008,43 +2186,86 @@ newblk_lookup(mp, newblkno, flags, newblkpp) } /* - * Structures and routines associated with indir caching. + * Structures and routines associated with freed indirect block caching. */ -struct workhead *indir_hashtbl; +struct freeworklst *indir_hashtbl; u_long indir_hash; /* size of hash table - 1 */ #define INDIR_HASH(mp, blkno) \ (&indir_hashtbl[((((register_t)(mp)) >> 13) + (blkno)) & indir_hash]) +/* + * Lookup an indirect block in the indir hash table. The freework is + * removed and potentially freed. The caller must do a blocking journal + * write before writing to the blkno. + */ static int -indirblk_inseg(mp, blkno) +indirblk_lookup(mp, blkno) struct mount *mp; ufs2_daddr_t blkno; { struct freework *freework; - struct workhead *wkhd; - struct worklist *wk; + struct freeworklst *wkhd; wkhd = INDIR_HASH(mp, blkno); - LIST_FOREACH(wk, wkhd, wk_list) { - freework = WK_FREEWORK(wk); - if (freework->fw_blkno == blkno && - freework->fw_list.wk_mp == mp) { - LIST_REMOVE(freework, fw_next); - WORKLIST_REMOVE(&freework->fw_list); - WORKITEM_FREE(freework, D_FREEWORK); - return (1); - } + TAILQ_FOREACH(freework, wkhd, fw_next) { + if (freework->fw_blkno != blkno) + continue; + if (freework->fw_list.wk_mp != mp) + continue; + indirblk_remove(freework); + return (1); } return (0); } /* + * Insert an indirect block represented by freework into the indirblk + * hash table so that it may prevent the block from being re-used prior + * to the journal being written. + */ +static void +indirblk_insert(freework) + struct freework *freework; +{ + struct freeblks *freeblks; + struct jsegdep *jsegdep; + struct worklist *wk; + + freeblks = freework->fw_freeblks; + LIST_FOREACH(wk, &freeblks->fb_jwork, wk_list) + if (wk->wk_type == D_JSEGDEP) + break; + if (wk == NULL) + return; + + jsegdep = WK_JSEGDEP(wk); + LIST_INSERT_HEAD(&jsegdep->jd_seg->js_indirs, freework, fw_segs); + TAILQ_INSERT_HEAD(INDIR_HASH(freework->fw_list.wk_mp, + freework->fw_blkno), freework, fw_next); + freework->fw_state &= ~DEPCOMPLETE; +} + +static void +indirblk_remove(freework) + struct freework *freework; +{ + + LIST_REMOVE(freework, fw_segs); + TAILQ_REMOVE(INDIR_HASH(freework->fw_list.wk_mp, + freework->fw_blkno), freework, fw_next); + freework->fw_state |= DEPCOMPLETE; + if ((freework->fw_state & ALLCOMPLETE) == ALLCOMPLETE) + WORKITEM_FREE(freework, D_FREEWORK); +} + +/* * Executed during filesystem system initialization before * mounting any filesystems. */ void softdep_initialize() { + int i; LIST_INIT(&mkdirlisthd); max_softdeps = desiredvnodes * 4; @@ -2052,7 +2273,12 @@ softdep_initialize() inodedep_hashtbl = hashinit(desiredvnodes, M_INODEDEP, &inodedep_hash); newblk_hashtbl = hashinit(desiredvnodes / 5, M_NEWBLK, &newblk_hash); bmsafemap_hashtbl = hashinit(1024, M_BMSAFEMAP, &bmsafemap_hash); - indir_hashtbl = hashinit(desiredvnodes / 10, M_FREEWORK, &indir_hash); + i = 1 << (ffs(desiredvnodes / 10) - 1); + indir_hashtbl = malloc(i * sizeof(indir_hashtbl[0]), M_FREEWORK, + M_WAITOK); + indir_hash = i - 1; + for (i = 0; i <= indir_hash; i++) + TAILQ_INIT(&indir_hashtbl[i]); /* initialise bioops hack */ bioops.io_start = softdep_disk_io_initiation; @@ -2077,6 +2303,7 @@ softdep_uninitialize() hashdestroy(inodedep_hashtbl, M_INODEDEP, inodedep_hash); hashdestroy(newblk_hashtbl, M_NEWBLK, newblk_hash); hashdestroy(bmsafemap_hashtbl, M_BMSAFEMAP, bmsafemap_hash); + free(indir_hashtbl, M_FREEWORK); } /* @@ -2108,6 +2335,7 @@ softdep_mount(devvp, mp, fs, cred) LIST_INIT(&ump->softdep_workitem_pending); LIST_INIT(&ump->softdep_journal_pending); TAILQ_INIT(&ump->softdep_unlinked); + LIST_INIT(&ump->softdep_dirtycg); ump->softdep_worklist_tail = NULL; ump->softdep_on_worklist = 0; ump->softdep_deps = 0; @@ -2570,6 +2798,7 @@ softdep_prealloc(vp, waitok) ffs_syncvnode(vp, waitok); ACQUIRE_LOCK(&lk); process_removes(vp); + process_truncates(vp); if (journal_space(ump, 0) == 0) { softdep_speedup(); if (journal_space(ump, 1) == 0) @@ -2604,12 +2833,14 @@ softdep_prelink(dvp, vp) ffs_syncvnode(dvp, MNT_WAIT); ACQUIRE_LOCK(&lk); /* Process vp before dvp as it may create .. removes. */ - if (vp) + if (vp) { process_removes(vp); + process_truncates(vp); + } process_removes(dvp); + process_truncates(dvp); softdep_speedup(); - process_worklist_item(UFSTOVFS(ump), LK_NOWAIT); - process_worklist_item(UFSTOVFS(ump), LK_NOWAIT); + process_worklist_item(UFSTOVFS(ump), 2, LK_NOWAIT); if (journal_space(ump, 0) == 0) { softdep_speedup(); if (journal_space(ump, 1) == 0) @@ -2717,7 +2948,7 @@ jfreeblk_write(jfreeblk, jseg, data) { struct jblkrec *rec; - jfreeblk->jf_jsegdep->jd_seg = jseg; + jfreeblk->jf_dep.jb_jsegdep->jd_seg = jseg; rec = (struct jblkrec *)data; rec->jb_op = JOP_FREEBLK; rec->jb_ino = jfreeblk->jf_ino; @@ -2753,6 +2984,7 @@ jtrunc_write(jtrunc, jseg, data) { struct jtrncrec *rec; + jtrunc->jt_dep.jb_jsegdep->jd_seg = jseg; rec = (struct jtrncrec *)data; rec->jt_op = JOP_TRUNC; rec->jt_ino = jtrunc->jt_ino; @@ -2760,6 +2992,21 @@ jtrunc_write(jtrunc, jseg, data) rec->jt_extsize = jtrunc->jt_extsize; } +static void +jfsync_write(jfsync, jseg, data) + struct jfsync *jfsync; + struct jseg *jseg; + uint8_t *data; +{ + struct jtrncrec *rec; + + rec = (struct jtrncrec *)data; + rec->jt_op = JOP_SYNC; + rec->jt_ino = jfsync->jfs_ino; + rec->jt_size = jfsync->jfs_size; + rec->jt_extsize = jfsync->jfs_extsize; +} + /* * Flush some journal records to disk. */ @@ -2909,7 +3156,7 @@ softdep_process_journal(mp, needwk, flags) if (wk == needwk) needwk = NULL; remove_from_journal(wk); - wk->wk_state |= IOSTARTED; + wk->wk_state |= INPROGRESS; WORKLIST_INSERT(&jseg->js_entries, wk); switch (wk->wk_type) { case D_JADDREF: @@ -2933,6 +3180,9 @@ softdep_process_journal(mp, needwk, flags) case D_JTRUNC: jtrunc_write(WK_JTRUNC(wk), jseg, data); break; + case D_JFSYNC: + jfsync_write(WK_JFSYNC(wk), jseg, data); + break; default: panic("process_journal: Unknown type %s", TYPENAME(wk->wk_type)); @@ -2956,7 +3206,7 @@ softdep_process_journal(mp, needwk, flags) * We only do the blocking wait once we find the journal * entry we're looking for. */ - if (needwk == NULL && flags & MNT_WAIT) + if (needwk == NULL && flags == MNT_WAIT) bwrite(bp); else bawrite(bp); @@ -2996,7 +3246,7 @@ complete_jseg(jseg) while ((wk = LIST_FIRST(&jseg->js_entries)) != NULL) { WORKLIST_REMOVE(wk); waiting = wk->wk_state & IOWAITING; - wk->wk_state &= ~(IOSTARTED | IOWAITING); + wk->wk_state &= ~(INPROGRESS | IOWAITING); wk->wk_state |= COMPLETE; KASSERT(i++ < jseg->js_cnt, ("handle_written_jseg: overflow %d >= %d", @@ -3009,26 +3259,29 @@ complete_jseg(jseg) handle_written_jremref(WK_JREMREF(wk)); break; case D_JMVREF: - /* No jsegdep here. */ - rele_jseg(jseg); + rele_jseg(jseg); /* No jsegdep. */ jmvref = WK_JMVREF(wk); LIST_REMOVE(jmvref, jm_deps); - free_pagedep(jmvref->jm_pagedep); + if ((jmvref->jm_pagedep->pd_state & ONWORKLIST) == 0) + free_pagedep(jmvref->jm_pagedep); WORKITEM_FREE(jmvref, D_JMVREF); break; case D_JNEWBLK: handle_written_jnewblk(WK_JNEWBLK(wk)); break; case D_JFREEBLK: - handle_written_jfreeblk(WK_JFREEBLK(wk)); + handle_written_jblkdep(&WK_JFREEBLK(wk)->jf_dep); break; + case D_JTRUNC: + handle_written_jblkdep(&WK_JTRUNC(wk)->jt_dep); + break; + case D_JFSYNC: + rele_jseg(jseg); /* No jsegdep. */ + WORKITEM_FREE(wk, D_JFSYNC); + break; case D_JFREEFRAG: handle_written_jfreefrag(WK_JFREEFRAG(wk)); break; - case D_JTRUNC: - WK_JTRUNC(wk)->jt_jsegdep->jd_seg = jseg; - WORKITEM_FREE(wk, D_JTRUNC); - break; default: panic("handle_written_jseg: Unknown type %s", TYPENAME(wk->wk_type)); @@ -3123,7 +3376,7 @@ handle_written_jremref(jremref) jremref->jr_dirrem = NULL; LIST_REMOVE(jremref, jr_deps); jsegdep->jd_state |= jremref->jr_state & MKDIR_PARENT; - WORKLIST_INSERT(&dirrem->dm_jwork, &jsegdep->jd_list); + jwork_insert(&dirrem->dm_jwork, jsegdep); if (LIST_EMPTY(&dirrem->dm_jremrefhd) && (dirrem->dm_state & COMPLETE) != 0) add_to_worklist(&dirrem->dm_list, 0); @@ -3183,7 +3436,7 @@ handle_written_jaddref(jaddref) mkdir->md_state |= DEPCOMPLETE; complete_mkdir(mkdir); } - WORKLIST_INSERT(&diradd->da_jwork, &jsegdep->jd_list); + jwork_insert(&diradd->da_jwork, jsegdep); if (jaddref->ja_state & NEWBLOCK) { inodedep->id_state |= ONDEPLIST; LIST_INSERT_HEAD(&inodedep->id_bmsafemap->sm_inodedephd, @@ -3205,10 +3458,9 @@ handle_written_jnewblk(jnewblk) { struct bmsafemap *bmsafemap; struct freefrag *freefrag; + struct freework *freework; struct jsegdep *jsegdep; struct newblk *newblk; - struct freework *freework; - struct indirdep *indirdep; /* Grab the jsegdep. */ jsegdep = jnewblk->jn_jsegdep; @@ -3225,10 +3477,13 @@ handle_written_jnewblk(jnewblk) */ newblk = WK_NEWBLK(jnewblk->jn_dep); newblk->nb_jnewblk = NULL; - bmsafemap = newblk->nb_bmsafemap; - newblk->nb_state |= ONDEPLIST; - LIST_INSERT_HEAD(&bmsafemap->sm_newblkhd, newblk, nb_deps); - WORKLIST_INSERT(&newblk->nb_jwork, &jsegdep->jd_list); + if ((newblk->nb_state & GOINGAWAY) == 0) { + bmsafemap = newblk->nb_bmsafemap; + newblk->nb_state |= ONDEPLIST; + LIST_INSERT_HEAD(&bmsafemap->sm_newblkhd, newblk, + nb_deps); + } + jwork_insert(&newblk->nb_jwork, jsegdep); break; case D_FREEFRAG: /* @@ -3245,16 +3500,9 @@ handle_written_jnewblk(jnewblk) */ freework = WK_FREEWORK(jnewblk->jn_dep); freework->fw_jnewblk = NULL; - WORKLIST_INSERT(&freework->fw_jwork, &jsegdep->jd_list); + WORKLIST_INSERT(&freework->fw_freeblks->fb_jwork, + &jsegdep->jd_list); break; - case D_INDIRDEP: - /* - * An indirect block was removed by truncate. - */ - indirdep = WK_INDIRDEP(jnewblk->jn_dep); - LIST_REMOVE(jnewblk, jn_indirdeps); - WORKLIST_INSERT(&indirdep->ir_jwork, &jsegdep->jd_list); - break; default: panic("handle_written_jnewblk: Unknown type %d.", jnewblk->jn_dep->wk_type); @@ -3293,7 +3541,7 @@ free_jfreefrag(jfreefrag) struct jfreefrag *jfreefrag; { - if (jfreefrag->fr_state & IOSTARTED) + if (jfreefrag->fr_state & INPROGRESS) WORKLIST_REMOVE(&jfreefrag->fr_list); else if (jfreefrag->fr_state & ONWORKLIST) remove_from_journal(&jfreefrag->fr_list); @@ -3321,7 +3569,7 @@ handle_written_jfreefrag(jfreefrag) panic("handle_written_jfreefrag: No freefrag."); freefrag->ff_state |= DEPCOMPLETE; freefrag->ff_jdep = NULL; - WORKLIST_INSERT(&freefrag->ff_jwork, &jsegdep->jd_list); + jwork_insert(&freefrag->ff_jwork, jsegdep); if ((freefrag->ff_state & ALLCOMPLETE) == ALLCOMPLETE) add_to_worklist(&freefrag->ff_list, 0); jfreefrag->fr_freefrag = NULL; @@ -3335,30 +3583,26 @@ handle_written_jfreefrag(jfreefrag) * have been reclaimed. */ static void -handle_written_jfreeblk(jfreeblk) - struct jfreeblk *jfreeblk; +handle_written_jblkdep(jblkdep) + struct jblkdep *jblkdep; { struct freeblks *freeblks; struct jsegdep *jsegdep; /* Grab the jsegdep. */ - jsegdep = jfreeblk->jf_jsegdep; - jfreeblk->jf_jsegdep = NULL; - freeblks = jfreeblk->jf_freeblks; - LIST_REMOVE(jfreeblk, jf_deps); + jsegdep = jblkdep->jb_jsegdep; + jblkdep->jb_jsegdep = NULL; + freeblks = jblkdep->jb_freeblks; + LIST_REMOVE(jblkdep, jb_deps); WORKLIST_INSERT(&freeblks->fb_jwork, &jsegdep->jd_list); /* * If the freeblks is all journaled, we can add it to the worklist. */ - if (LIST_EMPTY(&freeblks->fb_jfreeblkhd) && - (freeblks->fb_state & ALLCOMPLETE) == ALLCOMPLETE) { - /* Remove from the b_dep that is waiting on this write. */ - if (freeblks->fb_state & ONWORKLIST) - WORKLIST_REMOVE(&freeblks->fb_list); - add_to_worklist(&freeblks->fb_list, 1); - } + if (LIST_EMPTY(&freeblks->fb_jblkdephd) && + (freeblks->fb_state & ALLCOMPLETE) == ALLCOMPLETE) + add_to_worklist(&freeblks->fb_list, WK_NODELAY); - free_jfreeblk(jfreeblk); + free_jblkdep(jblkdep); } static struct jsegdep * @@ -3480,9 +3724,12 @@ static void free_freedep(freedep) struct freedep *freedep; { + struct freework *freework; - if (--freedep->fd_freework->fw_ref == 0) - add_to_worklist(&freedep->fd_freework->fw_list, 1); + freework = freedep->fd_freework; + freework->fw_freeblks->fb_cgwait--; + if (--freework->fw_ref == 0) + freework_enqueue(freework); WORKITEM_FREE(freedep, D_FREEDEP); } @@ -3493,42 +3740,69 @@ free_freedep(freedep) * is visible outside of softdep_setup_freeblocks(). */ static struct freework * -newfreework(ump, freeblks, parent, lbn, nb, frags, journal) +newfreework(ump, freeblks, parent, lbn, nb, frags, off, journal) struct ufsmount *ump; struct freeblks *freeblks; struct freework *parent; ufs_lbn_t lbn; ufs2_daddr_t nb; int frags; + int off; int journal; { struct freework *freework; freework = malloc(sizeof(*freework), M_FREEWORK, M_SOFTDEP_FLAGS); workitem_alloc(&freework->fw_list, D_FREEWORK, freeblks->fb_list.wk_mp); + freework->fw_state = ATTACHED; freework->fw_jnewblk = NULL; freework->fw_freeblks = freeblks; freework->fw_parent = parent; freework->fw_lbn = lbn; freework->fw_blkno = nb; freework->fw_frags = frags; + freework->fw_indir = NULL; freework->fw_ref = ((UFSTOVFS(ump)->mnt_kern_flag & MNTK_SUJ) == 0 || lbn >= -NXADDR) ? 0 : NINDIR(ump->um_fs) + 1; - freework->fw_off = 0; - LIST_INIT(&freework->fw_jwork); - + freework->fw_start = freework->fw_off = off; + if (journal) + newjfreeblk(freeblks, lbn, nb, frags); if (parent == NULL) { - WORKLIST_INSERT_UNLOCKED(&freeblks->fb_freeworkhd, - &freework->fw_list); + ACQUIRE_LOCK(&lk); + WORKLIST_INSERT(&freeblks->fb_freeworkhd, &freework->fw_list); freeblks->fb_ref++; + FREE_LOCK(&lk); } - if (journal) - newjfreeblk(freeblks, lbn, nb, frags); return (freework); } /* + * Eliminate a jfreeblk for a block that does not need journaling. + */ +static void +cancel_jfreeblk(freeblks, blkno) + struct freeblks *freeblks; + ufs2_daddr_t blkno; +{ + struct jfreeblk *jfreeblk; + struct jblkdep *jblkdep; + + LIST_FOREACH(jblkdep, &freeblks->fb_jblkdephd, jb_deps) { + if (jblkdep->jb_list.wk_type != D_JFREEBLK) + continue; + jfreeblk = WK_JFREEBLK(&jblkdep->jb_list); + if (jfreeblk->jf_blkno == blkno) + break; + } + if (jblkdep == NULL) + return; + free_jsegdep(jblkdep->jb_jsegdep); + LIST_REMOVE(jblkdep, jb_deps); + WORKITEM_FREE(jfreeblk, D_JFREEBLK); +} + +/* * Allocate a new jfreeblk to journal top level block pointer when truncating * a file. The caller must add this to the worklist when lk is held. */ @@ -3542,21 +3816,44 @@ newjfreeblk(freeblks, lbn, blkno, frags) struct jfreeblk *jfreeblk; jfreeblk = malloc(sizeof(*jfreeblk), M_JFREEBLK, M_SOFTDEP_FLAGS); - workitem_alloc(&jfreeblk->jf_list, D_JFREEBLK, freeblks->fb_list.wk_mp); - jfreeblk->jf_jsegdep = newjsegdep(&jfreeblk->jf_list); - jfreeblk->jf_state = ATTACHED | DEPCOMPLETE; - jfreeblk->jf_ino = freeblks->fb_previousinum; + workitem_alloc(&jfreeblk->jf_dep.jb_list, D_JFREEBLK, + freeblks->fb_list.wk_mp); + jfreeblk->jf_dep.jb_jsegdep = newjsegdep(&jfreeblk->jf_dep.jb_list); + jfreeblk->jf_dep.jb_freeblks = freeblks; + jfreeblk->jf_ino = freeblks->fb_inum; jfreeblk->jf_lbn = lbn; jfreeblk->jf_blkno = blkno; jfreeblk->jf_frags = frags; - jfreeblk->jf_freeblks = freeblks; - LIST_INSERT_HEAD(&freeblks->fb_jfreeblkhd, jfreeblk, jf_deps); + LIST_INSERT_HEAD(&freeblks->fb_jblkdephd, &jfreeblk->jf_dep, jb_deps); return (jfreeblk); } -static void move_newblock_dep(struct jaddref *, struct inodedep *); /* + * Allocate a new jtrunc to track a partial truncation. + */ +static struct jtrunc * +newjtrunc(freeblks, size, extsize) + struct freeblks *freeblks; + off_t size; + int extsize; +{ + struct jtrunc *jtrunc; + + jtrunc = malloc(sizeof(*jtrunc), M_JTRUNC, M_SOFTDEP_FLAGS); + workitem_alloc(&jtrunc->jt_dep.jb_list, D_JTRUNC, + freeblks->fb_list.wk_mp); + jtrunc->jt_dep.jb_jsegdep = newjsegdep(&jtrunc->jt_dep.jb_list); + jtrunc->jt_dep.jb_freeblks = freeblks; + jtrunc->jt_ino = freeblks->fb_inum; + jtrunc->jt_size = size; + jtrunc->jt_extsize = extsize; + LIST_INSERT_HEAD(&freeblks->fb_jblkdephd, &jtrunc->jt_dep, jb_deps); + + return (jtrunc); +} + +/* * If we're canceling a new bitmap we have to search for another ref * to move into the bmsafemap dep. This might be better expressed * with another structure. @@ -3613,7 +3910,7 @@ cancel_jaddref(jaddref, inodedep, wkhd) KASSERT((jaddref->ja_state & COMPLETE) == 0, ("cancel_jaddref: Canceling complete jaddref")); - if (jaddref->ja_state & (IOSTARTED | COMPLETE)) + if (jaddref->ja_state & (INPROGRESS | COMPLETE)) needsj = 1; else needsj = 0; @@ -3637,15 +3934,12 @@ cancel_jaddref(jaddref, inodedep, wkhd) jsegdep = inoref_jseg(&jaddref->ja_ref); if (jaddref->ja_state & NEWBLOCK) move_newblock_dep(jaddref, inodedep); - if (jaddref->ja_state & IOWAITING) { - jaddref->ja_state &= ~IOWAITING; - wakeup(&jaddref->ja_list); - } + wake_worklist(&jaddref->ja_list); jaddref->ja_mkdir = NULL; - if (jaddref->ja_state & IOSTARTED) { - jaddref->ja_state &= ~IOSTARTED; + if (jaddref->ja_state & INPROGRESS) { + jaddref->ja_state &= ~INPROGRESS; WORKLIST_REMOVE(&jaddref->ja_list); - WORKLIST_INSERT(wkhd, &jsegdep->jd_list); + jwork_insert(wkhd, jsegdep); } else { free_jsegdep(jsegdep); if (jaddref->ja_state & DEPCOMPLETE) @@ -3694,7 +3988,7 @@ free_jaddref(jaddref) jaddref, jaddref->ja_state); if (jaddref->ja_state & NEWBLOCK) LIST_REMOVE(jaddref, ja_bmdeps); - if (jaddref->ja_state & (IOSTARTED | ONWORKLIST)) + if (jaddref->ja_state & (INPROGRESS | ONWORKLIST)) panic("free_jaddref: Bad state %p(0x%X)", jaddref, jaddref->ja_state); if (jaddref->ja_mkdir != NULL) @@ -3712,7 +4006,7 @@ free_jremref(jremref) if (jremref->jr_ref.if_jsegdep) free_jsegdep(jremref->jr_ref.if_jsegdep); - if (jremref->jr_state & IOSTARTED) + if (jremref->jr_state & INPROGRESS) panic("free_jremref: IO still pending"); WORKITEM_FREE(jremref, D_JREMREF); } @@ -3734,11 +4028,7 @@ free_jnewblk(jnewblk) } /* - * Cancel a jnewblk which has been superseded by a freeblk. The jnewblk - * is kept linked into the bmsafemap until the free completes, thus - * preventing the modified state from ever reaching disk. The free - * routine must pass this structure via ffs_blkfree() to - * softdep_setup_freeblks() so there is no race in releasing the space. + * Cancel a jnewblk which has been been made redundant by frag extension. */ static void cancel_jnewblk(jnewblk, wkhd) @@ -3753,27 +4043,30 @@ cancel_jnewblk(jnewblk, wkhd) jnewblk->jn_jsegdep = NULL; jnewblk->jn_dep = NULL; jnewblk->jn_state |= GOINGAWAY; - if (jnewblk->jn_state & IOSTARTED) { - jnewblk->jn_state &= ~IOSTARTED; + if (jnewblk->jn_state & INPROGRESS) { + jnewblk->jn_state &= ~INPROGRESS; WORKLIST_REMOVE(&jnewblk->jn_list); - WORKLIST_INSERT(wkhd, &jsegdep->jd_list); + jwork_insert(wkhd, jsegdep); } else { free_jsegdep(jsegdep); remove_from_journal(&jnewblk->jn_list); } - if (jnewblk->jn_state & IOWAITING) { - jnewblk->jn_state &= ~IOWAITING; - wakeup(&jnewblk->jn_list); - } + wake_worklist(&jnewblk->jn_list); WORKLIST_INSERT(wkhd, &jnewblk->jn_list); } static void -free_jfreeblk(jfreeblk) - struct jfreeblk *jfreeblk; +free_jblkdep(jblkdep) + struct jblkdep *jblkdep; { - WORKITEM_FREE(jfreeblk, D_JFREEBLK); + if (jblkdep->jb_list.wk_type == D_JFREEBLK) + WORKITEM_FREE(jblkdep, D_JFREEBLK); + else if (jblkdep->jb_list.wk_type == D_JTRUNC) + WORKITEM_FREE(jblkdep, D_JTRUNC); + else + panic("free_jblkdep: Unexpected type %s", + TYPENAME(jblkdep->jb_list.wk_type)); } /* @@ -3792,11 +4085,8 @@ free_jseg(jseg, jblocks) * Free freework structures that were lingering to indicate freed * indirect blocks that forced journal write ordering on reallocate. */ - while ((freework = LIST_FIRST(&jseg->js_indirs)) != NULL) { - LIST_REMOVE(freework, fw_next); - WORKLIST_REMOVE(&freework->fw_list); - WORKITEM_FREE(freework, D_FREEWORK); - } + while ((freework = LIST_FIRST(&jseg->js_indirs)) != NULL) + indirblk_remove(freework); if (jblocks->jb_oldestseg == jseg) jblocks->jb_oldestseg = TAILQ_NEXT(jseg, js_next); TAILQ_REMOVE(&jblocks->jb_segs, jseg, js_next); @@ -3887,24 +4177,53 @@ free_jsegdep(jsegdep) * Wait for a journal item to make it to disk. Initiate journal processing * if required. */ -static void -jwait(wk) +static int +jwait(wk, waitfor) struct worklist *wk; + int waitfor; { - stat_journal_wait++; /* + * Blocking journal waits cause slow synchronous behavior. Record + * stats on the frequency of these blocking operations. + */ + if (waitfor == MNT_WAIT) { + stat_journal_wait++; + switch (wk->wk_type) { + case D_JREMREF: + case D_JMVREF: + stat_jwait_filepage++; + break; + case D_JTRUNC: + case D_JFREEBLK: + stat_jwait_freeblks++; + break; + case D_JNEWBLK: + stat_jwait_newblk++; + break; + case D_JADDREF: + stat_jwait_inode++; + break; + default: + break; + } + } + /* * If IO has not started we process the journal. We can't mark the * worklist item as IOWAITING because we drop the lock while * processing the journal and the worklist entry may be freed after * this point. The caller may call back in and re-issue the request. */ - if ((wk->wk_state & IOSTARTED) == 0) { - softdep_process_journal(wk->wk_mp, wk, MNT_WAIT); - return; + if ((wk->wk_state & INPROGRESS) == 0) { + softdep_process_journal(wk->wk_mp, wk, waitfor); + if (waitfor != MNT_WAIT) + return (EBUSY); + return (0); } - wk->wk_state |= IOWAITING; - msleep(wk, &lk, PRIBIO, "jwait", 0); + if (waitfor != MNT_WAIT) + return (EBUSY); + wait_worklist(wk, "jwait"); + return (0); } /* @@ -3928,68 +4247,6 @@ inodedep_lookup_ip(ip) } /* - * Create a journal entry that describes a truncate that we're about to - * perform. The inode allocations and frees between here and the completion - * of the operation are done asynchronously and without journaling. At - * the end of the operation the vnode is sync'd and the journal space - * is released. Recovery will discover the partially completed truncate - * and complete it. - */ -void * -softdep_setup_trunc(vp, length, flags) - struct vnode *vp; - off_t length; - int flags; -{ - struct jsegdep *jsegdep; - struct jtrunc *jtrunc; - struct ufsmount *ump; - struct inode *ip; - - softdep_prealloc(vp, MNT_WAIT); - ip = VTOI(vp); - ump = VFSTOUFS(vp->v_mount); - jtrunc = malloc(sizeof(*jtrunc), M_JTRUNC, M_SOFTDEP_FLAGS); - workitem_alloc(&jtrunc->jt_list, D_JTRUNC, vp->v_mount); - jsegdep = jtrunc->jt_jsegdep = newjsegdep(&jtrunc->jt_list); - jtrunc->jt_ino = ip->i_number; - jtrunc->jt_extsize = 0; - jtrunc->jt_size = length; - if ((flags & IO_EXT) == 0 && ump->um_fstype == UFS2) - jtrunc->jt_extsize = ip->i_din2->di_extsize; - if ((flags & IO_NORMAL) == 0) - jtrunc->jt_size = DIP(ip, i_size); - ACQUIRE_LOCK(&lk); - add_to_journal(&jtrunc->jt_list); - while (jsegdep->jd_seg == NULL) { - stat_jwait_freeblks++; - jwait(&jtrunc->jt_list); - } - FREE_LOCK(&lk); - - return (jsegdep); -} - -/* - * After synchronous truncation is complete we free sync the vnode and - * release the jsegdep so the journal space can be freed. - */ -int -softdep_complete_trunc(vp, cookie) - struct vnode *vp; - void *cookie; -{ - int error; - - error = ffs_syncvnode(vp, MNT_WAIT); - ACQUIRE_LOCK(&lk); - free_jsegdep((struct jsegdep *)cookie); - FREE_LOCK(&lk); - - return (error); -} - -/* * Called prior to creating a new inode and linking it to a directory. The * jaddref structure must already be allocated by softdep_setup_inomapdep * and it is discovered here so we can initialize the mode and update @@ -4523,6 +4780,8 @@ bmsafemap_lookup(mp, bp, cg) LIST_INIT(&bmsafemap->sm_newblkwr); LIST_INIT(&bmsafemap->sm_jaddrefhd); LIST_INIT(&bmsafemap->sm_jnewblkhd); + LIST_INIT(&bmsafemap->sm_freehd); + LIST_INIT(&bmsafemap->sm_freewr); ACQUIRE_LOCK(&lk); if (bmsafemap_find(bmsafemaphd, mp, cg, &collision) == 1) { WORKITEM_FREE(bmsafemap, D_BMSAFEMAP); @@ -4530,6 +4789,7 @@ bmsafemap_lookup(mp, bp, cg) } bmsafemap->sm_cg = cg; LIST_INSERT_HEAD(bmsafemaphd, bmsafemap, sm_hash); + LIST_INSERT_HEAD(&VFSTOUFS(mp)->softdep_dirtycg, bmsafemap, sm_next); WORKLIST_INSERT(&bp->b_dep, &bmsafemap->sm_list); return (bmsafemap); } @@ -4609,10 +4869,9 @@ softdep_setup_allocdirect(ip, off, newblkno, oldbl * allocate an associated pagedep to track additions and * deletions. */ - if ((ip->i_mode & IFMT) == IFDIR && - pagedep_lookup(mp, ip->i_number, off, DEPALLOC, - &pagedep) == 0) - WORKLIST_INSERT(&bp->b_dep, &pagedep->pd_list); + if ((ip->i_mode & IFMT) == IFDIR) + pagedep_lookup(mp, bp, ip->i_number, off, DEPALLOC, + &pagedep); } if (newblk_lookup(mp, newblkno, 0, &newblk) == 0) panic("softdep_setup_allocdirect: lost block"); @@ -4751,7 +5010,6 @@ allocdirect_merge(adphead, newadp, oldadp) { struct worklist *wk; struct freefrag *freefrag; - struct newdirblk *newdirblk; freefrag = NULL; mtx_assert(&lk, MA_OWNED); @@ -4791,11 +5049,10 @@ allocdirect_merge(adphead, newadp, oldadp) * move it from the old allocdirect to the new allocdirect. */ if ((wk = LIST_FIRST(&oldadp->ad_newdirblk)) != NULL) { - newdirblk = WK_NEWDIRBLK(wk); - WORKLIST_REMOVE(&newdirblk->db_list); + WORKLIST_REMOVE(wk); if (!LIST_EMPTY(&oldadp->ad_newdirblk)) panic("allocdirect_merge: extra newdirblk"); - WORKLIST_INSERT(&newadp->ad_newdirblk, &newdirblk->db_list); + WORKLIST_INSERT(&newadp->ad_newdirblk, wk); } TAILQ_REMOVE(adphead, oldadp, ad_next); /* @@ -4814,9 +5071,8 @@ allocdirect_merge(adphead, newadp, oldadp) &oldadp->ad_block.nb_jnewblk->jn_list, &newadp->ad_block.nb_jwork); oldadp->ad_block.nb_jnewblk = NULL; - if (cancel_newblk(&oldadp->ad_block, NULL, - &newadp->ad_block.nb_jwork)) - panic("allocdirect_merge: Unexpected dependency."); + cancel_newblk(&oldadp->ad_block, NULL, + &newadp->ad_block.nb_jwork); } else { wk = (struct worklist *) cancel_newblk(&oldadp->ad_block, &freefrag->ff_list, &freefrag->ff_jwork); @@ -5084,6 +5340,7 @@ newallocindir(ip, ptrno, newblkno, oldblkno, lbn) aip = (struct allocindir *)newblk; aip->ai_offset = ptrno; aip->ai_oldblkno = oldblkno; + aip->ai_lbn = lbn; if ((jnewblk = newblk->nb_jnewblk) != NULL) { jnewblk->jn_ino = ip->i_number; jnewblk->jn_lbn = lbn; @@ -5110,6 +5367,7 @@ softdep_setup_allocindir_page(ip, lbn, bp, ptrno, struct buf *nbp; /* buffer holding allocated page */ { struct inodedep *inodedep; + struct freefrag *freefrag; struct allocindir *aip; struct pagedep *pagedep; struct mount *mp; @@ -5126,12 +5384,13 @@ softdep_setup_allocindir_page(ip, lbn, bp, ptrno, * allocate an associated pagedep to track additions and * deletions. */ - if ((ip->i_mode & IFMT) == IFDIR && - pagedep_lookup(mp, ip->i_number, lbn, DEPALLOC, &pagedep) == 0) - WORKLIST_INSERT(&nbp->b_dep, &pagedep->pd_list); + if ((ip->i_mode & IFMT) == IFDIR) + pagedep_lookup(mp, nbp, ip->i_number, lbn, DEPALLOC, &pagedep); WORKLIST_INSERT(&nbp->b_dep, &aip->ai_block.nb_list); - setup_allocindir_phase2(bp, ip, inodedep, aip, lbn); + freefrag = setup_allocindir_phase2(bp, ip, inodedep, aip, lbn); FREE_LOCK(&lk); + if (freefrag) + handle_workitem_freefrag(freefrag); } /* @@ -5155,7 +5414,8 @@ softdep_setup_allocindir_meta(nbp, ip, bp, ptrno, aip = newallocindir(ip, ptrno, newblkno, 0, lbn); inodedep_lookup(UFSTOVFS(ip->i_ump), ip->i_number, DEPALLOC, &inodedep); WORKLIST_INSERT(&nbp->b_dep, &aip->ai_block.nb_list); - setup_allocindir_phase2(bp, ip, inodedep, aip, lbn); + if (setup_allocindir_phase2(bp, ip, inodedep, aip, lbn)) + panic("softdep_setup_allocindir_meta: Block already existed"); FREE_LOCK(&lk); } @@ -5166,7 +5426,7 @@ indirdep_complete(indirdep) struct allocindir *aip; LIST_REMOVE(indirdep, ir_next); - indirdep->ir_state &= ~ONDEPLIST; + indirdep->ir_state |= DEPCOMPLETE; while ((aip = LIST_FIRST(&indirdep->ir_completehd)) != NULL) { LIST_REMOVE(aip, ai_next); @@ -5181,127 +5441,134 @@ indirdep_complete(indirdep) free_indirdep(indirdep); } -/* - * Called to finish the allocation of the "aip" allocated - * by one of the two routines above. - */ -static void -setup_allocindir_phase2(bp, ip, inodedep, aip, lbn) - struct buf *bp; /* in-memory copy of the indirect block */ - struct inode *ip; /* inode for file being extended */ - struct inodedep *inodedep; /* Inodedep for ip */ - struct allocindir *aip; /* allocindir allocated by the above routines */ - ufs_lbn_t lbn; /* Logical block number for this block. */ +static struct indirdep * +indirdep_lookup(mp, ip, bp) + struct mount *mp; + struct inode *ip; + struct buf *bp; { + struct indirdep *indirdep, *newindirdep; + struct newblk *newblk; struct worklist *wk; struct fs *fs; - struct newblk *newblk; - struct indirdep *indirdep, *newindirdep; - struct allocindir *oldaip; - struct freefrag *freefrag; - struct mount *mp; ufs2_daddr_t blkno; - mp = UFSTOVFS(ip->i_ump); + mtx_assert(&lk, MA_OWNED); + indirdep = NULL; + newindirdep = NULL; fs = ip->i_fs; - mtx_assert(&lk, MA_OWNED); - if (bp->b_lblkno >= 0) - panic("setup_allocindir_phase2: not indir blk"); - for (freefrag = NULL, indirdep = NULL, newindirdep = NULL; ; ) { + for (;;) { LIST_FOREACH(wk, &bp->b_dep, wk_list) { if (wk->wk_type != D_INDIRDEP) continue; indirdep = WK_INDIRDEP(wk); break; } - if (indirdep == NULL && newindirdep) { - indirdep = newindirdep; - newindirdep = NULL; - WORKLIST_INSERT(&bp->b_dep, &indirdep->ir_list); - if (newblk_lookup(mp, dbtofsb(fs, bp->b_blkno), 0, - &newblk)) { - indirdep->ir_state |= ONDEPLIST; - LIST_INSERT_HEAD(&newblk->nb_indirdeps, - indirdep, ir_next); - } else - indirdep->ir_state |= DEPCOMPLETE; - } - if (indirdep) { - aip->ai_indirdep = indirdep; - /* - * Check to see if there is an existing dependency - * for this block. If there is, merge the old - * dependency into the new one. This happens - * as a result of reallocblk only. - */ - if (aip->ai_oldblkno == 0) - oldaip = NULL; - else - - LIST_FOREACH(oldaip, &indirdep->ir_deplisthd, - ai_next) - if (oldaip->ai_offset == aip->ai_offset) - break; - if (oldaip != NULL) - freefrag = allocindir_merge(aip, oldaip); - LIST_INSERT_HEAD(&indirdep->ir_deplisthd, aip, ai_next); - KASSERT(aip->ai_offset >= 0 && - aip->ai_offset < NINDIR(ip->i_ump->um_fs), - ("setup_allocindir_phase2: Bad offset %d", - aip->ai_offset)); - KASSERT(indirdep->ir_savebp != NULL, - ("setup_allocindir_phase2 NULL ir_savebp")); - if (ip->i_ump->um_fstype == UFS1) - ((ufs1_daddr_t *)indirdep->ir_savebp->b_data) - [aip->ai_offset] = aip->ai_oldblkno; - else - ((ufs2_daddr_t *)indirdep->ir_savebp->b_data) - [aip->ai_offset] = aip->ai_oldblkno; - FREE_LOCK(&lk); - if (freefrag != NULL) - handle_workitem_freefrag(freefrag); - } else - FREE_LOCK(&lk); - if (newindirdep) { - newindirdep->ir_savebp->b_flags |= B_INVAL | B_NOCACHE; - brelse(newindirdep->ir_savebp); - ACQUIRE_LOCK(&lk); - WORKITEM_FREE((caddr_t)newindirdep, D_INDIRDEP); - if (indirdep) - break; - FREE_LOCK(&lk); - } - if (indirdep) { - ACQUIRE_LOCK(&lk); + /* Found on the buffer worklist, no new structure to free. */ + if (indirdep != NULL && newindirdep == NULL) + return (indirdep); + if (indirdep != NULL && newindirdep != NULL) + panic("indirdep_lookup: simultaneous create"); + /* None found on the buffer and a new structure is ready. */ + if (indirdep == NULL && newindirdep != NULL) break; - } + /* None found and no new structure available. */ + FREE_LOCK(&lk); newindirdep = malloc(sizeof(struct indirdep), - M_INDIRDEP, M_SOFTDEP_FLAGS); + M_INDIRDEP, M_SOFTDEP_FLAGS); workitem_alloc(&newindirdep->ir_list, D_INDIRDEP, mp); newindirdep->ir_state = ATTACHED; if (ip->i_ump->um_fstype == UFS1) newindirdep->ir_state |= UFS1FMT; + TAILQ_INIT(&newindirdep->ir_trunc); newindirdep->ir_saveddata = NULL; LIST_INIT(&newindirdep->ir_deplisthd); LIST_INIT(&newindirdep->ir_donehd); LIST_INIT(&newindirdep->ir_writehd); LIST_INIT(&newindirdep->ir_completehd); - LIST_INIT(&newindirdep->ir_jwork); - LIST_INIT(&newindirdep->ir_jnewblkhd); if (bp->b_blkno == bp->b_lblkno) { ufs_bmaparray(bp->b_vp, bp->b_lblkno, &blkno, bp, NULL, NULL); bp->b_blkno = blkno; } + newindirdep->ir_freeblks = NULL; newindirdep->ir_savebp = getblk(ip->i_devvp, bp->b_blkno, bp->b_bcount, 0, 0, 0); + newindirdep->ir_bp = bp; BUF_KERNPROC(newindirdep->ir_savebp); bcopy(bp->b_data, newindirdep->ir_savebp->b_data, bp->b_bcount); ACQUIRE_LOCK(&lk); } + indirdep = newindirdep; + WORKLIST_INSERT(&bp->b_dep, &indirdep->ir_list); + /* + * If the block is not yet allocated we don't set DEPCOMPLETE so + * that we don't free dependencies until the pointers are valid. + * This could search b_dep for D_ALLOCDIRECT/D_ALLOCINDIR rather + * than using the hash. + */ + if (newblk_lookup(mp, dbtofsb(fs, bp->b_blkno), 0, &newblk)) + LIST_INSERT_HEAD(&newblk->nb_indirdeps, indirdep, ir_next); + else + indirdep->ir_state |= DEPCOMPLETE; + return (indirdep); } /* + * Called to finish the allocation of the "aip" allocated + * by one of the two routines above. + */ +static struct freefrag * +setup_allocindir_phase2(bp, ip, inodedep, aip, lbn) + struct buf *bp; /* in-memory copy of the indirect block */ + struct inode *ip; /* inode for file being extended */ + struct inodedep *inodedep; /* Inodedep for ip */ + struct allocindir *aip; /* allocindir allocated by the above routines */ + ufs_lbn_t lbn; /* Logical block number for this block. */ +{ + struct fs *fs; + struct indirdep *indirdep; + struct allocindir *oldaip; + struct freefrag *freefrag; + struct mount *mp; + + mtx_assert(&lk, MA_OWNED); + mp = UFSTOVFS(ip->i_ump); + fs = ip->i_fs; + if (bp->b_lblkno >= 0) + panic("setup_allocindir_phase2: not indir blk"); + KASSERT(aip->ai_offset >= 0 && aip->ai_offset < NINDIR(fs), + ("setup_allocindir_phase2: Bad offset %d", aip->ai_offset)); + indirdep = indirdep_lookup(mp, ip, bp); + KASSERT(indirdep->ir_savebp != NULL, + ("setup_allocindir_phase2 NULL ir_savebp")); + aip->ai_indirdep = indirdep; + /* + * Check for an unwritten dependency for this indirect offset. If + * there is, merge the old dependency into the new one. This happens + * as a result of reallocblk only. + */ + freefrag = NULL; + if (aip->ai_oldblkno != 0) { + LIST_FOREACH(oldaip, &indirdep->ir_deplisthd, ai_next) { + if (oldaip->ai_offset == aip->ai_offset) { + freefrag = allocindir_merge(aip, oldaip); + goto done; + } + } + LIST_FOREACH(oldaip, &indirdep->ir_donehd, ai_next) { + if (oldaip->ai_offset == aip->ai_offset) { + freefrag = allocindir_merge(aip, oldaip); + goto done; + } + } + } +done: + LIST_INSERT_HEAD(&indirdep->ir_deplisthd, aip, ai_next); + return (freefrag); +} + +/* * Merge two allocindirs which refer to the same block. Move newblock * dependencies and setup the freefrags appropriately. */ @@ -5310,7 +5577,6 @@ allocindir_merge(aip, oldaip) struct allocindir *aip; struct allocindir *oldaip; { - struct newdirblk *newdirblk; struct freefrag *freefrag; struct worklist *wk; @@ -5326,11 +5592,10 @@ allocindir_merge(aip, oldaip) * move it from the old allocindir to the new allocindir. */ if ((wk = LIST_FIRST(&oldaip->ai_newdirblk)) != NULL) { - newdirblk = WK_NEWDIRBLK(wk); - WORKLIST_REMOVE(&newdirblk->db_list); + WORKLIST_REMOVE(wk); if (!LIST_EMPTY(&oldaip->ai_newdirblk)) panic("allocindir_merge: extra newdirblk"); - WORKLIST_INSERT(&aip->ai_newdirblk, &newdirblk->db_list); + WORKLIST_INSERT(&aip->ai_newdirblk, wk); } /* * We can skip journaling for this freefrag and just complete @@ -5363,7 +5628,7 @@ setup_freedirect(freeblks, ip, i, needj) DIP_SET(ip, i_db[i], 0); frags = sblksize(ip->i_fs, ip->i_size, i); frags = numfrags(ip->i_fs, frags); - newfreework(ip->i_ump, freeblks, NULL, i, blkno, frags, needj); + newfreework(ip->i_ump, freeblks, NULL, i, blkno, frags, 0, needj); } static inline void @@ -5382,15 +5647,15 @@ setup_freeext(freeblks, ip, i, needj) ip->i_din2->di_extb[i] = 0; frags = sblksize(ip->i_fs, ip->i_din2->di_extsize, i); frags = numfrags(ip->i_fs, frags); - newfreework(ip->i_ump, freeblks, NULL, -1 - i, blkno, frags, needj); + newfreework(ip->i_ump, freeblks, NULL, -1 - i, blkno, frags, 0, needj); } static inline void setup_freeindir(freeblks, ip, i, lbn, needj) struct freeblks *freeblks; struct inode *ip; + int i; ufs_lbn_t lbn; - int i; int needj; { ufs2_daddr_t blkno; @@ -5400,7 +5665,7 @@ setup_freeindir(freeblks, ip, i, lbn, needj) return; DIP_SET(ip, i_ib[i], 0); newfreework(ip->i_ump, freeblks, NULL, lbn, blkno, ip->i_fs->fs_frag, - needj); + 0, needj); } static inline struct freeblks * @@ -5413,18 +5678,616 @@ newfreeblks(mp, ip) freeblks = malloc(sizeof(struct freeblks), M_FREEBLKS, M_SOFTDEP_FLAGS|M_ZERO); workitem_alloc(&freeblks->fb_list, D_FREEBLKS, mp); - LIST_INIT(&freeblks->fb_jfreeblkhd); + LIST_INIT(&freeblks->fb_jblkdephd); LIST_INIT(&freeblks->fb_jwork); + freeblks->fb_ref = 0; + freeblks->fb_cgwait = 0; freeblks->fb_state = ATTACHED; freeblks->fb_uid = ip->i_uid; - freeblks->fb_previousinum = ip->i_number; + freeblks->fb_inum = ip->i_number; + freeblks->fb_modrev = DIP(ip, i_modrev); freeblks->fb_devvp = ip->i_devvp; freeblks->fb_chkcnt = 0; + freeblks->fb_freecnt = 0; + freeblks->fb_len = 0; return (freeblks); } +static void +trunc_indirdep(indirdep, freeblks, bp, off) + struct indirdep *indirdep; + struct freeblks *freeblks; + struct buf *bp; + int off; +{ + struct allocindir *aip, *aipn; + + /* + * The first set of allocindirs won't be in savedbp. + */ + LIST_FOREACH_SAFE(aip, &indirdep->ir_deplisthd, ai_next, aipn) + if (aip->ai_offset > off) + cancel_allocindir(aip, bp, freeblks, 1); + LIST_FOREACH_SAFE(aip, &indirdep->ir_donehd, ai_next, aipn) + if (aip->ai_offset > off) + cancel_allocindir(aip, bp, freeblks, 1); + /* + * These will exist in savedbp. + */ + LIST_FOREACH_SAFE(aip, &indirdep->ir_writehd, ai_next, aipn) + if (aip->ai_offset > off) + cancel_allocindir(aip, NULL, freeblks, 0); + LIST_FOREACH_SAFE(aip, &indirdep->ir_completehd, ai_next, aipn) + if (aip->ai_offset > off) + cancel_allocindir(aip, NULL, freeblks, 0); +} + /* + * Follow the chain of indirects down to lastlbn creating a freework + * structure for each. This will be used to start indir_trunc() at + * the right offset and create the journal records for the parrtial + * truncation. A second step will handle the truncated dependencies. + */ +static int +setup_trunc_indir(freeblks, ip, lbn, lastlbn, blkno) + struct freeblks *freeblks; + struct inode *ip; + ufs_lbn_t lbn; + ufs_lbn_t lastlbn; + ufs2_daddr_t blkno; +{ + struct indirdep *indirdep; + struct indirdep *indirn; + struct freework *freework; + struct newblk *newblk; + struct mount *mp; + struct buf *bp; + uint8_t *start; + uint8_t *end; + ufs_lbn_t lbnadd; + int level; + int error; + int off; + + + freework = NULL; + if (blkno == 0) + return (0); + mp = freeblks->fb_list.wk_mp; + bp = getblk(ITOV(ip), lbn, mp->mnt_stat.f_iosize, 0, 0, 0); + if ((bp->b_flags & B_CACHE) == 0) { + bp->b_blkno = blkptrtodb(VFSTOUFS(mp), blkno); + bp->b_iocmd = BIO_READ; + bp->b_flags &= ~B_INVAL; + bp->b_ioflags &= ~BIO_ERROR; + vfs_busy_pages(bp, 0); + bp->b_iooffset = dbtob(bp->b_blkno); + bstrategy(bp); + curthread->td_ru.ru_inblock++; + error = bufwait(bp); + if (error) { + brelse(bp); + return (error); + } + } + level = lbn_level(lbn); + lbnadd = lbn_offset(ip->i_fs, level); + /* + * Compute the offset of the last block we want to keep. Store + * in the freework the first block we want to completely free. + */ + off = (lastlbn - -(lbn + level)) / lbnadd; + if (off + 1 == NINDIR(ip->i_fs)) + goto nowork; + freework = newfreework(ip->i_ump, freeblks, NULL, lbn, blkno, 0, off+1, + 0); + /* + * Link the freework into the indirdep. This will prevent any new + * allocations from proceeding until we are finished with the + * truncate and the block is written. + */ + ACQUIRE_LOCK(&lk); + indirdep = indirdep_lookup(mp, ip, bp); + if (indirdep->ir_freeblks) + panic("setup_trunc_indir: indirdep already truncated."); + TAILQ_INSERT_TAIL(&indirdep->ir_trunc, freework, fw_next); + freework->fw_indir = indirdep; + /* + * Cancel any allocindirs that will not make it to disk. + * We have to do this for all copies of the indirdep that + * live on this newblk. + */ + if ((indirdep->ir_state & DEPCOMPLETE) == 0) { + newblk_lookup(mp, dbtofsb(ip->i_fs, bp->b_blkno), 0, &newblk); + LIST_FOREACH(indirn, &newblk->nb_indirdeps, ir_next) + trunc_indirdep(indirn, freeblks, bp, off); + } else + trunc_indirdep(indirdep, freeblks, bp, off); + FREE_LOCK(&lk); + /* + * Creation is protected by the buf lock. The saveddata is only + * needed if a full truncation follows a partial truncation but it + * is difficult to allocate in that case so we fetch it anyway. + */ + if (indirdep->ir_saveddata == NULL) + indirdep->ir_saveddata = malloc(bp->b_bcount, M_INDIRDEP, + M_SOFTDEP_FLAGS); +nowork: + /* Fetch the blkno of the child and the zero start offset. */ + if (ip->i_ump->um_fstype == UFS1) { + blkno = ((ufs1_daddr_t *)bp->b_data)[off]; + start = (uint8_t *)&((ufs1_daddr_t *)bp->b_data)[off+1]; + } else { + blkno = ((ufs2_daddr_t *)bp->b_data)[off]; + start = (uint8_t *)&((ufs2_daddr_t *)bp->b_data)[off+1]; + } + if (freework) { + /* Zero the truncated pointers. */ + end = bp->b_data + bp->b_bcount; + bzero(start, end - start); + bdwrite(bp); + } else + bqrelse(bp); + if (level == 0) + return (0); + lbn++; /* adjust level */ + lbn -= (off * lbnadd); + return setup_trunc_indir(freeblks, ip, lbn, lastlbn, blkno); +} + +/* + * Complete the partial truncation of an indirect block setup by + * setup_trunc_indir(). This zeros the truncated pointers in the saved + * copy and writes them to disk before the freeblks is allowed to complete. + */ +static void +complete_trunc_indir(freework) + struct freework *freework; +{ + struct freework *fwn; + struct indirdep *indirdep; + struct buf *bp; + uintptr_t start; + int count; + + indirdep = freework->fw_indir; + for (;;) { + bp = indirdep->ir_bp; + /* See if the block was discarded. */ + if (bp == NULL) + break; + /* Inline part of getdirtybuf(). We dont want bremfree. */ + if (BUF_LOCK(bp, LK_EXCLUSIVE | LK_NOWAIT, NULL) == 0) + break; + if (BUF_LOCK(bp, + LK_EXCLUSIVE | LK_SLEEPFAIL | LK_INTERLOCK, &lk) == 0) + BUF_UNLOCK(bp); + ACQUIRE_LOCK(&lk); + } + mtx_assert(&lk, MA_OWNED); + freework->fw_state |= DEPCOMPLETE; + TAILQ_REMOVE(&indirdep->ir_trunc, freework, fw_next); + /* + * Zero the pointers in the saved copy. + */ + if (indirdep->ir_state & UFS1FMT) + start = sizeof(ufs1_daddr_t); + else + start = sizeof(ufs2_daddr_t); + start *= freework->fw_start; + count = indirdep->ir_savebp->b_bcount - start; + start += (uintptr_t)indirdep->ir_savebp->b_data; + bzero((char *)start, count); + /* + * We need to start the next truncation in the list if it has not + * been started yet. + */ + fwn = TAILQ_FIRST(&indirdep->ir_trunc); + if (fwn != NULL) { + if (fwn->fw_freeblks == indirdep->ir_freeblks) + TAILQ_REMOVE(&indirdep->ir_trunc, fwn, fw_next); + if ((fwn->fw_state & ONWORKLIST) == 0) + freework_enqueue(fwn); + } + /* + * If bp is NULL the block was fully truncated, restore + * the saved block list otherwise free it if it is no + * longer needed. + */ + if (TAILQ_EMPTY(&indirdep->ir_trunc)) { + if (bp == NULL) + bcopy(indirdep->ir_saveddata, + indirdep->ir_savebp->b_data, + indirdep->ir_savebp->b_bcount); + free(indirdep->ir_saveddata, M_INDIRDEP); + indirdep->ir_saveddata = NULL; + } + /* + * When bp is NULL there is a full truncation pending. We + * must wait for this full truncation to be journaled before + * we can release this freework because the disk pointers will + * never be written as zero. + */ + if (bp == NULL) { + if (LIST_EMPTY(&indirdep->ir_freeblks->fb_jblkdephd)) + handle_written_freework(freework, 0); + else + WORKLIST_INSERT(&indirdep->ir_freeblks->fb_freeworkhd, + &freework->fw_list); + } else { + /* Complete when the real copy is written. */ + WORKLIST_INSERT(&bp->b_dep, &freework->fw_list); + BUF_UNLOCK(bp); + } +} + +/* + * Calculate the number of blocks we are going to release where datablocks + * is the current total and length is the new file size. + */ +ufs2_daddr_t +blkcount(fs, datablocks, length) + struct fs *fs; + ufs2_daddr_t datablocks; + off_t length; +{ + off_t totblks, numblks; + + totblks = 0; + numblks = howmany(length, fs->fs_bsize); + if (numblks <= NDADDR) { + totblks = howmany(length, fs->fs_fsize); + goto out; + } + totblks = blkstofrags(fs, numblks); + numblks -= NDADDR; + /* + * Count all single, then double, then triple indirects required. + * Subtracting one indirects worth of blocks for each pass + * acknowledges one of each pointed to by the inode. + */ + for (;;) { + totblks += blkstofrags(fs, howmany(numblks, NINDIR(fs))); + numblks -= NINDIR(fs); + if (numblks <= 0) + break; + numblks = howmany(numblks, NINDIR(fs)); + } +out: + totblks = fsbtodb(fs, totblks); + /* + * Handle sparse files. We can't reclaim more blocks than the inode + * references. We will correct it later in handle_complete_freeblks() + * when we know the real count. + */ + if (totblks > datablocks) + return (0); + return (totblks - datablocks); +} + +/* + * Handle freeblocks for journaled softupdate filesystems. + * + * Contrary to normal softupdates, we must preserve the block pointers in + * indirects until their subordinates are free. This is to avoid journaling + * every block that is freed which may consume more space than the journal + * itself. The recovery program will see the free block journals at the + * base of the truncated area and traverse them to reclaim space. The + * pointers in the inode may be cleared immediately after the journal + * records are written because each direct and indirect pointer in the + * inode is recorded in a journal. This permits full truncation to proceed + * asynchronously. The write order is journal -> inode -> cgs -> indirects. + * + * The algorithm is as follows: + * 1) Traverse the in-memory state and create journal entries to release + * the relevant blocks and full indirect trees. + * 2) Traverse the indirect block chain adding partial truncation freework + * records to indirects in the path to lastlbn. The freework will + * prevent new allocation dependencies from being satisfied in this + * indirect until the truncation completes. + * 3) Read and lock the inode block, performing an update with the new size + * and pointers. This prevents truncated data from becoming valid on + * disk through step 4. + * 4) Reap unsatisfied dependencies that are beyond the truncated area, + * eliminate journal work for those records that do not require it. + * 5) Schedule the journal records to be written followed by the inode block. + * 6) Allocate any necessary frags for the end of file. + * 7) Zero any partially truncated blocks. + * + * From this truncation proceeds asynchronously using the freework and + * indir_trunc machinery. The file will not be extended again into a + * partially truncated indirect block until all work is completed but + * the normal dependency mechanism ensures that it is rolled back/forward + * as appropriate. Further truncation may occur without delay and is + * serialized in indir_trunc(). + */ +void +softdep_journal_freeblocks(ip, cred, length, flags) + struct inode *ip; /* The inode whose length is to be reduced */ + struct ucred *cred; + off_t length; /* The new length for the file */ + int flags; /* IO_EXT and/or IO_NORMAL */ +{ + struct freeblks *freeblks, *fbn; + struct inodedep *inodedep; + struct jblkdep *jblkdep; + struct allocdirect *adp, *adpn; + struct fs *fs; + struct buf *bp; + struct vnode *vp; + struct mount *mp; + ufs2_daddr_t extblocks, datablocks; + ufs_lbn_t tmpval, lbn, lastlbn; + int frags; + int lastoff, iboff; + int allocblock; + int error, i; + int needj; + + fs = ip->i_fs; + mp = UFSTOVFS(ip->i_ump); + vp = ITOV(ip); + needj = 1; + iboff = -1; + allocblock = 0; + extblocks = 0; + datablocks = 0; + frags = 0; + freeblks = newfreeblks(mp, ip); + ACQUIRE_LOCK(&lk); + /* + * If we're truncating a removed file that will never be written + * we don't need to journal the block frees. The canceled journals + * for the allocations will suffice. + */ + inodedep_lookup(mp, ip->i_number, DEPALLOC, &inodedep); + if ((inodedep->id_state & (UNLINKED | DEPCOMPLETE)) == UNLINKED && + length == 0) + needj = 0; + FREE_LOCK(&lk); + /* + * Calculate the lbn that we are truncating to. This results in -1 + * if we're truncating the 0 bytes. So it is the last lbn we want + * to keep, not the first lbn we want to truncate. + */ + lastlbn = lblkno(fs, length + fs->fs_bsize - 1) - 1; + lastoff = blkoff(fs, length); + /* + * Compute frags we are keeping in lastlbn. 0 means all. + */ + if (lastlbn >= 0 && lastlbn < NDADDR) { + frags = fragroundup(fs, lastoff); + /* adp offset of last valid allocdirect. */ + iboff = lastlbn; + } else if (lastlbn > 0) + iboff = NDADDR; + if (fs->fs_magic == FS_UFS2_MAGIC) + extblocks = btodb(fragroundup(fs, ip->i_din2->di_extsize)); + /* + * Handle normal data blocks and indirects. This section saves + * values used after the inode update to complete frag and indirect + * truncation. + */ + if ((flags & IO_NORMAL) != 0) { + /* + * Handle truncation of whole direct and indirect blocks. + */ + for (i = iboff + 1; i < NDADDR; i++) + setup_freedirect(freeblks, ip, i, needj); + for (i = 0, tmpval = NINDIR(fs), lbn = NDADDR; i < NIADDR; + i++, lbn += tmpval, tmpval *= NINDIR(fs)) { + /* Release a whole indirect tree. */ + if (lbn > lastlbn) { + setup_freeindir(freeblks, ip, i, -lbn -i, + needj); + continue; + } + iboff = i + NDADDR; + /* + * Traverse partially truncated indirect tree. + */ + if (lbn <= lastlbn && lbn + tmpval - 1 > lastlbn) + setup_trunc_indir(freeblks, ip, -lbn - i, + lastlbn, DIP(ip, i_ib[i])); + } + /* + * Handle partial truncation to a frag boundary. + */ + if (frags) { + ufs2_daddr_t blkno; + long oldfrags; + + oldfrags = blksize(fs, ip, lastlbn); + blkno = DIP(ip, i_db[lastlbn]); + if (blkno && oldfrags != frags) { + oldfrags -= frags; + oldfrags = numfrags(ip->i_fs, oldfrags); + blkno += numfrags(ip->i_fs, frags); + newfreework(ip->i_ump, freeblks, NULL, lastlbn, + blkno, oldfrags, 0, needj); + } else if (blkno == 0) + allocblock = 1; + } + /* + * Add a journal record for partial truncate if we are + * handling indirect blocks. Non-indirects need no extra + * journaling. + */ + if (length != 0 && lastlbn >= NDADDR) { + ip->i_flag |= IN_TRUNCATED; + newjtrunc(freeblks, length, 0); + } + ip->i_size = length; + DIP_SET(ip, i_size, ip->i_size); + datablocks = DIP(ip, i_blocks) - extblocks; + if (length != 0) + datablocks = blkcount(ip->i_fs, datablocks, length); + freeblks->fb_len = length; + } + if ((flags & IO_EXT) != 0) { + for (i = 0; i < NXADDR; i++) + setup_freeext(freeblks, ip, i, needj); + ip->i_din2->di_extsize = 0; + datablocks += extblocks; + } +#ifdef QUOTA + /* Reference the quotas in case the block count is wrong in the end. */ + quotaref(vp, freeblks->fb_quota); + (void) chkdq(ip, -datablocks, NOCRED, 0); +#endif + freeblks->fb_chkcnt = datablocks; + UFS_LOCK(ip->i_ump); + fs->fs_pendingblocks += datablocks; + UFS_UNLOCK(ip->i_ump); + DIP_SET(ip, i_blocks, DIP(ip, i_blocks) - datablocks); + /* + * Handle truncation of incomplete alloc direct dependencies. We + * hold the inode block locked to prevent incomplete dependencies + * from reaching the disk while we are eliminating those that + * have been truncated. This is a partially inlined ffs_update(). + */ + ufs_itimes(vp); + ip->i_flag &= ~(IN_LAZYACCESS | IN_LAZYMOD | IN_MODIFIED); + error = bread(ip->i_devvp, fsbtodb(fs, ino_to_fsba(fs, ip->i_number)), + (int)fs->fs_bsize, cred, &bp); + if (error) { + brelse(bp); + softdep_error("softdep_journal_freeblocks", error); + return; + } + if (bp->b_bufsize == fs->fs_bsize) + bp->b_flags |= B_CLUSTEROK; + softdep_update_inodeblock(ip, bp, 0); + if (ip->i_ump->um_fstype == UFS1) + *((struct ufs1_dinode *)bp->b_data + + ino_to_fsbo(fs, ip->i_number)) = *ip->i_din1; + else + *((struct ufs2_dinode *)bp->b_data + + ino_to_fsbo(fs, ip->i_number)) = *ip->i_din2; + ACQUIRE_LOCK(&lk); + (void) inodedep_lookup(mp, ip->i_number, DEPALLOC, &inodedep); + if ((inodedep->id_state & IOSTARTED) != 0) + panic("softdep_setup_freeblocks: inode busy"); + /* + * Add the freeblks structure to the list of operations that + * must await the zero'ed inode being written to disk. If we + * still have a bitmap dependency (needj), then the inode + * has never been written to disk, so we can process the + * freeblks below once we have deleted the dependencies. + */ + if (needj) + WORKLIST_INSERT(&bp->b_dep, &freeblks->fb_list); + else + freeblks->fb_state |= COMPLETE; + if ((flags & IO_NORMAL) != 0) { + TAILQ_FOREACH_SAFE(adp, &inodedep->id_inoupdt, ad_next, adpn) { + if (adp->ad_offset > iboff) + cancel_allocdirect(&inodedep->id_inoupdt, adp, + freeblks); + /* + * Truncate the allocdirect. We could eliminate + * or modify journal records as well. + */ + else if (adp->ad_offset == iboff && frags) + adp->ad_newsize = frags; + } + } + if ((flags & IO_EXT) != 0) + while ((adp = TAILQ_FIRST(&inodedep->id_extupdt)) != 0) + cancel_allocdirect(&inodedep->id_extupdt, adp, + freeblks); + /* + * Add journal work. + */ + LIST_FOREACH(jblkdep, &freeblks->fb_jblkdephd, jb_deps) + add_to_journal(&jblkdep->jb_list); + FREE_LOCK(&lk); + bdwrite(bp); + /* + * Truncate dependency structures beyond length. + */ + trunc_dependencies(ip, freeblks, lastlbn, frags, flags); + /* + * This is only set when we need to allocate a fragment because + * none existed at the end of a frag-sized file. It handles only + * allocating a new, zero filled block. + */ + if (allocblock) { + ip->i_size = length - lastoff; + DIP_SET(ip, i_size, ip->i_size); + error = UFS_BALLOC(vp, length - 1, 1, cred, BA_CLRBUF, &bp); + if (error != 0) { + softdep_error("softdep_journal_freeblks", error); + return; + } + ip->i_size = length; + DIP_SET(ip, i_size, length); + ip->i_flag |= IN_CHANGE | IN_UPDATE; + allocbuf(bp, frags); + ffs_update(vp, MNT_NOWAIT); + bawrite(bp); + } else if (lastoff != 0 && vp->v_type != VDIR) { + int size; + + /* + * Zero the end of a truncated frag or block. + */ + size = sblksize(fs, length, lastlbn); + error = bread(vp, lastlbn, size, cred, &bp); + if (error) { + softdep_error("softdep_journal_freeblks", error); + return; + } + bzero((char *)bp->b_data + lastoff, size - lastoff); + bawrite(bp); + + } + ACQUIRE_LOCK(&lk); + inodedep_lookup(mp, ip->i_number, DEPALLOC, &inodedep); + TAILQ_INSERT_TAIL(&inodedep->id_freeblklst, freeblks, fb_next); + freeblks->fb_state |= DEPCOMPLETE | ONDEPLIST; + /* + * We zero earlier truncations so they don't erroneously + * update i_blocks. + */ + if (freeblks->fb_len == 0 && (flags & IO_NORMAL) != 0) + TAILQ_FOREACH(fbn, &inodedep->id_freeblklst, fb_next) + fbn->fb_len = 0; + if ((freeblks->fb_state & ALLCOMPLETE) == ALLCOMPLETE && + LIST_EMPTY(&freeblks->fb_jblkdephd)) + freeblks->fb_state |= INPROGRESS; + else + freeblks = NULL; + FREE_LOCK(&lk); + if (freeblks) + handle_workitem_freeblocks(freeblks, 0); + +} + +/* + * Flush a JOP_SYNC to the journal. + */ +void +softdep_journal_fsync(ip) + struct inode *ip; +{ + struct jfsync *jfsync; + + if ((ip->i_flag & IN_TRUNCATED) == 0) + return; + ip->i_flag &= ~IN_TRUNCATED; + jfsync = malloc(sizeof(*jfsync), M_JFSYNC, M_SOFTDEP_FLAGS | M_ZERO); + workitem_alloc(&jfsync->jfs_list, D_JFSYNC, UFSTOVFS(ip->i_ump)); + jfsync->jfs_size = ip->i_size; + jfsync->jfs_ino = ip->i_number; + ACQUIRE_LOCK(&lk); + add_to_journal(&jfsync->jfs_list); + jwait(&jfsync->jfs_list, MNT_WAIT); + FREE_LOCK(&lk); +} + +/* * Block de-allocation dependencies. * * When blocks are de-allocated, the on-disk pointers must be nullified before @@ -5464,7 +6327,6 @@ softdep_setup_freeblocks(ip, length, flags) struct freeblks *freeblks; struct inodedep *inodedep; struct allocdirect *adp; - struct jfreeblk *jfreeblk; struct buf *bp; struct fs *fs; ufs2_daddr_t extblocks, datablocks; @@ -5472,52 +6334,42 @@ softdep_setup_freeblocks(ip, length, flags) int i, delay, error; ufs_lbn_t tmpval; ufs_lbn_t lbn; - int needj; fs = ip->i_fs; mp = UFSTOVFS(ip->i_ump); if (length != 0) panic("softdep_setup_freeblocks: non-zero length"); freeblks = newfreeblks(mp, ip); - ACQUIRE_LOCK(&lk); - /* - * If we're truncating a removed file that will never be written - * we don't need to journal the block frees. The canceled journals - * for the allocations will suffice. - */ - inodedep_lookup(mp, ip->i_number, DEPALLOC, &inodedep); - if ((inodedep->id_state & (UNLINKED | DEPCOMPLETE)) == UNLINKED || - (fs->fs_flags & FS_SUJ) == 0) - needj = 0; - else - needj = 1; - FREE_LOCK(&lk); extblocks = 0; + datablocks = 0; if (fs->fs_magic == FS_UFS2_MAGIC) extblocks = btodb(fragroundup(fs, ip->i_din2->di_extsize)); - datablocks = DIP(ip, i_blocks) - extblocks; if ((flags & IO_NORMAL) != 0) { for (i = 0; i < NDADDR; i++) - setup_freedirect(freeblks, ip, i, needj); + setup_freedirect(freeblks, ip, i, 0); for (i = 0, tmpval = NINDIR(fs), lbn = NDADDR; i < NIADDR; i++, lbn += tmpval, tmpval *= NINDIR(fs)) - setup_freeindir(freeblks, ip, i, -lbn -i, needj); + setup_freeindir(freeblks, ip, i, -lbn -i, 0); ip->i_size = 0; DIP_SET(ip, i_size, 0); - freeblks->fb_chkcnt = datablocks; - UFS_LOCK(ip->i_ump); - fs->fs_pendingblocks += datablocks; - UFS_UNLOCK(ip->i_ump); + datablocks = DIP(ip, i_blocks) - extblocks; } if ((flags & IO_EXT) != 0) { for (i = 0; i < NXADDR; i++) - setup_freeext(freeblks, ip, i, needj); + setup_freeext(freeblks, ip, i, 0); ip->i_din2->di_extsize = 0; - freeblks->fb_chkcnt += extblocks; + datablocks += extblocks; } - if (LIST_EMPTY(&freeblks->fb_jfreeblkhd)) - needj = 0; - DIP_SET(ip, i_blocks, DIP(ip, i_blocks) - freeblks->fb_chkcnt); +#ifdef QUOTA + /* Reference the quotas in case the block count is wrong in the end. */ + quotaref(vp, freeblks->fb_quota); + (void) chkdq(ip, -datablocks, NOCRED, 0); +#endif + freeblks->fb_chkcnt = datablocks; + UFS_LOCK(ip->i_ump); + fs->fs_pendingblocks += datablocks; + UFS_UNLOCK(ip->i_ump); + DIP_SET(ip, i_blocks, DIP(ip, i_blocks) - datablocks); /* * Push the zero'ed inode to to its disk buffer so that we are free * to delete its dependencies below. Once the dependencies are gone @@ -5557,7 +6409,7 @@ softdep_setup_freeblocks(ip, length, flags) delay = (inodedep->id_state & DEPCOMPLETE); if (delay) WORKLIST_INSERT(&bp->b_dep, &freeblks->fb_list); - else if (needj) + else freeblks->fb_state |= COMPLETE; /* * Because the file length has been truncated to zero, any @@ -5573,48 +6425,32 @@ softdep_setup_freeblocks(ip, length, flags) &inodedep->id_inoupdt); while ((adp = TAILQ_FIRST(&inodedep->id_inoupdt)) != 0) cancel_allocdirect(&inodedep->id_inoupdt, adp, - freeblks, delay); + freeblks); } if (flags & IO_EXT) { merge_inode_lists(&inodedep->id_newextupdt, &inodedep->id_extupdt); while ((adp = TAILQ_FIRST(&inodedep->id_extupdt)) != 0) cancel_allocdirect(&inodedep->id_extupdt, adp, - freeblks, delay); + freeblks); } - LIST_FOREACH(jfreeblk, &freeblks->fb_jfreeblkhd, jf_deps) - add_to_journal(&jfreeblk->jf_list); - FREE_LOCK(&lk); bdwrite(bp); - softdep_trunc_deps(ITOV(ip), freeblks, 0, 0, flags); + trunc_dependencies(ip, freeblks, -1, 0, flags); ACQUIRE_LOCK(&lk); if (inodedep_lookup(mp, ip->i_number, 0, &inodedep) != 0) (void) free_inodedep(inodedep); - - if (delay || needj) - freeblks->fb_state |= DEPCOMPLETE; - if (delay) { - /* - * If the inode with zeroed block pointers is now on disk - * we can start freeing blocks. Add freeblks to the worklist - * instead of calling handle_workitem_freeblocks directly as - * it is more likely that additional IO is needed to complete - * the request here than in the !delay case. - */ - if ((freeblks->fb_state & ALLCOMPLETE) == ALLCOMPLETE) - add_to_worklist(&freeblks->fb_list, 1); - } - if (needj && LIST_EMPTY(&freeblks->fb_jfreeblkhd)) - needj = 0; - + freeblks->fb_state |= DEPCOMPLETE; + /* + * If the inode with zeroed block pointers is now on disk + * we can start freeing blocks. + */ + if ((freeblks->fb_state & ALLCOMPLETE) == ALLCOMPLETE) + freeblks->fb_state |= INPROGRESS; + else + freeblks = NULL; FREE_LOCK(&lk); - /* - * If the inode has never been written to disk (delay == 0) and - * we're not waiting on any journal writes, then we can process the - * freeblks now that we have deleted the dependencies. - */ - if (!delay && !needj) + if (freeblks) handle_workitem_freeblocks(freeblks, 0); } @@ -5622,18 +6458,19 @@ softdep_setup_freeblocks(ip, length, flags) * Eliminate any dependencies that exist in memory beyond lblkno:off */ static void -softdep_trunc_deps(vp, freeblks, lblkno, off, flags) - struct vnode *vp; +trunc_dependencies(ip, freeblks, lastlbn, lastoff, flags) + struct inode *ip; struct freeblks *freeblks; - ufs_lbn_t lblkno; - int off; + ufs_lbn_t lastlbn; + int lastoff; int flags; { - struct inodedep *inodedep; struct bufobj *bo; + struct vnode *vp; struct buf *bp; - struct mount *mp; - ino_t ino; + struct fs *fs; + ufs_lbn_t lbn; + int blkoff; /* * We must wait for any I/O in progress to finish so that @@ -5641,26 +6478,48 @@ static void * Once they are all there, walk the list and get rid of * any dependencies. */ - ino = VTOI(vp)->i_number; - mp = vp->v_mount; + fs = ip->i_fs; + vp = ITOV(ip); bo = &vp->v_bufobj; BO_LOCK(bo); drain_output(vp); + TAILQ_FOREACH(bp, &bo->bo_dirty.bv_hd, b_bobufs) + bp->b_vflags &= ~BV_SCANNED; restart: TAILQ_FOREACH(bp, &bo->bo_dirty.bv_hd, b_bobufs) { if (((flags & IO_EXT) == 0 && (bp->b_xflags & BX_ALTDATA)) || ((flags & IO_NORMAL) == 0 && (bp->b_xflags & BX_ALTDATA) == 0)) continue; + if (bp->b_vflags & BV_SCANNED) + continue; + blkoff = 0; + /* + * If this is a partial truncate we only want those + * blocks and indirect blocks that cover the range + * we're after. We handle the partially de-allocated + * indirects in a different pass. + */ + if (lastlbn > -1 && (bp->b_xflags & BX_ALTDATA) == 0) { + lbn = bp->b_lblkno; + if (lbn < 0) + lbn = -(lbn + lbn_level(lbn)); + if (lbn < lastlbn) + continue; + /* Here we only truncate lblkno if it's partial. */ + if (lbn == lastlbn) { + if (lastoff == 0) + continue; + blkoff = lastoff; + } + } if ((bp = getdirtybuf(bp, BO_MTX(bo), MNT_WAIT)) == NULL) goto restart; BO_UNLOCK(bo); - ACQUIRE_LOCK(&lk); - (void) inodedep_lookup(mp, ino, 0, &inodedep); - if (deallocate_dependencies(bp, inodedep, freeblks, 0)) - bp->b_flags |= B_INVAL | B_NOCACHE; - FREE_LOCK(&lk); - brelse(bp); + if (deallocate_dependencies(bp, freeblks, blkoff)) + bqrelse(bp); + else + brelse(bp); BO_LOCK(bo); goto restart; } @@ -5668,69 +6527,77 @@ restart: } static int -cancel_pagedep(pagedep, inodedep, freeblks) +cancel_pagedep(pagedep, freeblks, blkoff) struct pagedep *pagedep; - struct inodedep *inodedep; struct freeblks *freeblks; + int blkoff; { - struct newdirblk *newdirblk; struct jremref *jremref; struct jmvref *jmvref; - struct dirrem *dirrem; + struct dirrem *dirrem, *tmp; int i; /* - * There should be no directory add dependencies present - * as the directory could not be truncated until all - * children were removed. - */ - KASSERT(LIST_FIRST(&pagedep->pd_pendinghd) == NULL, - ("deallocate_dependencies: pendinghd != NULL")); - for (i = 0; i < DAHASHSZ; i++) - KASSERT(LIST_FIRST(&pagedep->pd_diraddhd[i]) == NULL, - ("deallocate_dependencies: diraddhd != NULL")); - /* * Copy any directory remove dependencies to the list - * to be processed after the zero'ed inode is written. - * If the inode has already been written, then they + * to be processed after the freeblks proceeds. If + * directory entry never made it to disk they * can be dumped directly onto the work list. */ - LIST_FOREACH(dirrem, &pagedep->pd_dirremhd, dm_next) { + LIST_FOREACH_SAFE(dirrem, &pagedep->pd_dirremhd, dm_next, tmp) { + /* Skip this directory removal if it is intended to remain. */ + if (dirrem->dm_offset < blkoff) + continue; /* - * If there are any dirrems we wait for - * the journal write to complete and - * then restart the buf scan as the lock + * If there are any dirrems we wait for the journal write + * to complete and then restart the buf scan as the lock * has been dropped. */ - while ((jremref = LIST_FIRST(&dirrem->dm_jremrefhd)) - != NULL) { - stat_jwait_filepage++; - jwait(&jremref->jr_list); + while ((jremref = LIST_FIRST(&dirrem->dm_jremrefhd)) != NULL) { + jwait(&jremref->jr_list, MNT_WAIT); return (ERESTART); } LIST_REMOVE(dirrem, dm_next); dirrem->dm_dirinum = pagedep->pd_ino; - if (inodedep == NULL || - (inodedep->id_state & ALLCOMPLETE) == ALLCOMPLETE) { - dirrem->dm_state |= COMPLETE; - add_to_worklist(&dirrem->dm_list, 0); - } else - WORKLIST_INSERT(&inodedep->id_bufwait, - &dirrem->dm_list); + WORKLIST_INSERT(&freeblks->fb_freeworkhd, &dirrem->dm_list); } - if ((pagedep->pd_state & NEWBLOCK) != 0) { - newdirblk = pagedep->pd_newdirblk; - WORKLIST_REMOVE(&newdirblk->db_list); - free_newdirblk(newdirblk); - } while ((jmvref = LIST_FIRST(&pagedep->pd_jmvrefhd)) != NULL) { - stat_jwait_filepage++; - jwait(&jmvref->jm_list); + jwait(&jmvref->jm_list, MNT_WAIT); return (ERESTART); } - WORKLIST_REMOVE(&pagedep->pd_list); - LIST_REMOVE(pagedep, pd_hash); - WORKITEM_FREE(pagedep, D_PAGEDEP); + /* + * When we're partially truncating a pagedep we just want to flush + * journal entries and return. There can not be any adds in the + * truncated portion of the directory and newblk must remain if + * part of the block remains. + */ + if (blkoff != 0) { + struct diradd *dap; + + LIST_FOREACH(dap, &pagedep->pd_pendinghd, da_pdlist) + if (dap->da_offset > blkoff) + panic("cancel_pagedep: diradd %p off %d > %d", + dap, dap->da_offset, blkoff); + for (i = 0; i < DAHASHSZ; i++) + LIST_FOREACH(dap, &pagedep->pd_diraddhd[i], da_pdlist) + if (dap->da_offset > blkoff) + panic("cancel_pagedep: diradd %p off %d > %d", + dap, dap->da_offset, blkoff); + return (0); + } + /* + * There should be no directory add dependencies present + * as the directory could not be truncated until all + * children were removed. + */ + KASSERT(LIST_FIRST(&pagedep->pd_pendinghd) == NULL, + ("deallocate_dependencies: pendinghd != NULL")); + for (i = 0; i < DAHASHSZ; i++) + KASSERT(LIST_FIRST(&pagedep->pd_diraddhd[i]) == NULL, + ("deallocate_dependencies: diraddhd != NULL")); + if ((pagedep->pd_state & NEWBLOCK) != 0) + free_newdirblk(pagedep->pd_newdirblk); + if (free_pagedep(pagedep) == 0) + panic("Failed to free pagedep %p", pagedep); return (0); } @@ -5739,58 +6606,82 @@ static int * be reallocated to a new vnode. The buffer must be locked, thus, * no I/O completion operations can occur while we are manipulating * its associated dependencies. The mutex is held so that other I/O's - * associated with related dependencies do not occur. Returns 1 if - * all dependencies were cleared, 0 otherwise. + * associated with related dependencies do not occur. */ static int -deallocate_dependencies(bp, inodedep, freeblks, off) +deallocate_dependencies(bp, freeblks, off) struct buf *bp; - struct inodedep *inodedep; struct freeblks *freeblks; int off; { - struct worklist *wk; struct indirdep *indirdep; - struct allocindir *aip; struct pagedep *pagedep; + struct allocdirect *adp; + struct worklist *wk, *wkn; - mtx_assert(&lk, MA_OWNED); - while ((wk = LIST_FIRST(&bp->b_dep)) != NULL) { + ACQUIRE_LOCK(&lk); + LIST_FOREACH_SAFE(wk, &bp->b_dep, wk_list, wkn) { switch (wk->wk_type) { - case D_INDIRDEP: indirdep = WK_INDIRDEP(wk); if (bp->b_lblkno >= 0 || bp->b_blkno != indirdep->ir_savebp->b_lblkno) panic("deallocate_dependencies: not indir"); - cancel_indirdep(indirdep, bp, inodedep, freeblks); + cancel_indirdep(indirdep, bp, freeblks); continue; case D_PAGEDEP: pagedep = WK_PAGEDEP(wk); - if (cancel_pagedep(pagedep, inodedep, freeblks)) - return (0); + if (cancel_pagedep(pagedep, freeblks, off)) { + FREE_LOCK(&lk); + return (ERESTART); + } continue; case D_ALLOCINDIR: - aip = WK_ALLOCINDIR(wk); - cancel_allocindir(aip, inodedep, freeblks); + /* + * Simply remove the allocindir, we'll find it via + * the indirdep where we can clear pointers if + * needed. + */ + WORKLIST_REMOVE(wk); continue; + case D_FREEWORK: + /* + * A truncation is waiting for the zero'd pointers + * to be written. It can be freed when the freeblks + * is journaled. + */ + WORKLIST_REMOVE(wk); + wk->wk_state |= ONDEPLIST; + WORKLIST_INSERT(&freeblks->fb_freeworkhd, wk); + break; + case D_ALLOCDIRECT: - case D_INODEDEP: + adp = WK_ALLOCDIRECT(wk); + if (off != 0) + continue; + /* FALLTHROUGH */ + default: panic("deallocate_dependencies: Unexpected type %s", TYPENAME(wk->wk_type)); /* NOTREACHED */ - - default: - panic("deallocate_dependencies: Unknown type %s", - TYPENAME(wk->wk_type)); - /* NOTREACHED */ } } + FREE_LOCK(&lk); + /* + * Don't throw away this buf, we were partially truncating and + * some deps may always remain. + */ + if (off) { + allocbuf(bp, off); + bp->b_vflags |= BV_SCANNED; + return (EBUSY); + } + bp->b_flags |= B_INVAL | B_NOCACHE; - return (1); + return (0); } /* @@ -5800,20 +6691,36 @@ static int * space is no longer pointed to by the inode or in the bitmap. */ static void -cancel_allocdirect(adphead, adp, freeblks, delay) +cancel_allocdirect(adphead, adp, freeblks) struct allocdirectlst *adphead; struct allocdirect *adp; struct freeblks *freeblks; - int delay; { struct freework *freework; struct newblk *newblk; struct worklist *wk; - ufs_lbn_t lbn; TAILQ_REMOVE(adphead, adp, ad_next); newblk = (struct newblk *)adp; + freework = NULL; /* + * Find the correct freework structure. + */ + LIST_FOREACH(wk, &freeblks->fb_freeworkhd, wk_list) { + if (wk->wk_type != D_FREEWORK) + continue; + freework = WK_FREEWORK(wk); + if (freework->fw_blkno == newblk->nb_newblkno) + break; + } + if (freework == NULL) + panic("cancel_allocdirect: Freework not found"); + /* + * If a newblk exists at all we still have the journal entry that + * initiated the allocation so we do not need to journal the free. + */ + cancel_jfreeblk(freeblks, freework->fw_blkno); + /* * If the journal hasn't been written the jnewblk must be passed * to the call to ffs_blkfree that reclaims the space. We accomplish * this by linking the journal dependency into the freework to be @@ -5821,33 +6728,9 @@ static void * been written we can simply reclaim the journal space when the * freeblks work is complete. */ - if (newblk->nb_jnewblk == NULL) { - if (cancel_newblk(newblk, NULL, &freeblks->fb_jwork) != NULL) - panic("cancel_allocdirect: Unexpected dependency"); - goto found; - } - lbn = newblk->nb_jnewblk->jn_lbn; - /* - * Find the correct freework structure so it releases the canceled - * journal when the bitmap is cleared. This preserves rollback - * until the allocation is reverted. - */ - LIST_FOREACH(wk, &freeblks->fb_freeworkhd, wk_list) { - freework = WK_FREEWORK(wk); - if (freework->fw_lbn != lbn) - continue; - freework->fw_jnewblk = cancel_newblk(newblk, &freework->fw_list, - &freework->fw_jwork); - goto found; - } - panic("cancel_allocdirect: Freework not found for lbn %jd\n", lbn); -found: - if (delay) - WORKLIST_INSERT(&adp->ad_inodedep->id_bufwait, - &newblk->nb_list); - else - free_newblk(newblk); - return; + freework->fw_jnewblk = cancel_newblk(newblk, &freework->fw_list, + &freeblks->fb_jwork); + WORKLIST_INSERT(&freeblks->fb_freeworkhd, &newblk->nb_list); } @@ -5865,33 +6748,18 @@ cancel_newblk(newblk, wk, wkhd) struct worklist *wk; struct workhead *wkhd; { - struct indirdep *indirdep; - struct allocindir *aip; struct jnewblk *jnewblk; - while ((indirdep = LIST_FIRST(&newblk->nb_indirdeps)) != NULL) { - indirdep->ir_state &= ~ONDEPLIST; - LIST_REMOVE(indirdep, ir_next); - /* - * If an indirdep is not on the buf worklist we need to - * free it here as deallocate_dependencies() will never - * find it. These pointers were never visible on disk and - * can be discarded immediately. - */ - while ((aip = LIST_FIRST(&indirdep->ir_completehd)) != NULL) { - LIST_REMOVE(aip, ai_next); - if (cancel_newblk(&aip->ai_block, NULL, wkhd) != NULL) - panic("cancel_newblk: aip has journal entry"); - free_newblk(&aip->ai_block); - } - /* - * If this indirdep is not attached to a buf it was simply - * waiting on completion to clear completehd. free_indirdep() - * asserts that nothing is dangling. - */ - if ((indirdep->ir_state & ONWORKLIST) == 0) - free_indirdep(indirdep); - } + newblk->nb_state |= GOINGAWAY; + /* + * Previously we traversed the completedhd on each indirdep + * attached to this newblk to cancel them and gather journal + * work. Since we need only the oldest journal segment and + * the lowest point on the tree will always have the oldest + * journal segment we are free to release the segments + * of any subordinates and may leave the indirdep list to + * indirdep_complete() when this newblk is freed. + */ if (newblk->nb_state & ONDEPLIST) { newblk->nb_state &= ~ONDEPLIST; LIST_REMOVE(newblk, nb_deps); @@ -5904,17 +6772,44 @@ cancel_newblk(newblk, wk, wkhd) * superseding operation completes. */ jnewblk = newblk->nb_jnewblk; - if (jnewblk != NULL) { + if (jnewblk != NULL && wk != NULL) { newblk->nb_jnewblk = NULL; jnewblk->jn_dep = wk; } if (!LIST_EMPTY(&newblk->nb_jwork)) jwork_move(wkhd, &newblk->nb_jwork); + /* + * When truncating we must free the newdirblk early to remove + * the pagedep from the hash before returning. + */ + if ((wk = LIST_FIRST(&newblk->nb_newdirblk)) != NULL) + free_newdirblk(WK_NEWDIRBLK(wk)); + if (!LIST_EMPTY(&newblk->nb_newdirblk)) + panic("cancel_newblk: extra newdirblk"); return (jnewblk); } /* + * Schedule the freefrag associated with a newblk to be released once + * the pointers are written and the previous block is no longer needed. + */ +static void +newblk_freefrag(newblk) + struct newblk *newblk; +{ + struct freefrag *freefrag; + + if (newblk->nb_freefrag == NULL) + return; + freefrag = newblk->nb_freefrag; + newblk->nb_freefrag = NULL; + freefrag->ff_state |= COMPLETE; + if ((freefrag->ff_state & ALLCOMPLETE) == ALLCOMPLETE) + add_to_worklist(&freefrag->ff_list, 0); +} + +/* * Free a newblk. Generate a new freefrag work request if appropriate. * This must be called after the inode pointer and any direct block pointers * are valid or fully removed via truncate or frag extension. @@ -5924,34 +6819,23 @@ free_newblk(newblk) struct newblk *newblk; { struct indirdep *indirdep; - struct newdirblk *newdirblk; - struct freefrag *freefrag; struct worklist *wk; + KASSERT(newblk->nb_jnewblk == NULL, + ("free_newblk; jnewblk %p still attached", newblk->nb_jnewblk)); mtx_assert(&lk, MA_OWNED); + newblk_freefrag(newblk); if (newblk->nb_state & ONDEPLIST) LIST_REMOVE(newblk, nb_deps); if (newblk->nb_state & ONWORKLIST) WORKLIST_REMOVE(&newblk->nb_list); LIST_REMOVE(newblk, nb_hash); - if ((freefrag = newblk->nb_freefrag) != NULL) { - freefrag->ff_state |= COMPLETE; - if ((freefrag->ff_state & ALLCOMPLETE) == ALLCOMPLETE) - add_to_worklist(&freefrag->ff_list, 0); - } - if ((wk = LIST_FIRST(&newblk->nb_newdirblk)) != NULL) { - newdirblk = WK_NEWDIRBLK(wk); - WORKLIST_REMOVE(&newdirblk->db_list); - if (!LIST_EMPTY(&newblk->nb_newdirblk)) - panic("free_newblk: extra newdirblk"); - free_newdirblk(newdirblk); - } - while ((indirdep = LIST_FIRST(&newblk->nb_indirdeps)) != NULL) { - indirdep->ir_state |= DEPCOMPLETE; + if ((wk = LIST_FIRST(&newblk->nb_newdirblk)) != NULL) + free_newdirblk(WK_NEWDIRBLK(wk)); + if (!LIST_EMPTY(&newblk->nb_newdirblk)) + panic("free_newblk: extra newdirblk"); + while ((indirdep = LIST_FIRST(&newblk->nb_indirdeps)) != NULL) indirdep_complete(indirdep); - } - KASSERT(newblk->nb_jnewblk == NULL, - ("free_newblk; jnewblk %p still attached", newblk->nb_jnewblk)); handle_jwork(&newblk->nb_jwork); newblk->nb_list.wk_type = D_NEWBLK; WORKITEM_FREE(newblk, D_NEWBLK); @@ -5968,9 +6852,9 @@ free_newdirblk(newdirblk) struct pagedep *pagedep; struct diradd *dap; struct worklist *wk; - int i; mtx_assert(&lk, MA_OWNED); + WORKLIST_REMOVE(&newdirblk->db_list); /* * If the pagedep is still linked onto the directory buffer * dependency chain, then some of the entries on the @@ -5983,21 +6867,13 @@ free_newdirblk(newdirblk) */ pagedep = newdirblk->db_pagedep; pagedep->pd_state &= ~NEWBLOCK; - if ((pagedep->pd_state & ONWORKLIST) == 0) + if ((pagedep->pd_state & ONWORKLIST) == 0) { while ((dap = LIST_FIRST(&pagedep->pd_pendinghd)) != NULL) free_diradd(dap, NULL); - /* - * If no dependencies remain, the pagedep will be freed. - */ - for (i = 0; i < DAHASHSZ; i++) - if (!LIST_EMPTY(&pagedep->pd_diraddhd[i])) - break; - if (i == DAHASHSZ && (pagedep->pd_state & ONWORKLIST) == 0 && - LIST_EMPTY(&pagedep->pd_jmvrefhd)) { - KASSERT(LIST_FIRST(&pagedep->pd_dirremhd) == NULL, - ("free_newdirblk: Freeing non-free pagedep %p", pagedep)); - LIST_REMOVE(pagedep, pd_hash); - WORKITEM_FREE(pagedep, D_PAGEDEP); + /* + * If no dependencies remain, the pagedep will be freed. + */ + free_pagedep(pagedep); } /* Should only ever be one item in the list. */ while ((wk = LIST_FIRST(&newdirblk->db_mkdir)) != NULL) { @@ -6020,6 +6896,7 @@ softdep_freefile(pvp, ino, mode) struct inode *ip = VTOI(pvp); struct inodedep *inodedep; struct freefile *freefile; + struct freeblks *freeblks; /* * This sets up the inode de-allocation dependency. @@ -6048,28 +6925,38 @@ softdep_freefile(pvp, ino, mode) */ ACQUIRE_LOCK(&lk); inodedep_lookup(pvp->v_mount, ino, 0, &inodedep); - /* - * Remove this inode from the unlinked list and set - * GOINGAWAY as appropriate to indicate that this inode - * will never be written. - */ - if (inodedep && inodedep->id_state & UNLINKED) { + if (inodedep) { /* - * Save the journal work to be freed with the bitmap - * before we clear UNLINKED. Otherwise it can be lost - * if the inode block is written. + * Clear out freeblks that no longer need to reference + * this inode. */ - handle_bufwait(inodedep, &freefile->fx_jwork); - clear_unlinked_inodedep(inodedep); - /* Re-acquire inodedep as we've dropped lk. */ - inodedep_lookup(pvp->v_mount, ino, 0, &inodedep); + while ((freeblks = + TAILQ_FIRST(&inodedep->id_freeblklst)) != NULL) { + TAILQ_REMOVE(&inodedep->id_freeblklst, freeblks, + fb_next); + freeblks->fb_state &= ~ONDEPLIST; + } + /* + * Remove this inode from the unlinked list. + */ + if (inodedep->id_state & UNLINKED) { + /* + * Save the journal work to be freed with the bitmap + * before we clear UNLINKED. Otherwise it can be lost + * if the inode block is written. + */ + handle_bufwait(inodedep, &freefile->fx_jwork); + clear_unlinked_inodedep(inodedep); + /* Re-acquire inodedep as we've dropped lk. */ + inodedep_lookup(pvp->v_mount, ino, 0, &inodedep); + } } if (inodedep == NULL || check_inode_unwritten(inodedep)) { FREE_LOCK(&lk); handle_workitem_freefile(freefile); return; } - if (inodedep && (inodedep->id_state & DEPCOMPLETE) == 0) + if ((inodedep->id_state & DEPCOMPLETE) == 0) inodedep->id_state |= GOINGAWAY; WORKLIST_INSERT(&inodedep->id_inowait, &freefile->fx_list); FREE_LOCK(&lk); @@ -6154,6 +7041,7 @@ free_inodedep(inodedep) !TAILQ_EMPTY(&inodedep->id_newinoupdt) || !TAILQ_EMPTY(&inodedep->id_extupdt) || !TAILQ_EMPTY(&inodedep->id_newextupdt) || + !TAILQ_EMPTY(&inodedep->id_freeblklst) || inodedep->id_mkdiradd != NULL || inodedep->id_nlinkdelta != 0 || inodedep->id_savedino1 != NULL) @@ -6181,57 +7069,82 @@ freework_freeblock(freework) struct ufsmount *ump; struct workhead wkhd; struct fs *fs; - int pending; int bsize; int needj; + mtx_assert(&lk, MA_OWNED); + /* + * Handle partial truncate separately. + */ + if (freework->fw_indir) { + complete_trunc_indir(freework); + return; + } freeblks = freework->fw_freeblks; ump = VFSTOUFS(freeblks->fb_list.wk_mp); fs = ump->um_fs; needj = freeblks->fb_list.wk_mp->mnt_kern_flag & MNTK_SUJ; bsize = lfragtosize(fs, freework->fw_frags); - pending = btodb(bsize); LIST_INIT(&wkhd); /* + * DEPCOMPLETE is cleared in indirblk_insert() if the block lives + * on the indirblk hashtable and prevents premature freeing. + */ + freework->fw_state |= DEPCOMPLETE; + /* + * SUJ needs to wait for the segment referencing freed indirect + * blocks to expire so that we know the checker will not confuse + * a re-allocated indirect block with its old contents. + */ + if (needj && freework->fw_lbn <= -NDADDR) + indirblk_insert(freework); + /* * If we are canceling an existing jnewblk pass it to the free * routine, otherwise pass the freeblk which will ultimately * release the freeblks. If we're not journaling, we can just * free the freeblks immediately. */ - ACQUIRE_LOCK(&lk); - LIST_SWAP(&wkhd, &freework->fw_jwork, worklist, wk_list); jnewblk = freework->fw_jnewblk; if (jnewblk != NULL) { - /* Could've already been canceled in indir_trunc(). */ - if ((jnewblk->jn_state & GOINGAWAY) == 0) - cancel_jnewblk(jnewblk, &wkhd); + cancel_jnewblk(jnewblk, &wkhd); needj = 0; - } else if (needj) + } else if (needj) { + freeblks->fb_cgwait++; WORKLIST_INSERT(&wkhd, &freework->fw_list); - freeblks->fb_chkcnt -= pending; + } + freeblks->fb_freecnt += btodb(bsize); FREE_LOCK(&lk); + ffs_blkfree(ump, fs, freeblks->fb_devvp, freework->fw_blkno, bsize, + freeblks->fb_inum, &wkhd); + ACQUIRE_LOCK(&lk); /* - * extattr blocks don't show up in pending blocks. XXX why? - */ - if (freework->fw_lbn >= 0 || freework->fw_lbn <= -NDADDR) { - UFS_LOCK(ump); - fs->fs_pendingblocks -= pending; - UFS_UNLOCK(ump); - } - ffs_blkfree(ump, fs, freeblks->fb_devvp, freework->fw_blkno, - bsize, freeblks->fb_previousinum, &wkhd); - if (needj) - return; - /* * The jnewblk will be discarded and the bits in the map never * made it to disk. We can immediately free the freeblk. */ - ACQUIRE_LOCK(&lk); - handle_written_freework(freework); - FREE_LOCK(&lk); + if (needj == 0) + handle_written_freework(freework, 0); } /* + * We enqueue freework items that need processing back on the freeblks and + * add the freeblks to the worklist. This makes it easier to find all work + * required to flush a truncation in process_truncates(). + */ +static void +freework_enqueue(freework) + struct freework *freework; +{ + struct freeblks *freeblks; + + freeblks = freework->fw_freeblks; + WORKLIST_INSERT(&freeblks->fb_freeworkhd, &freework->fw_list); + if ((freeblks->fb_state & + (ONWORKLIST | INPROGRESS | ALLCOMPLETE)) == ALLCOMPLETE && + LIST_EMPTY(&freeblks->fb_jblkdephd)) + add_to_worklist(&freeblks->fb_list, WK_NODELAY); +} + +/* * Start, continue, or finish the process of freeing an indirect block tree. * The free operation may be paused at any point with fw_off containing the * offset to restart from. This enables us to implement some flow control @@ -6246,70 +7159,52 @@ handle_workitem_indirblk(freework) struct ufsmount *ump; struct fs *fs; - freeblks = freework->fw_freeblks; ump = VFSTOUFS(freeblks->fb_list.wk_mp); fs = ump->um_fs; - if (freework->fw_off == NINDIR(fs)) + if (freework->fw_state & DEPCOMPLETE) { + handle_written_freework(freework, 0); + return; + } + if (freework->fw_off == NINDIR(fs)) { freework_freeblock(freework); - else - indir_trunc(freework, fsbtodb(fs, freework->fw_blkno), - freework->fw_lbn); + return; + } + FREE_LOCK(&lk); + indir_trunc(freework, fsbtodb(fs, freework->fw_blkno), + freework->fw_lbn); + ACQUIRE_LOCK(&lk); } /* * Called when a freework structure attached to a cg buf is written. The * ref on either the parent or the freeblks structure is released and - * either may be added to the worklist if it is the final ref. + * the freeblks is added back to the worklist if there is more work to do. */ static void -handle_written_freework(freework) +handle_written_freework(freework, cgwrite) struct freework *freework; + int cgwrite; { struct freeblks *freeblks; struct freework *parent; - struct jsegdep *jsegdep; - struct worklist *wk; - int needj; - needj = 0; freeblks = freework->fw_freeblks; parent = freework->fw_parent; - /* - * SUJ needs to wait for the segment referencing freed indirect - * blocks to expire so that we know the checker will not confuse - * a re-allocated indirect block with its old contents. - */ - if (freework->fw_lbn <= -NDADDR && - freework->fw_list.wk_mp->mnt_kern_flag & MNTK_SUJ) { - LIST_FOREACH(wk, &freeblks->fb_jwork, wk_list) - if (wk->wk_type == D_JSEGDEP) - break; - if (wk) { - jsegdep = WK_JSEGDEP(wk); - LIST_INSERT_HEAD(&jsegdep->jd_seg->js_indirs, - freework, fw_next); - WORKLIST_INSERT(INDIR_HASH(freework->fw_list.wk_mp, - freework->fw_blkno), &freework->fw_list); - needj = 1; - } + freeblks->fb_cgwait -= cgwrite; + freework->fw_state |= COMPLETE; + if ((freework->fw_state & ALLCOMPLETE) == ALLCOMPLETE) + WORKITEM_FREE(freework, D_FREEWORK); + if (parent) { + if (--parent->fw_ref == 0) + freework_enqueue(parent); + return; } - if (parent) { - if (--parent->fw_ref != 0) - parent = NULL; - freeblks = NULL; - } else if (--freeblks->fb_ref != 0) - freeblks = NULL; - if (needj == 0) - WORKITEM_FREE(freework, D_FREEWORK); - /* - * Don't delay these block frees or it takes an intolerable amount - * of time to process truncates and free their journal entries. - */ - if (freeblks) - add_to_worklist(&freeblks->fb_list, 1); - if (parent) - add_to_worklist(&parent->fw_list, 1); + if (--freeblks->fb_ref != 0) + return; + if ((freeblks->fb_state & (ALLCOMPLETE | ONWORKLIST | INPROGRESS)) == + ALLCOMPLETE && LIST_EMPTY(&freeblks->fb_jblkdephd)) + add_to_worklist(&freeblks->fb_list, WK_NODELAY); } /* @@ -6320,38 +7215,73 @@ static void * to the number of blocks allocated for the file) are also * performed in this function. */ -static void +static int handle_workitem_freeblocks(freeblks, flags) struct freeblks *freeblks; int flags; { struct freework *freework; + struct newblk *newblk; + struct allocindir *aip; + struct ufsmount *ump; struct worklist *wk; - KASSERT(LIST_EMPTY(&freeblks->fb_jfreeblkhd), + KASSERT(LIST_EMPTY(&freeblks->fb_jblkdephd), ("handle_workitem_freeblocks: Journal entries not written.")); - if (LIST_EMPTY(&freeblks->fb_freeworkhd)) { - handle_complete_freeblocks(freeblks); - return; - } - freeblks->fb_ref++; + ump = VFSTOUFS(freeblks->fb_list.wk_mp); + ACQUIRE_LOCK(&lk); while ((wk = LIST_FIRST(&freeblks->fb_freeworkhd)) != NULL) { - KASSERT(wk->wk_type == D_FREEWORK, - ("handle_workitem_freeblocks: Unknown type %s", - TYPENAME(wk->wk_type))); - WORKLIST_REMOVE_UNLOCKED(wk); - freework = WK_FREEWORK(wk); - if (freework->fw_lbn <= -NDADDR) - handle_workitem_indirblk(freework); - else - freework_freeblock(freework); + WORKLIST_REMOVE(wk); + switch (wk->wk_type) { + case D_DIRREM: + wk->wk_state |= COMPLETE; + add_to_worklist(wk, 0); + continue; + + case D_ALLOCDIRECT: + free_newblk(WK_NEWBLK(wk)); + continue; + + case D_ALLOCINDIR: + aip = WK_ALLOCINDIR(wk); + freework = NULL; + if (aip->ai_state & DELAYEDFREE) { + FREE_LOCK(&lk); + freework = newfreework(ump, freeblks, NULL, + aip->ai_lbn, aip->ai_newblkno, + ump->um_fs->fs_frag, 0, 0); + ACQUIRE_LOCK(&lk); + } + newblk = WK_NEWBLK(wk); + if (newblk->nb_jnewblk) { + freework->fw_jnewblk = newblk->nb_jnewblk; + newblk->nb_jnewblk->jn_dep = &freework->fw_list; + newblk->nb_jnewblk = NULL; + } + free_newblk(newblk); + continue; + + case D_FREEWORK: + freework = WK_FREEWORK(wk); + if (freework->fw_lbn <= -NDADDR) + handle_workitem_indirblk(freework); + else + freework_freeblock(freework); + continue; + default: + panic("handle_workitem_freeblocks: Unknown type %s", + TYPENAME(wk->wk_type)); + } } - ACQUIRE_LOCK(&lk); - if (--freeblks->fb_ref != 0) + if (freeblks->fb_ref != 0) { + freeblks->fb_state &= ~INPROGRESS; + wake_worklist(&freeblks->fb_list); freeblks = NULL; + } FREE_LOCK(&lk); if (freeblks) - handle_complete_freeblocks(freeblks); + return handle_complete_freeblocks(freeblks, flags); + return (0); } /* @@ -6359,41 +7289,64 @@ handle_workitem_freeblocks(freeblks, flags) * freeblocks dependency and any journal work awaiting completion. This * can not be called until all other dependencies are stable on disk. */ -static void -handle_complete_freeblocks(freeblks) +static int +handle_complete_freeblocks(freeblks, flags) struct freeblks *freeblks; + int flags; { + struct inodedep *inodedep; struct inode *ip; struct vnode *vp; struct fs *fs; struct ufsmount *ump; - int flags; + ufs2_daddr_t spare; ump = VFSTOUFS(freeblks->fb_list.wk_mp); fs = ump->um_fs; - flags = LK_NOWAIT; + flags = LK_EXCLUSIVE | flags; + spare = freeblks->fb_freecnt - freeblks->fb_chkcnt; /* - * If we still have not finished background cleanup, then check - * to see if the block count needs to be adjusted. + * If we did not release the expected number of blocks we may have + * to adjust the inode block count here. Only do so if it wasn't + * a truncation to zero and the modrev still matches. */ - if (freeblks->fb_chkcnt != 0 && (fs->fs_flags & FS_UNCLEAN) != 0 && - ffs_vgetf(freeblks->fb_list.wk_mp, freeblks->fb_previousinum, - (flags & LK_NOWAIT) | LK_EXCLUSIVE, &vp, FFSV_FORCEINSMQ) == 0) { + if (spare && freeblks->fb_len != 0) { + if (ffs_vgetf(freeblks->fb_list.wk_mp, freeblks->fb_inum, + flags, &vp, FFSV_FORCEINSMQ) != 0) + return (EBUSY); ip = VTOI(vp); - DIP_SET(ip, i_blocks, DIP(ip, i_blocks) + freeblks->fb_chkcnt); - ip->i_flag |= IN_CHANGE; + if (DIP(ip, i_modrev) == freeblks->fb_modrev) { + DIP_SET(ip, i_blocks, DIP(ip, i_blocks) - spare); + ip->i_flag |= IN_CHANGE; + /* + * We must wait so this happens before the + * journal is reclaimed. + */ + ffs_update(vp, 1); + } vput(vp); } - - if (!(freeblks->fb_chkcnt == 0 || - ((fs->fs_flags & FS_UNCLEAN) != 0 && (flags & LK_NOWAIT) == 0))) - printf( - "handle_workitem_freeblocks: inode %ju block count %jd\n", - (uintmax_t)freeblks->fb_previousinum, - (intmax_t)freeblks->fb_chkcnt); - + if (freeblks->fb_chkcnt) { + UFS_LOCK(ump); + fs->fs_pendingblocks -= freeblks->fb_chkcnt; + UFS_UNLOCK(ump); + } +#ifdef QUOTA + /* Handle spare. */ + if (spare) + quotaadj(freeblks->fb_quota, ump, -spare); + quotarele(freeblks->fb_quota); +#endif ACQUIRE_LOCK(&lk); + if (freeblks->fb_state & ONDEPLIST) { + inodedep_lookup(freeblks->fb_list.wk_mp, freeblks->fb_inum, + 0, &inodedep); + TAILQ_REMOVE(&inodedep->id_freeblklst, freeblks, fb_next); + freeblks->fb_state &= ~ONDEPLIST; + if (TAILQ_EMPTY(&inodedep->id_freeblklst)) + free_inodedep(inodedep); + } /* * All of the freeblock deps must be complete prior to this call * so it's now safe to complete earlier outstanding journal entries. @@ -6401,13 +7354,19 @@ handle_workitem_freeblocks(freeblks, flags) handle_jwork(&freeblks->fb_jwork); WORKITEM_FREE(freeblks, D_FREEBLKS); FREE_LOCK(&lk); + return (0); } /* - * Release blocks associated with the inode ip and stored in the indirect + * Release blocks associated with the freeblks and stored in the indirect * block dbn. If level is greater than SINGLE, the block is an indirect block * and recursive calls to indirtrunc must be used to cleanse other indirect * blocks. + * + * This handles partial and complete truncation of blocks. Partial is noted + * with goingaway == 0. In this case the freework is completed after the + * zero'd indirects are written to disk. For full truncation the freework + * is completed after the block is freed. */ static void indir_trunc(freework, dbn, lbn) @@ -6417,165 +7376,111 @@ indir_trunc(freework, dbn, lbn) { struct freework *nfreework; struct workhead wkhd; - struct jnewblk *jnewblkn; - struct jnewblk *jnewblk; struct freeblks *freeblks; struct buf *bp; struct fs *fs; - struct worklist *wkn; - struct worklist *wk; struct indirdep *indirdep; struct ufsmount *ump; ufs1_daddr_t *bap1 = 0; ufs2_daddr_t nb, nnb, *bap2 = 0; - ufs_lbn_t lbnadd; + ufs_lbn_t lbnadd, nlbn; int i, nblocks, ufs1fmt; int fs_pendingblocks; + int goingaway; int freedeps; int needj; int level; int cnt; - LIST_INIT(&wkhd); - level = lbn_level(lbn); - if (level == -1) - panic("indir_trunc: Invalid lbn %jd\n", lbn); freeblks = freework->fw_freeblks; ump = VFSTOUFS(freeblks->fb_list.wk_mp); fs = ump->um_fs; - fs_pendingblocks = 0; - freedeps = 0; - needj = UFSTOVFS(ump)->mnt_kern_flag & MNTK_SUJ; - lbnadd = lbn_offset(fs, level); /* - * Get buffer of block pointers to be freed. This routine is not - * called until the zero'ed inode has been written, so it is safe - * to free blocks as they are encountered. Because the inode has - * been zero'ed, calls to bmap on these blocks will fail. So, we - * have to use the on-disk address and the block device for the - * filesystem to look them up. If the file was deleted before its - * indirect blocks were all written to disk, the routine that set - * us up (deallocate_dependencies) will have arranged to leave - * a complete copy of the indirect block in memory for our use. - * Otherwise we have to read the blocks in from the disk. + * Get buffer of block pointers to be freed. There are three cases: + * + * 1) Partial truncate caches the indirdep pointer in the freework + * which provides us a back copy to the save bp which holds the + * pointers we want to clear. When this completes the zero + * pointers are written to the real copy. + * 2) The indirect is being completely truncated, cancel_indirdep() + * eliminated the real copy and placed the indirdep on the saved + * copy. The indirdep and buf are discarded when this completes. + * 3) The indirect was not in memory, we read a copy off of the disk + * using the devvp and drop and invalidate the buffer when we're + * done. */ -#ifdef notyet - bp = getblk(freeblks->fb_devvp, dbn, (int)fs->fs_bsize, 0, 0, - GB_NOCREAT); -#else - bp = incore(&freeblks->fb_devvp->v_bufobj, dbn); -#endif + goingaway = 1; + indirdep = NULL; + if (freework->fw_indir != NULL) { + goingaway = 0; + indirdep = freework->fw_indir; + bp = indirdep->ir_savebp; + if (bp == NULL || bp->b_blkno != dbn) + panic("indir_trunc: Bad saved buf %p blkno %jd", + bp, (intmax_t)dbn); + } else if ((bp = incore(&freeblks->fb_devvp->v_bufobj, dbn)) != NULL) { + /* + * The lock prevents the buf dep list from changing and + * indirects on devvp should only ever have one dependency. + */ + indirdep = WK_INDIRDEP(LIST_FIRST(&bp->b_dep)); + if (indirdep == NULL || (indirdep->ir_state & GOINGAWAY) == 0) + panic("indir_trunc: Bad indirdep %p from buf %p", + indirdep, bp); + } else if (bread(freeblks->fb_devvp, dbn, (int)fs->fs_bsize, + NOCRED, &bp) != 0) { + brelse(bp); + return; + } ACQUIRE_LOCK(&lk); - if (bp != NULL && (wk = LIST_FIRST(&bp->b_dep)) != NULL) { - if (wk->wk_type != D_INDIRDEP || - (wk->wk_state & GOINGAWAY) == 0) - panic("indir_trunc: lost indirdep %p", wk); - indirdep = WK_INDIRDEP(wk); - LIST_SWAP(&wkhd, &indirdep->ir_jwork, worklist, wk_list); - LIST_FOREACH_SAFE(jnewblk, &indirdep->ir_jnewblkhd, - jn_indirdeps, jnewblkn) { + /* + * If we have an indirdep we need to enforce the truncation order + * and discard it when it is complete. + */ + if (indirdep) { + if (freework != TAILQ_FIRST(&indirdep->ir_trunc) && + !TAILQ_EMPTY(&indirdep->ir_trunc)) { /* - * XXX This cancel may cause some lengthy delay - * before the record is reclaimed below. + * Add the complete truncate to the list on the + * indirdep to enforce in-order processing. */ - LIST_REMOVE(jnewblk, jn_indirdeps); - cancel_jnewblk(jnewblk, &wkhd); - } - - free_indirdep(indirdep); - if (!LIST_EMPTY(&bp->b_dep)) - panic("indir_trunc: dangling dep %p", - LIST_FIRST(&bp->b_dep)); - ump->um_numindirdeps -= 1; - FREE_LOCK(&lk); - } else { -#ifdef notyet - if (bp) - brelse(bp); -#endif - FREE_LOCK(&lk); - if (bread(freeblks->fb_devvp, dbn, (int)fs->fs_bsize, - NOCRED, &bp) != 0) { - brelse(bp); + if (freework->fw_indir == NULL) + TAILQ_INSERT_TAIL(&indirdep->ir_trunc, + freework, fw_next); + FREE_LOCK(&lk); return; } + /* + * If we're goingaway, free the indirdep. Otherwise it will + * linger until the write completes. + */ + if (goingaway) { + free_indirdep(indirdep); + ump->um_numindirdeps -= 1; + } } - /* - * Recursively free indirect blocks. - */ + FREE_LOCK(&lk); + /* Initialize pointers depending on block size. */ if (ump->um_fstype == UFS1) { + bap1 = (ufs1_daddr_t *)bp->b_data; + nb = bap1[freework->fw_off]; ufs1fmt = 1; - bap1 = (ufs1_daddr_t *)bp->b_data; } else { + bap2 = (ufs2_daddr_t *)bp->b_data; + nb = bap2[freework->fw_off]; ufs1fmt = 0; - bap2 = (ufs2_daddr_t *)bp->b_data; } - - /* - * Reclaim indirect blocks which never made it to disk. - */ - cnt = 0; - LIST_FOREACH_SAFE(wk, &wkhd, wk_list, wkn) { - if (wk->wk_type != D_JNEWBLK) - continue; - /* XXX Is the lock necessary here for more than an assert? */ - ACQUIRE_LOCK(&lk); - WORKLIST_REMOVE(wk); - FREE_LOCK(&lk); - jnewblk = WK_JNEWBLK(wk); - if (jnewblk->jn_lbn > 0) - i = (jnewblk->jn_lbn - -lbn) / lbnadd; - else - i = (-(jnewblk->jn_lbn + level - 1) - -(lbn + level)) / - lbnadd; - KASSERT(i >= 0 && i < NINDIR(fs), - ("indir_trunc: Index out of range %d parent %jd lbn %jd level %d", - i, lbn, jnewblk->jn_lbn, level)); - /* Clear the pointer so it isn't found below. */ - if (ufs1fmt) { - nb = bap1[i]; - bap1[i] = 0; - } else { - nb = bap2[i]; - bap2[i] = 0; - } - KASSERT(nb == jnewblk->jn_blkno, - ("indir_trunc: Block mismatch %jd != %jd", - nb, jnewblk->jn_blkno)); - if (level != 0) { - ufs_lbn_t nlbn; - - nlbn = (lbn + 1) - (i * lbnadd); - nfreework = newfreework(ump, freeblks, freework, - nlbn, nb, fs->fs_frag, 0); - nfreework->fw_jnewblk = jnewblk; - freedeps++; - indir_trunc(nfreework, fsbtodb(fs, nb), nlbn); - } else { - struct workhead freewk; - - LIST_INIT(&freewk); - ACQUIRE_LOCK(&lk); - WORKLIST_INSERT(&freewk, wk); - FREE_LOCK(&lk); - ffs_blkfree(ump, fs, freeblks->fb_devvp, - jnewblk->jn_blkno, fs->fs_bsize, - freeblks->fb_previousinum, &freewk); - } - cnt++; - } - ACQUIRE_LOCK(&lk); - /* Any remaining journal work can be completed with freeblks. */ - jwork_move(&freeblks->fb_jwork, &wkhd); - FREE_LOCK(&lk); + level = lbn_level(lbn); + needj = UFSTOVFS(ump)->mnt_kern_flag & MNTK_SUJ; + lbnadd = lbn_offset(fs, level); nblocks = btodb(fs->fs_bsize); - if (ufs1fmt) - nb = bap1[0]; - else - nb = bap2[0]; nfreework = freework; + freedeps = 0; + cnt = 0; /* - * Reclaim on disk blocks. + * Reclaim blocks. Traverses into nested indirect levels and + * arranges for the current level to be freed when subordinates + * are free when journaling. */ for (i = freework->fw_off; i < NINDIR(fs); i++, nb = nnb) { if (i != NINDIR(fs) - 1) { @@ -6589,12 +7494,10 @@ indir_trunc(freework, dbn, lbn) continue; cnt++; if (level != 0) { - ufs_lbn_t nlbn; - nlbn = (lbn + 1) - (i * lbnadd); if (needj != 0) { nfreework = newfreework(ump, freeblks, freework, - nlbn, nb, fs->fs_frag, 0); + nlbn, nb, fs->fs_frag, 0, 0); freedeps++; } indir_trunc(nfreework, fsbtodb(fs, nb), nlbn); @@ -6614,85 +7517,105 @@ indir_trunc(freework, dbn, lbn) freedeps++; } ffs_blkfree(ump, fs, freeblks->fb_devvp, nb, - fs->fs_bsize, freeblks->fb_previousinum, &wkhd); + fs->fs_bsize, freeblks->fb_inum, &wkhd); } } + if (goingaway) { + bp->b_flags |= B_INVAL | B_NOCACHE; + brelse(bp); + } + fs_pendingblocks = 0; if (level == 0) fs_pendingblocks = (nblocks * cnt); /* - * If we're not journaling we can free the indirect now. Otherwise - * setup the ref counts and offset so this indirect can be completed - * when its children are free. + * If we are journaling set up the ref counts and offset so this + * indirect can be completed when its children are free. */ - if (needj == 0) { - fs_pendingblocks += nblocks; - dbn = dbtofsb(fs, dbn); - ffs_blkfree(ump, fs, freeblks->fb_devvp, dbn, fs->fs_bsize, - freeblks->fb_previousinum, NULL); + if (needj) { ACQUIRE_LOCK(&lk); - freeblks->fb_chkcnt -= fs_pendingblocks; - if (freework->fw_blkno == dbn) - handle_written_freework(freework); - FREE_LOCK(&lk); - freework = NULL; - } else { - ACQUIRE_LOCK(&lk); + freeblks->fb_freecnt += fs_pendingblocks; freework->fw_off = i; freework->fw_ref += freedeps; freework->fw_ref -= NINDIR(fs) + 1; - if (freework->fw_ref != 0) - freework = NULL; - freeblks->fb_chkcnt -= fs_pendingblocks; + if (level == 0) + freeblks->fb_cgwait += freedeps; + if (freework->fw_ref == 0) + freework_freeblock(freework); FREE_LOCK(&lk); + return; } - if (fs_pendingblocks) { - UFS_LOCK(ump); - fs->fs_pendingblocks -= fs_pendingblocks; - UFS_UNLOCK(ump); + /* + * If we're not journaling we can free the indirect now. + */ + fs_pendingblocks += nblocks; + dbn = dbtofsb(fs, dbn); + ffs_blkfree(ump, fs, freeblks->fb_devvp, dbn, fs->fs_bsize, + freeblks->fb_inum, NULL); + /* Non SUJ softdep does single-threaded truncations. */ + freeblks->fb_freecnt += fs_pendingblocks; + if (freework->fw_blkno == dbn) { + freework->fw_state |= ALLCOMPLETE; + ACQUIRE_LOCK(&lk); + handle_written_freework(freework, 0); + FREE_LOCK(&lk); } - bp->b_flags |= B_INVAL | B_NOCACHE; - brelse(bp); - if (freework) - handle_workitem_indirblk(freework); return; } /* - * Cancel an allocindir when it is removed via truncation. + * Cancel an allocindir when it is removed via truncation. When bp is not + * NULL the indirect never appeared on disk and is scheduled to be freed + * independently of the indir so we can more easily track journal work. */ static void -cancel_allocindir(aip, inodedep, freeblks) +cancel_allocindir(aip, bp, freeblks, trunc) struct allocindir *aip; - struct inodedep *inodedep; + struct buf *bp; struct freeblks *freeblks; + int trunc; { - struct jnewblk *jnewblk; + struct indirdep *indirdep; + struct freefrag *freefrag; struct newblk *newblk; + newblk = (struct newblk *)aip; + LIST_REMOVE(aip, ai_next); /* + * We must eliminate the pointer in bp if it must be freed on its + * own due to partial truncate or pending journal work. + */ + if (bp && (trunc || newblk->nb_jnewblk)) { + /* + * Clear the pointer and mark the aip to be freed + * directly if it never existed on disk. + */ + aip->ai_state |= DELAYEDFREE; + indirdep = aip->ai_indirdep; + if (indirdep->ir_state & UFS1FMT) + ((ufs1_daddr_t *)bp->b_data)[aip->ai_offset] = 0; + else + ((ufs2_daddr_t *)bp->b_data)[aip->ai_offset] = 0; + } + /* + * When truncating the previous pointer will be freed via + * savedbp. Eliminate the freefrag which would dup free. + */ + if (trunc && (freefrag = newblk->nb_freefrag) != NULL) { + newblk->nb_freefrag = NULL; + if (freefrag->ff_jdep) + cancel_jfreefrag( + WK_JFREEFRAG(freefrag->ff_jdep)); + jwork_move(&freeblks->fb_jwork, &freefrag->ff_jwork); + WORKITEM_FREE(freefrag, D_FREEFRAG); + } + /* * If the journal hasn't been written the jnewblk must be passed * to the call to ffs_blkfree that reclaims the space. We accomplish - * this by linking the journal dependency into the indirdep to be - * freed when indir_trunc() is called. If the journal has already - * been written we can simply reclaim the journal space when the - * freeblks work is complete. + * this by leaving the journal dependency on the newblk to be freed + * when a freework is created in handle_workitem_freeblocks(). */ - LIST_REMOVE(aip, ai_next); - newblk = (struct newblk *)aip; - if (newblk->nb_jnewblk == NULL) { - if (cancel_newblk(newblk, NULL, &freeblks->fb_jwork)) - panic("cancel_allocindir: Unexpected dependency."); - } else { - jnewblk = cancel_newblk(newblk, &aip->ai_indirdep->ir_list, - &aip->ai_indirdep->ir_jwork); - if (jnewblk) - LIST_INSERT_HEAD(&aip->ai_indirdep->ir_jnewblkhd, - jnewblk, jn_indirdeps); - } - if (inodedep && inodedep->id_state & DEPCOMPLETE) - WORKLIST_INSERT(&inodedep->id_bufwait, &newblk->nb_list); - else - free_newblk(newblk); + cancel_newblk(newblk, NULL, &freeblks->fb_jwork); + WORKLIST_INSERT(&freeblks->fb_freeworkhd, &newblk->nb_list); } /* @@ -6750,13 +7673,15 @@ setup_newdir(dap, newinum, dinum, newdirbp, mkdirp * any subsequent additions are not marked live until the * block is reachable via the inode. */ - if (pagedep_lookup(mp, newinum, 0, 0, &pagedep) == 0) + if (pagedep_lookup(mp, newdirbp, newinum, 0, 0, &pagedep) == 0) panic("setup_newdir: lost pagedep"); LIST_FOREACH(wk, &newdirbp->b_dep, wk_list) if (wk->wk_type == D_ALLOCDIRECT) break; if (wk == NULL) panic("setup_newdir: lost allocdirect"); + if (pagedep->pd_state & NEWBLOCK) + panic("setup_newdir: NEWBLOCK already set"); newblk = WK_NEWBLK(wk); pagedep->pd_state |= NEWBLOCK; pagedep->pd_newdirblk = newdirblk; @@ -6788,7 +7713,7 @@ setup_newdir(dap, newinum, dinum, newdirbp, mkdirp WORKITEM_FREE(mkdir2, D_MKDIR); } else { LIST_INSERT_HEAD(&mkdirlisthd, mkdir2, md_mkdirs); - WORKLIST_INSERT(&inodedep->id_bufwait,&mkdir2->md_list); + WORKLIST_INSERT(&inodedep->id_bufwait, &mkdir2->md_list); } *mkdirp = mkdir2; @@ -6885,8 +7810,7 @@ softdep_setup_directory_add(bp, dp, diroffset, new /* * Link into parent directory pagedep to await its being written. */ - if (pagedep_lookup(mp, dp->i_number, lbn, DEPALLOC, &pagedep) == 0) - WORKLIST_INSERT(&bp->b_dep, &pagedep->pd_list); + pagedep_lookup(mp, bp, dp->i_number, lbn, DEPALLOC, &pagedep); #ifdef DEBUG if (diradd_lookup(pagedep, offset) != NULL) panic("softdep_setup_directory_add: %p already at off %d\n", @@ -7027,11 +7951,8 @@ softdep_change_directoryentry_offset(bp, dp, base, oldoffset = offset + (oldloc - base); newoffset = offset + (newloc - base); ACQUIRE_LOCK(&lk); - if (pagedep_lookup(mp, dp->i_number, lbn, flags, &pagedep) == 0) { - if (pagedep) - WORKLIST_INSERT(&bp->b_dep, &pagedep->pd_list); + if (pagedep_lookup(mp, bp, dp->i_number, lbn, flags, &pagedep) == 0) goto done; - } dap = diradd_lookup(pagedep, oldoffset); if (dap) { dap->da_offset = newoffset; @@ -7327,7 +8248,7 @@ softdep_setup_remove(bp, dp, ip, isrmdir) direct = LIST_EMPTY(&dirrem->dm_jremrefhd); FREE_LOCK(&lk); if (direct) - handle_workitem_remove(dirrem, NULL); + handle_workitem_remove(dirrem, 0); } } @@ -7367,7 +8288,7 @@ cancel_diradd_dotdot(ip, dirrem, jremref) struct diradd *dap; struct worklist *wk; - if (pagedep_lookup(UFSTOVFS(ip->i_ump), ip->i_number, 0, 0, + if (pagedep_lookup(UFSTOVFS(ip->i_ump), NULL, ip->i_number, 0, 0, &pagedep) == 0) return (jremref); dap = diradd_lookup(pagedep, DOTDOT_OFFSET); @@ -7536,10 +8457,10 @@ newdirrem(bp, dp, ip, isrmdir, prevdirremp) ACQUIRE_LOCK(&lk); lbn = lblkno(dp->i_fs, dp->i_offset); offset = blkoff(dp->i_fs, dp->i_offset); - if (pagedep_lookup(UFSTOVFS(dp->i_ump), dp->i_number, lbn, DEPALLOC, - &pagedep) == 0) - WORKLIST_INSERT(&bp->b_dep, &pagedep->pd_list); + pagedep_lookup(UFSTOVFS(dp->i_ump), bp, dp->i_number, lbn, DEPALLOC, + &pagedep); dirrem->dm_pagedep = pagedep; + dirrem->dm_offset = offset; /* * If we're renaming a .. link to a new directory, cancel any * existing MKDIR_PARENT mkdir. If it has already been canceled @@ -8092,10 +9013,10 @@ clear_unlinked_inodedep(inodedep) * This workitem decrements the inode's link count. * If the link count reaches zero, the file is removed. */ -static void -handle_workitem_remove(dirrem, xp) +static int +handle_workitem_remove(dirrem, flags) struct dirrem *dirrem; - struct vnode *xp; + int flags; { struct inodedep *inodedep; struct workhead dotdotwk; @@ -8105,7 +9026,6 @@ clear_unlinked_inodedep(inodedep) struct vnode *vp; struct inode *ip; ino_t oldinum; - int error; if (dirrem->dm_state & ONWORKLIST) panic("handle_workitem_remove: dirrem %p still on worklist", @@ -8113,12 +9033,9 @@ clear_unlinked_inodedep(inodedep) oldinum = dirrem->dm_oldinum; mp = dirrem->dm_list.wk_mp; ump = VFSTOUFS(mp); - if ((vp = xp) == NULL && - (error = ffs_vgetf(mp, oldinum, LK_EXCLUSIVE, &vp, - FFSV_FORCEINSMQ)) != 0) { - softdep_error("handle_workitem_remove: vget", error); - return; - } + flags |= LK_EXCLUSIVE; + if (ffs_vgetf(mp, oldinum, flags, &vp, FFSV_FORCEINSMQ) != 0) + return (EBUSY); ip = VTOI(vp); ACQUIRE_LOCK(&lk); if ((inodedep_lookup(mp, oldinum, 0, &inodedep)) == 0) @@ -8209,22 +9126,17 @@ clear_unlinked_inodedep(inodedep) if (inodedep == NULL || (inodedep->id_state & (DEPCOMPLETE | UNLINKED)) == UNLINKED || check_inode_unwritten(inodedep)) { - if (xp != NULL) - add_to_worklist(&dirrem->dm_list, 0); FREE_LOCK(&lk); - if (xp == NULL) { - vput(vp); - handle_workitem_remove(dirrem, NULL); - } - return; + vput(vp); + return handle_workitem_remove(dirrem, flags); } WORKLIST_INSERT(&inodedep->id_inowait, &dirrem->dm_list); FREE_LOCK(&lk); ip->i_flag |= IN_CHANGE; out: ffs_update(vp, 0); - if (xp == NULL) - vput(vp); + vput(vp); + return (0); } /* @@ -8318,7 +9230,7 @@ softdep_disk_io_initiation(bp) struct worklist marker; struct inodedep *inodedep; struct freeblks *freeblks; - struct jfreeblk *jfreeblk; + struct jblkdep *jblkdep; struct newblk *newblk; /* @@ -8370,19 +9282,18 @@ softdep_disk_io_initiation(bp) case D_FREEBLKS: freeblks = WK_FREEBLKS(wk); - jfreeblk = LIST_FIRST(&freeblks->fb_jfreeblkhd); + jblkdep = LIST_FIRST(&freeblks->fb_jblkdephd); /* - * We have to wait for the jfreeblks to be journaled + * We have to wait for the freeblks to be journaled * before we can write an inodeblock with updated * pointers. Be careful to arrange the marker so - * we revisit the jfreeblk if it's not removed by + * we revisit the freeblks if it's not removed by * the first jwait(). */ - if (jfreeblk != NULL) { + if (jblkdep != NULL) { LIST_REMOVE(&marker, wk_list); LIST_INSERT_BEFORE(wk, &marker, wk_list); - stat_jwait_freeblks++; - jwait(&jfreeblk->jf_list); + jwait(&jblkdep->jb_list, MNT_WAIT); } continue; case D_ALLOCDIRECT: @@ -8396,12 +9307,11 @@ softdep_disk_io_initiation(bp) */ newblk = WK_NEWBLK(wk); if (newblk->nb_jnewblk != NULL && - indirblk_inseg(newblk->nb_list.wk_mp, + indirblk_lookup(newblk->nb_list.wk_mp, newblk->nb_newblkno)) { LIST_REMOVE(&marker, wk_list); LIST_INSERT_BEFORE(wk, &marker, wk_list); - stat_jwait_newblk++; - jwait(&newblk->nb_jnewblk->jn_list); + jwait(&newblk->nb_jnewblk->jn_list, MNT_WAIT); } continue; @@ -8461,14 +9371,10 @@ initiate_write_filepage(pagedep, bp) * locked so the dependency can not go away. */ LIST_FOREACH(dirrem, &pagedep->pd_dirremhd, dm_next) - while ((jremref = LIST_FIRST(&dirrem->dm_jremrefhd)) != NULL) { - stat_jwait_filepage++; - jwait(&jremref->jr_list); - } - while ((jmvref = LIST_FIRST(&pagedep->pd_jmvrefhd)) != NULL) { - stat_jwait_filepage++; - jwait(&jmvref->jm_list); - } + while ((jremref = LIST_FIRST(&dirrem->dm_jremrefhd)) != NULL) + jwait(&jremref->jr_list, MNT_WAIT); + while ((jmvref = LIST_FIRST(&pagedep->pd_jmvrefhd)) != NULL) + jwait(&jmvref->jm_list, MNT_WAIT); for (i = 0; i < DAHASHSZ; i++) { LIST_FOREACH(dap, &pagedep->pd_diraddhd[i], da_pdlist) { ep = (struct direct *) @@ -8811,6 +9717,8 @@ initiate_write_inodeblock_ufs2(inodedep, bp) #ifdef INVARIANTS if (deplist != 0 && prevlbn >= adp->ad_offset) panic("softdep_write_inodeblock: lbn order"); + if ((adp->ad_state & ATTACHED) == 0) + panic("inodedep %p and adp %p not attached", inodedep, adp); prevlbn = adp->ad_offset; if (adp->ad_offset < NDADDR && dp->di_db[adp->ad_offset] != adp->ad_newblkno) @@ -8900,10 +9808,9 @@ initiate_write_inodeblock_ufs2(inodedep, bp) * list. */ static void -cancel_indirdep(indirdep, bp, inodedep, freeblks) +cancel_indirdep(indirdep, bp, freeblks) struct indirdep *indirdep; struct buf *bp; - struct inodedep *inodedep; struct freeblks *freeblks; { struct allocindir *aip; @@ -8924,24 +9831,38 @@ static void */ if (indirdep->ir_state & GOINGAWAY) panic("cancel_indirdep: already gone"); - if (indirdep->ir_state & ONDEPLIST) { - indirdep->ir_state &= ~ONDEPLIST; + if ((indirdep->ir_state & DEPCOMPLETE) == 0) { + indirdep->ir_state |= DEPCOMPLETE; LIST_REMOVE(indirdep, ir_next); } indirdep->ir_state |= GOINGAWAY; VFSTOUFS(indirdep->ir_list.wk_mp)->um_numindirdeps += 1; + /* + * Pass in bp for blocks still have journal writes + * pending so we can cancel them on their own. + */ while ((aip = LIST_FIRST(&indirdep->ir_deplisthd)) != 0) - cancel_allocindir(aip, inodedep, freeblks); + cancel_allocindir(aip, bp, freeblks, 0); while ((aip = LIST_FIRST(&indirdep->ir_donehd)) != 0) - cancel_allocindir(aip, inodedep, freeblks); + cancel_allocindir(aip, NULL, freeblks, 0); while ((aip = LIST_FIRST(&indirdep->ir_writehd)) != 0) - cancel_allocindir(aip, inodedep, freeblks); + cancel_allocindir(aip, NULL, freeblks, 0); while ((aip = LIST_FIRST(&indirdep->ir_completehd)) != 0) - cancel_allocindir(aip, inodedep, freeblks); - bcopy(bp->b_data, indirdep->ir_savebp->b_data, bp->b_bcount); + cancel_allocindir(aip, NULL, freeblks, 0); + /* + * If there are pending partial truncations we need to keep the + * old block copy around until they complete. This is because + * the current b_data is not a perfect superset of the available + * blocks. + */ + if (TAILQ_EMPTY(&indirdep->ir_trunc)) + bcopy(bp->b_data, indirdep->ir_savebp->b_data, bp->b_bcount); + else + bcopy(bp->b_data, indirdep->ir_saveddata, bp->b_bcount); WORKLIST_REMOVE(&indirdep->ir_list); WORKLIST_INSERT(&indirdep->ir_savebp->b_dep, &indirdep->ir_list); - indirdep->ir_savebp = NULL; + indirdep->ir_bp = NULL; + indirdep->ir_freeblks = freeblks; } /* @@ -8952,10 +9873,8 @@ free_indirdep(indirdep) struct indirdep *indirdep; { - KASSERT(LIST_EMPTY(&indirdep->ir_jwork), - ("free_indirdep: Journal work not empty.")); - KASSERT(LIST_EMPTY(&indirdep->ir_jnewblkhd), - ("free_indirdep: Journal new block list not empty.")); + KASSERT(TAILQ_EMPTY(&indirdep->ir_trunc), + ("free_indirdep: Indir trunc list not empty.")); KASSERT(LIST_EMPTY(&indirdep->ir_completehd), ("free_indirdep: Complete head not empty.")); KASSERT(LIST_EMPTY(&indirdep->ir_writehd), @@ -8964,10 +9883,10 @@ free_indirdep(indirdep) ("free_indirdep: done head not empty.")); KASSERT(LIST_EMPTY(&indirdep->ir_deplisthd), ("free_indirdep: deplist head not empty.")); - KASSERT(indirdep->ir_savebp == NULL, - ("free_indirdep: %p ir_savebp != NULL", indirdep)); - KASSERT((indirdep->ir_state & ONDEPLIST) == 0, - ("free_indirdep: %p still on deplist.", indirdep)); + KASSERT((indirdep->ir_state & DEPCOMPLETE), + ("free_indirdep: %p still on newblk list.", indirdep)); + KASSERT(indirdep->ir_saveddata == NULL, + ("free_indirdep: %p still has saved data.", indirdep)); if (indirdep->ir_state & ONWORKLIST) WORKLIST_REMOVE(&indirdep->ir_list); WORKITEM_FREE(indirdep, D_INDIRDEP); @@ -8984,22 +9903,25 @@ initiate_write_indirdep(indirdep, bp) struct buf *bp; { + indirdep->ir_state |= IOSTARTED; if (indirdep->ir_state & GOINGAWAY) panic("disk_io_initiation: indirdep gone"); - /* * If there are no remaining dependencies, this will be writing * the real pointers. */ - if (LIST_EMPTY(&indirdep->ir_deplisthd)) + if (LIST_EMPTY(&indirdep->ir_deplisthd) && + TAILQ_EMPTY(&indirdep->ir_trunc)) return; /* * Replace up-to-date version with safe version. */ - FREE_LOCK(&lk); - indirdep->ir_saveddata = malloc(bp->b_bcount, M_INDIRDEP, - M_SOFTDEP_FLAGS); - ACQUIRE_LOCK(&lk); + if (indirdep->ir_saveddata == NULL) { + FREE_LOCK(&lk); + indirdep->ir_saveddata = malloc(bp->b_bcount, M_INDIRDEP, + M_SOFTDEP_FLAGS); + ACQUIRE_LOCK(&lk); + } indirdep->ir_state &= ~ATTACHED; indirdep->ir_state |= UNDONE; bcopy(bp->b_data, indirdep->ir_saveddata, bp->b_bcount); @@ -9066,11 +9988,11 @@ softdep_setup_blkfree(mp, bp, blkno, frags, wkhd) int frags; struct workhead *wkhd; { + struct bmsafemap *bmsafemap; struct jnewblk *jnewblk; - struct worklist *wk, *wkn; + struct worklist *wk; + struct fs *fs; #ifdef SUJ_DEBUG - struct bmsafemap *bmsafemap; - struct fs *fs; uint8_t *blksfree; struct cg *cgp; ufs2_daddr_t jstart; @@ -9081,25 +10003,29 @@ softdep_setup_blkfree(mp, bp, blkno, frags, wkhd) #endif ACQUIRE_LOCK(&lk); + /* Lookup the bmsafemap so we track when it is dirty. */ + fs = VFSTOUFS(mp)->um_fs; + bmsafemap = bmsafemap_lookup(mp, bp, dtog(fs, blkno)); /* * Detach any jnewblks which have been canceled. They must linger * until the bitmap is cleared again by ffs_blkfree() to prevent * an unjournaled allocation from hitting the disk. */ if (wkhd) { - LIST_FOREACH_SAFE(wk, wkhd, wk_list, wkn) { - if (wk->wk_type != D_JNEWBLK) + while ((wk = LIST_FIRST(wkhd)) != NULL) { + WORKLIST_REMOVE(wk); + if (wk->wk_type != D_JNEWBLK) { + WORKLIST_INSERT(&bmsafemap->sm_freehd, wk); continue; + } jnewblk = WK_JNEWBLK(wk); KASSERT(jnewblk->jn_state & GOINGAWAY, ("softdep_setup_blkfree: jnewblk not canceled.")); - WORKLIST_REMOVE(wk); #ifdef SUJ_DEBUG /* * Assert that this block is free in the bitmap * before we discard the jnewblk. */ - fs = VFSTOUFS(mp)->um_fs; cgp = (struct cg *)bp->b_data; blksfree = cg_blksfree(cgp); bno = dtogd(fs, jnewblk->jn_blkno); @@ -9117,12 +10043,6 @@ softdep_setup_blkfree(mp, bp, blkno, frags, wkhd) wk->wk_state |= COMPLETE | ATTACHED; free_jnewblk(jnewblk); } - /* - * The buf must be locked by the caller otherwise these could - * be added while it's being written and the write would - * complete them before they made it to disk. - */ - jwork_move(&bp->b_dep, wkhd); } #ifdef SUJ_DEBUG @@ -9242,6 +10162,8 @@ initiate_write_bmsafemap(bmsafemap, bp) inodedep, id_deps); LIST_SWAP(&bmsafemap->sm_newblkhd, &bmsafemap->sm_newblkwr, newblk, nb_deps); + LIST_SWAP(&bmsafemap->sm_freehd, &bmsafemap->sm_freewr, worklist, + wk_list); } /* @@ -9260,6 +10182,7 @@ softdep_disk_write_complete(bp) struct worklist *wk; struct worklist *owk; struct workhead reattach; + struct freeblks *freeblks; struct buf *sbp; /* @@ -9277,6 +10200,7 @@ softdep_disk_write_complete(bp) ACQUIRE_LOCK(&lk); while ((wk = LIST_FIRST(&bp->b_dep)) != NULL) { WORKLIST_REMOVE(wk); + dep_write[wk->wk_type]++; if (wk == owk) panic("duplicate worklist: %p\n", wk); owk = wk; @@ -9318,18 +10242,17 @@ softdep_disk_write_complete(bp) case D_FREEBLKS: wk->wk_state |= COMPLETE; - if ((wk->wk_state & ALLCOMPLETE) == ALLCOMPLETE) - add_to_worklist(wk, 1); + freeblks = WK_FREEBLKS(wk); + if ((wk->wk_state & ALLCOMPLETE) == ALLCOMPLETE && + LIST_EMPTY(&freeblks->fb_jblkdephd)) + add_to_worklist(wk, WK_NODELAY); continue; case D_FREEWORK: - handle_written_freework(WK_FREEWORK(wk)); + /* Freework on an indirect block, not bmsafemap. */ + handle_written_freework(WK_FREEWORK(wk), 0); break; - case D_FREEDEP: - free_freedep(WK_FREEDEP(wk)); - continue; - case D_JSEGDEP: free_jsegdep(WK_JSEGDEP(wk)); continue; @@ -9459,7 +10382,11 @@ handle_allocindir_partdone(aip) return; indirdep = aip->ai_indirdep; LIST_REMOVE(aip, ai_next); - if (indirdep->ir_state & UNDONE) { + /* + * Don't set a pointer while the buffer is undergoing IO or while + * we have active truncations. + */ + if (indirdep->ir_state & UNDONE || !TAILQ_EMPTY(&indirdep->ir_trunc)) { LIST_INSERT_HEAD(&indirdep->ir_donehd, aip, ai_next); return; } @@ -9490,6 +10417,12 @@ handle_jwork(wkhd) case D_JSEGDEP: free_jsegdep(WK_JSEGDEP(wk)); continue; + case D_FREEDEP: + free_freedep(WK_FREEDEP(wk)); + continue; + case D_FREEWORK: + handle_written_freework(WK_FREEWORK(wk), 1); + continue; default: panic("handle_jwork: Unknown type %s\n", TYPENAME(wk->wk_type)); @@ -9852,21 +10785,26 @@ handle_written_indirdep(indirdep, bp, bpp) struct buf **bpp; { struct allocindir *aip; + struct buf *sbp; int chgs; if (indirdep->ir_state & GOINGAWAY) - panic("disk_write_complete: indirdep gone"); + panic("handle_written_indirdep: indirdep gone"); + if ((indirdep->ir_state & IOSTARTED) == 0) + panic("handle_written_indirdep: IO not started"); chgs = 0; /* * If there were rollbacks revert them here. */ if (indirdep->ir_saveddata) { bcopy(indirdep->ir_saveddata, bp->b_data, bp->b_bcount); - free(indirdep->ir_saveddata, M_INDIRDEP); - indirdep->ir_saveddata = 0; + if (TAILQ_EMPTY(&indirdep->ir_trunc)) { + free(indirdep->ir_saveddata, M_INDIRDEP); + indirdep->ir_saveddata = NULL; + } chgs = 1; } - indirdep->ir_state &= ~UNDONE; + indirdep->ir_state &= ~(UNDONE | IOSTARTED); indirdep->ir_state |= ATTACHED; /* * Move allocindirs with written pointers to the completehd if @@ -9878,6 +10816,7 @@ handle_written_indirdep(indirdep, bp, bpp) if ((indirdep->ir_state & DEPCOMPLETE) == 0) { LIST_INSERT_HEAD(&indirdep->ir_completehd, aip, ai_next); + newblk_freefrag(&aip->ai_block); continue; } free_newblk(&aip->ai_block); @@ -9886,50 +10825,42 @@ handle_written_indirdep(indirdep, bp, bpp) * Move allocindirs that have finished dependency processing from * the done list to the write list after updating the pointers. */ - while ((aip = LIST_FIRST(&indirdep->ir_donehd)) != 0) { - handle_allocindir_partdone(aip); - if (aip == LIST_FIRST(&indirdep->ir_donehd)) - panic("disk_write_complete: not gone"); - chgs = 1; + if (TAILQ_EMPTY(&indirdep->ir_trunc)) { + while ((aip = LIST_FIRST(&indirdep->ir_donehd)) != 0) { + handle_allocindir_partdone(aip); + if (aip == LIST_FIRST(&indirdep->ir_donehd)) + panic("disk_write_complete: not gone"); + chgs = 1; + } } /* - * If this indirdep has been detached from its newblk during - * I/O we need to keep this dep attached to the buffer so - * deallocate_dependencies can find it and properly resolve - * any outstanding dependencies. + * Preserve the indirdep if there were any changes or if it is not + * yet valid on disk. */ - if ((indirdep->ir_state & (ONDEPLIST | DEPCOMPLETE)) == 0) - chgs = 1; - if ((bp->b_flags & B_DELWRI) == 0) + if (chgs) { stat_indir_blk_ptrs++; + bdirty(bp); + return (1); + } /* * If there were no changes we can discard the savedbp and detach * ourselves from the buf. We are only carrying completed pointers * in this case. */ - if (chgs == 0) { - struct buf *sbp; - - sbp = indirdep->ir_savebp; - sbp->b_flags |= B_INVAL | B_NOCACHE; - indirdep->ir_savebp = NULL; - if (*bpp != NULL) - panic("handle_written_indirdep: bp already exists."); - *bpp = sbp; - } else - bdirty(bp); + sbp = indirdep->ir_savebp; + sbp->b_flags |= B_INVAL | B_NOCACHE; + indirdep->ir_savebp = NULL; + indirdep->ir_bp = NULL; + if (*bpp != NULL) + panic("handle_written_indirdep: bp already exists."); + *bpp = sbp; /* - * If there are no fresh dependencies and none waiting on writes - * we can free the indirdep. + * The indirdep may not be freed until its parent points at it. */ - if ((indirdep->ir_state & DEPCOMPLETE) && chgs == 0) { - if (indirdep->ir_state & ONDEPLIST) - LIST_REMOVE(indirdep, ir_next); + if (indirdep->ir_state & DEPCOMPLETE) free_indirdep(indirdep); - return (0); - } - return (chgs); + return (0); } /* @@ -9974,6 +10905,7 @@ handle_written_bmsafemap(bmsafemap, bp) struct inodedep *inodedep; struct jaddref *jaddref, *jatmp; struct jnewblk *jnewblk, *jntmp; + struct ufsmount *ump; uint8_t *inosused; uint8_t *blksfree; struct cg *cgp; @@ -9985,9 +10917,15 @@ handle_written_bmsafemap(bmsafemap, bp) if ((bmsafemap->sm_state & IOSTARTED) == 0) panic("initiate_write_bmsafemap: Not started\n"); + ump = VFSTOUFS(bmsafemap->sm_list.wk_mp); chgs = 0; bmsafemap->sm_state &= ~IOSTARTED; /* + * Release journal work that was waiting on the write. + */ + handle_jwork(&bmsafemap->sm_freewr); + + /* * Restore unwritten inode allocation pending jaddref writes. */ if (!LIST_EMPTY(&bmsafemap->sm_jaddrefhd)) { @@ -10063,16 +11001,17 @@ handle_written_bmsafemap(bmsafemap, bp) LIST_REMOVE(inodedep, id_deps); inodedep->id_bmsafemap = NULL; } - if (LIST_EMPTY(&bmsafemap->sm_jaddrefhd) && + LIST_REMOVE(bmsafemap, sm_next); + if (chgs == 0 && LIST_EMPTY(&bmsafemap->sm_jaddrefhd) && LIST_EMPTY(&bmsafemap->sm_jnewblkhd) && LIST_EMPTY(&bmsafemap->sm_newblkhd) && - LIST_EMPTY(&bmsafemap->sm_inodedephd)) { - if (chgs) - bdirty(bp); + LIST_EMPTY(&bmsafemap->sm_inodedephd) && + LIST_EMPTY(&bmsafemap->sm_freehd)) { LIST_REMOVE(bmsafemap, sm_hash); WORKITEM_FREE(bmsafemap, D_BMSAFEMAP); return (0); } + LIST_INSERT_HEAD(&ump->softdep_dirtycg, bmsafemap, sm_next); bdirty(bp); return (1); } @@ -10113,25 +11052,29 @@ handle_written_mkdir(mkdir, type) complete_mkdir(mkdir); } -static void +static int free_pagedep(pagedep) struct pagedep *pagedep; { int i; - if (pagedep->pd_state & (NEWBLOCK | ONWORKLIST)) - return; + if (pagedep->pd_state & NEWBLOCK) + return (0); + if (!LIST_EMPTY(&pagedep->pd_dirremhd)) + return (0); for (i = 0; i < DAHASHSZ; i++) if (!LIST_EMPTY(&pagedep->pd_diraddhd[i])) - return; + return (0); + if (!LIST_EMPTY(&pagedep->pd_pendinghd)) + return (0); if (!LIST_EMPTY(&pagedep->pd_jmvrefhd)) - return; - if (!LIST_EMPTY(&pagedep->pd_dirremhd)) - return; - if (!LIST_EMPTY(&pagedep->pd_pendinghd)) - return; + return (0); + if (pagedep->pd_state & ONWORKLIST) + WORKLIST_REMOVE(&pagedep->pd_list); LIST_REMOVE(pagedep, pd_hash); WORKITEM_FREE(pagedep, D_PAGEDEP); + + return (1); } /* @@ -10217,11 +11160,7 @@ handle_written_filepage(pagedep, bp) * Otherwise it will remain to track any new entries on * the page in case they are fsync'ed. */ - if ((pagedep->pd_state & NEWBLOCK) == 0 && - LIST_EMPTY(&pagedep->pd_jmvrefhd)) { - LIST_REMOVE(pagedep, pd_hash); - WORKITEM_FREE(pagedep, D_PAGEDEP); - } + free_pagedep(pagedep); return (0); } @@ -10324,8 +11263,7 @@ again: TAILQ_FOREACH(inoref, &inodedep->id_inoreflst, if_deps) { if ((inoref->if_state & (DEPCOMPLETE | GOINGAWAY)) == DEPCOMPLETE) { - stat_jwait_inode++; - jwait(&inoref->if_list); + jwait(&inoref->if_list, MNT_WAIT); goto again; } } @@ -10463,8 +11401,7 @@ restart: TAILQ_FOREACH(inoref, &inodedep->id_inoreflst, if_deps) { if ((inoref->if_state & (DEPCOMPLETE | GOINGAWAY)) == DEPCOMPLETE) { - stat_jwait_inode++; - jwait(&inoref->if_list); + jwait(&inoref->if_list, MNT_WAIT); goto restart; } } @@ -10610,6 +11547,8 @@ restart: * Flush all the dirty bitmaps associated with the block device * before flushing the rest of the dirty blocks so as to reduce * the number of dependencies that will have to be rolled back. + * + * XXX Unused? */ void softdep_fsync_mountdev(vp) @@ -10656,76 +11595,124 @@ restart: } /* + * Sync all cylinder groups that were dirty at the time this function is + * called. Newly dirtied cgs will be inserted before the sintenel. This + * is used to flush freedep activity that may be holding up writes to a + * indirect block. + */ +static int +sync_cgs(mp, waitfor) + struct mount *mp; + int waitfor; +{ + struct bmsafemap *bmsafemap; + struct bmsafemap *sintenel; + struct ufsmount *ump; + struct buf *bp; + int error; + + sintenel = malloc(sizeof(*sintenel), M_BMSAFEMAP, M_ZERO | M_WAITOK); + sintenel->sm_cg = -1; + ump = VFSTOUFS(mp); + error = 0; + ACQUIRE_LOCK(&lk); + LIST_INSERT_HEAD(&ump->softdep_dirtycg, sintenel, sm_next); + for (bmsafemap = LIST_NEXT(sintenel, sm_next); bmsafemap != NULL; + bmsafemap = LIST_NEXT(sintenel, sm_next)) { + /* Skip sintenels and cgs with no work to release. */ + if (bmsafemap->sm_cg == -1 || + (LIST_EMPTY(&bmsafemap->sm_freehd) && + LIST_EMPTY(&bmsafemap->sm_freewr))) { + LIST_REMOVE(sintenel, sm_next); + LIST_INSERT_AFTER(bmsafemap, sintenel, sm_next); + continue; + } + /* + * If we don't get the lock and we're waiting try again, if + * not move on to the next buf and try to sync it. + */ + bp = getdirtybuf(bmsafemap->sm_buf, &lk, waitfor); + if (bp == NULL && waitfor == MNT_WAIT) + continue; + LIST_REMOVE(sintenel, sm_next); + LIST_INSERT_AFTER(bmsafemap, sintenel, sm_next); + if (bp == NULL) + continue; + FREE_LOCK(&lk); + if (waitfor == MNT_NOWAIT) + bawrite(bp); + else + error = bwrite(bp); + ACQUIRE_LOCK(&lk); + if (error) + break; + } + LIST_REMOVE(sintenel, sm_next); + FREE_LOCK(&lk); + free(sintenel, M_BMSAFEMAP); + return (error); +} + +/* * This routine is called when we are trying to synchronously flush a * file. This routine must eliminate any filesystem metadata dependencies - * so that the syncing routine can succeed by pushing the dirty blocks - * associated with the file. If any I/O errors occur, they are returned. + * so that the syncing routine can succeed. */ int softdep_sync_metadata(struct vnode *vp) { - struct pagedep *pagedep; - struct allocindir *aip; - struct newblk *newblk; - struct buf *bp, *nbp; - struct worklist *wk; - struct bufobj *bo; - int i, error, waitfor; + int error; - if (!DOINGSOFTDEP(vp)) - return (0); /* - * Ensure that any direct block dependencies have been cleared. + * Ensure that any direct block dependencies have been cleared, + * truncations are started, and inode references are journaled. */ ACQUIRE_LOCK(&lk); - if ((error = flush_inodedep_deps(vp->v_mount, VTOI(vp)->i_number))) { - FREE_LOCK(&lk); - return (error); - } - FREE_LOCK(&lk); + error = flush_inodedep_deps(vp, vp->v_mount, VTOI(vp)->i_number); /* - * For most files, the only metadata dependencies are the - * cylinder group maps that allocate their inode or blocks. - * The block allocation dependencies can be found by traversing - * the dependency lists for any buffers that remain on their - * dirty buffer list. The inode allocation dependency will - * be resolved when the inode is updated with MNT_WAIT. - * This work is done in two passes. The first pass grabs most - * of the buffers and begins asynchronously writing them. The - * only way to wait for these asynchronous writes is to sleep - * on the filesystem vnode which may stay busy for a long time - * if the filesystem is active. So, instead, we make a second - * pass over the dependencies blocking on each write. In the - * usual case we will be blocking against a write that we - * initiated, so when it is done the dependency will have been - * resolved. Thus the second pass is expected to end quickly. + * Ensure that all truncates are written so we won't find deps on + * indirect blocks. */ - waitfor = MNT_NOWAIT; - bo = &vp->v_bufobj; + process_truncates(vp); + FREE_LOCK(&lk); -top: + return (error); +} + +/* + * This routine is called when we are attempting to sync a buf with + * dependencies. If waitfor is MNT_NOWAIT it attempts to schedule any + * other IO it can but returns EBUSY if the buffer is not yet able to + * be written. Dependencies which will not cause rollbacks will always + * return 0. + */ +int +softdep_sync_buf(struct vnode *vp, struct buf *bp, int waitfor) +{ + struct indirdep *indirdep; + struct pagedep *pagedep; + struct allocindir *aip; + struct newblk *newblk; + struct buf *nbp; + struct worklist *wk; + int i, error; + /* - * We must wait for any I/O in progress to finish so that - * all potential buffers on the dirty list will be visible. + * For VCHR we just don't want to force flush any dependencies that + * will cause rollbacks. */ - BO_LOCK(bo); - drain_output(vp); - while ((bp = TAILQ_FIRST(&bo->bo_dirty.bv_hd)) != NULL) { - bp = getdirtybuf(bp, BO_MTX(bo), MNT_WAIT); - if (bp) - break; + if (vp->v_type == VCHR) { + if (waitfor == MNT_NOWAIT && softdep_count_dependencies(bp, 0)) + return (EBUSY); + return (0); } - BO_UNLOCK(bo); - if (bp == NULL) - return (0); -loop: - /* While syncing snapshots, we must allow recursive lookups */ - BUF_AREC(bp); ACQUIRE_LOCK(&lk); /* * As we hold the buffer locked, none of its dependencies * will disappear. */ + error = 0; +top: LIST_FOREACH(wk, &bp->b_dep, wk_list) { switch (wk->wk_type) { @@ -10733,46 +11720,54 @@ softdep_sync_metadata(struct vnode *vp) case D_ALLOCINDIR: newblk = WK_NEWBLK(wk); if (newblk->nb_jnewblk != NULL) { - stat_jwait_newblk++; - jwait(&newblk->nb_jnewblk->jn_list); - goto restart; + if (waitfor == MNT_NOWAIT) { + error = EBUSY; + goto out_unlock; + } + jwait(&newblk->nb_jnewblk->jn_list, waitfor); + goto top; } - if (newblk->nb_state & DEPCOMPLETE) + if (newblk->nb_state & DEPCOMPLETE || + waitfor == MNT_NOWAIT) continue; nbp = newblk->nb_bmsafemap->sm_buf; nbp = getdirtybuf(nbp, &lk, waitfor); if (nbp == NULL) - continue; + goto top; FREE_LOCK(&lk); - if (waitfor == MNT_NOWAIT) { - bawrite(nbp); - } else if ((error = bwrite(nbp)) != 0) { - break; - } + if ((error = bwrite(nbp)) != 0) + goto out; ACQUIRE_LOCK(&lk); continue; case D_INDIRDEP: + indirdep = WK_INDIRDEP(wk); + if (waitfor == MNT_NOWAIT) { + if (!TAILQ_EMPTY(&indirdep->ir_trunc) || + !LIST_EMPTY(&indirdep->ir_deplisthd)) { + error = EBUSY; + goto out_unlock; + } + } + if (!TAILQ_EMPTY(&indirdep->ir_trunc)) + panic("softdep_sync_buf: truncation pending."); restart: - - LIST_FOREACH(aip, - &WK_INDIRDEP(wk)->ir_deplisthd, ai_next) { + LIST_FOREACH(aip, &indirdep->ir_deplisthd, ai_next) { newblk = (struct newblk *)aip; if (newblk->nb_jnewblk != NULL) { - stat_jwait_newblk++; - jwait(&newblk->nb_jnewblk->jn_list); + jwait(&newblk->nb_jnewblk->jn_list, + waitfor); goto restart; } if (newblk->nb_state & DEPCOMPLETE) continue; nbp = newblk->nb_bmsafemap->sm_buf; - nbp = getdirtybuf(nbp, &lk, MNT_WAIT); + nbp = getdirtybuf(nbp, &lk, waitfor); if (nbp == NULL) goto restart; FREE_LOCK(&lk); - if ((error = bwrite(nbp)) != 0) { - goto loop_end; - } + if ((error = bwrite(nbp)) != 0) + goto out; ACQUIRE_LOCK(&lk); goto restart; } @@ -10780,6 +11775,18 @@ softdep_sync_metadata(struct vnode *vp) case D_PAGEDEP: /* + * Only flush directory entries in synchronous passes. + */ + if (waitfor != MNT_WAIT) { + error = EBUSY; + goto out_unlock; + } + /* + * While syncing snapshots, we must allow recursive + * lookups. + */ + BUF_AREC(bp); + /* * We are trying to sync a directory that may * have dependencies on both its own metadata * and/or dependencies on the inodes of any @@ -10790,64 +11797,28 @@ softdep_sync_metadata(struct vnode *vp) for (i = 0; i < DAHASHSZ; i++) { if (LIST_FIRST(&pagedep->pd_diraddhd[i]) == 0) continue; - if ((error = - flush_pagedep_deps(vp, wk->wk_mp, - &pagedep->pd_diraddhd[i]))) { - FREE_LOCK(&lk); - goto loop_end; + if ((error = flush_pagedep_deps(vp, wk->wk_mp, + &pagedep->pd_diraddhd[i]))) { + BUF_NOREC(bp); + goto out_unlock; } } + BUF_NOREC(bp); continue; + case D_FREEWORK: + continue; + default: - panic("softdep_sync_metadata: Unknown type %s", + panic("softdep_sync_buf: Unknown type %s", TYPENAME(wk->wk_type)); /* NOTREACHED */ } - loop_end: - /* We reach here only in error and unlocked */ - if (error == 0) - panic("softdep_sync_metadata: zero error"); - BUF_NOREC(bp); - bawrite(bp); - return (error); } +out_unlock: FREE_LOCK(&lk); - BO_LOCK(bo); - while ((nbp = TAILQ_NEXT(bp, b_bobufs)) != NULL) { - nbp = getdirtybuf(nbp, BO_MTX(bo), MNT_WAIT); - if (nbp) - break; - } - BO_UNLOCK(bo); - BUF_NOREC(bp); - bawrite(bp); - if (nbp != NULL) { - bp = nbp; - goto loop; - } - /* - * The brief unlock is to allow any pent up dependency - * processing to be done. Then proceed with the second pass. - */ - if (waitfor == MNT_NOWAIT) { - waitfor = MNT_WAIT; - goto top; - } - - /* - * If we have managed to get rid of all the dirty buffers, - * then we are done. For certain directories and block - * devices, we may need to do further work. - * - * We must wait for any I/O in progress to finish so that - * all potential buffers on the dirty list will be visible. - */ - BO_LOCK(bo); - drain_output(vp); - BO_UNLOCK(bo); - return ffs_update(vp, 1); - /* return (0); */ +out: + return (error); } /* @@ -10855,7 +11826,8 @@ softdep_sync_metadata(struct vnode *vp) * Called with splbio blocked. */ static int -flush_inodedep_deps(mp, ino) +flush_inodedep_deps(vp, mp, ino) + struct vnode *vp; struct mount *mp; ino_t ino; { @@ -10887,8 +11859,7 @@ restart: TAILQ_FOREACH(inoref, &inodedep->id_inoreflst, if_deps) { if ((inoref->if_state & (DEPCOMPLETE | GOINGAWAY)) == DEPCOMPLETE) { - stat_jwait_inode++; - jwait(&inoref->if_list); + jwait(&inoref->if_list, MNT_WAIT); goto restart; } } @@ -10930,8 +11901,7 @@ flush_deplist(listhead, waitfor, errorp) TAILQ_FOREACH(adp, listhead, ad_next) { newblk = (struct newblk *)adp; if (newblk->nb_jnewblk != NULL) { - stat_jwait_newblk++; - jwait(&newblk->nb_jnewblk->jn_list); + jwait(&newblk->nb_jnewblk->jn_list, MNT_WAIT); return (1); } if (newblk->nb_state & DEPCOMPLETE) @@ -10944,12 +11914,10 @@ flush_deplist(listhead, waitfor, errorp) return (1); } FREE_LOCK(&lk); - if (waitfor == MNT_NOWAIT) { + if (waitfor == MNT_NOWAIT) bawrite(bp); - } else if ((*errorp = bwrite(bp)) != 0) { - ACQUIRE_LOCK(&lk); - return (1); - } + else + *errorp = bwrite(bp); ACQUIRE_LOCK(&lk); return (1); } @@ -10995,8 +11963,7 @@ flush_newblk_dep(vp, mp, lbn) * Flush the journal. */ if (newblk->nb_jnewblk != NULL) { - stat_jwait_newblk++; - jwait(&newblk->nb_jnewblk->jn_list); + jwait(&newblk->nb_jnewblk->jn_list, MNT_WAIT); continue; } /* @@ -11105,8 +12072,7 @@ restart: TAILQ_FOREACH(inoref, &inodedep->id_inoreflst, if_deps) { if ((inoref->if_state & (DEPCOMPLETE | GOINGAWAY)) == DEPCOMPLETE) { - stat_jwait_inode++; - jwait(&inoref->if_list); + jwait(&inoref->if_list, MNT_WAIT); goto restart; } } @@ -11237,6 +12203,8 @@ softdep_slowdown(vp) softdep_speedup(); stat_sync_limit_hit += 1; FREE_LOCK(&lk); + if (DOINGSUJ(vp)) + return (0); return (1); } @@ -11338,8 +12306,9 @@ retry: UFS_UNLOCK(ump); ACQUIRE_LOCK(&lk); process_removes(vp); + process_truncates(vp); if (ump->softdep_on_worklist > 0 && - process_worklist_item(UFSTOVFS(ump), LK_NOWAIT) != -1) { + process_worklist_item(UFSTOVFS(ump), 1, LK_NOWAIT) != 0) { stat_worklist_push += 1; FREE_LOCK(&lk); UFS_LOCK(ump); @@ -11363,24 +12332,14 @@ retry: UFS_UNLOCK(ump); MNT_ILOCK(mp); MNT_VNODE_FOREACH(lvp, mp, mvp) { - UFS_LOCK(ump); - if (ump->softdep_on_worklist > 0) { - UFS_UNLOCK(ump); - MNT_VNODE_FOREACH_ABORT_ILOCKED(mp, mvp); - MNT_IUNLOCK(mp); - UFS_LOCK(ump); - stat_cleanup_retries += 1; - goto retry; - } - UFS_UNLOCK(ump); VI_LOCK(lvp); - if (TAILQ_FIRST(&lvp->v_bufobj.bo_dirty.bv_hd) == 0 || - VOP_ISLOCKED(lvp) != 0) { + if (TAILQ_FIRST(&lvp->v_bufobj.bo_dirty.bv_hd) == 0) { VI_UNLOCK(lvp); continue; } MNT_IUNLOCK(mp); - if (vget(lvp, LK_EXCLUSIVE | LK_INTERLOCK, curthread)) { + if (vget(lvp, LK_EXCLUSIVE | LK_INTERLOCK | LK_NOWAIT, + curthread)) { MNT_ILOCK(mp); continue; } @@ -11394,8 +12353,17 @@ retry: MNT_ILOCK(mp); } MNT_IUNLOCK(mp); + lvp = ump->um_devvp; + if (vn_lock(lvp, LK_EXCLUSIVE | LK_NOWAIT) == 0) { + VOP_FSYNC(lvp, MNT_NOWAIT, curthread); + VOP_UNLOCK(lvp, 0); + } + UFS_LOCK(ump); + if (ump->softdep_on_worklist > 0) { + stat_cleanup_retries += 1; + goto retry; + } stat_cleanup_failures += 1; - UFS_LOCK(ump); } if (time_second - starttime > stat_cleanup_high_delay) stat_cleanup_high_delay = time_second - starttime; @@ -11432,8 +12400,7 @@ request_cleanup(mp, resource) */ if (ump->softdep_on_worklist > max_softdeps / 10) { td->td_pflags |= TDP_SOFTDEP; - process_worklist_item(mp, LK_NOWAIT); - process_worklist_item(mp, LK_NOWAIT); + process_worklist_item(mp, 2, LK_NOWAIT); td->td_pflags &= ~TDP_SOFTDEP; stat_worklist_push += 2; return(1); @@ -11664,6 +12631,7 @@ softdep_count_dependencies(bp, wantcount) { struct worklist *wk; struct bmsafemap *bmsafemap; + struct freework *freework; struct inodedep *inodedep; struct indirdep *indirdep; struct freeblks *freeblks; @@ -11711,6 +12679,13 @@ softdep_count_dependencies(bp, wantcount) case D_INDIRDEP: indirdep = WK_INDIRDEP(wk); + TAILQ_FOREACH(freework, &indirdep->ir_trunc, fw_next) { + /* indirect truncation dependency */ + retval += 1; + if (!wantcount) + goto out; + } + LIST_FOREACH(aip, &indirdep->ir_deplisthd, ai_next) { /* indirect block pointer dependency */ retval += 1; @@ -11758,7 +12733,7 @@ softdep_count_dependencies(bp, wantcount) case D_FREEBLKS: freeblks = WK_FREEBLKS(wk); - if (LIST_FIRST(&freeblks->fb_jfreeblkhd)) { + if (LIST_FIRST(&freeblks->fb_jblkdephd)) { /* Freeblk journal dependency. */ retval += 1; if (!wantcount) Index: /usr/src/sys/ufs/ffs/ffs_vnops.c =================================================================== --- /usr/src/sys/ufs/ffs/ffs_vnops.c (revision 222894) +++ /usr/src/sys/ufs/ffs/ffs_vnops.c (working copy) @@ -212,26 +212,32 @@ retry: int ffs_syncvnode(struct vnode *vp, int waitfor) { - struct inode *ip = VTOI(vp); + struct inode *ip; struct bufobj *bo; struct buf *bp; struct buf *nbp; - int s, error, wait, passes, skipmeta; ufs_lbn_t lbn; + int error, wait, passes; - wait = (waitfor == MNT_WAIT); - lbn = lblkno(ip->i_fs, (ip->i_size + ip->i_fs->fs_bsize - 1)); - bo = &vp->v_bufobj; + ip = VTOI(vp); ip->i_flag &= ~IN_NEEDSYNC; + bo = &vp->v_bufobj; /* + * When doing MNT_WAIT we must first flush all dependencies + * on the inode. + */ + if (DOINGSOFTDEP(vp) && waitfor == MNT_WAIT && + (error = softdep_sync_metadata(vp)) != 0) + return (error); + + /* * Flush all dirty buffers associated with a vnode. */ - passes = NIADDR + 1; - skipmeta = 0; - if (wait) - skipmeta = 1; - s = splbio(); + error = 0; + passes = 0; + wait = 0; /* Always do an async pass first. */ + lbn = lblkno(ip->i_fs, (ip->i_size + ip->i_fs->fs_bsize - 1)); BO_LOCK(bo); loop: TAILQ_FOREACH(bp, &bo->bo_dirty.bv_hd, b_bobufs) @@ -239,70 +245,53 @@ loop: TAILQ_FOREACH_SAFE(bp, &bo->bo_dirty.bv_hd, b_bobufs, nbp) { /* * Reasons to skip this buffer: it has already been considered - * on this pass, this pass is the first time through on a - * synchronous flush request and the buffer being considered - * is metadata, the buffer has dependencies that will cause + * on this pass, the buffer has dependencies that will cause * it to be redirtied and it has not already been deferred, * or it is already being written. */ if ((bp->b_vflags & BV_SCANNED) != 0) continue; bp->b_vflags |= BV_SCANNED; - if ((skipmeta == 1 && bp->b_lblkno < 0)) + /* Flush indirects in order. */ + if (waitfor == MNT_WAIT && bp->b_lblkno <= -NDADDR && + lbn_level(bp->b_lblkno) >= passes) continue; + if (bp->b_lblkno > lbn) + panic("ffs_syncvnode: syncing truncated data."); if (BUF_LOCK(bp, LK_EXCLUSIVE | LK_NOWAIT, NULL)) continue; BO_UNLOCK(bo); - if (!wait && !LIST_EMPTY(&bp->b_dep) && - (bp->b_flags & B_DEFERRED) == 0 && - buf_countdeps(bp, 0)) { - bp->b_flags |= B_DEFERRED; - BUF_UNLOCK(bp); - BO_LOCK(bo); - continue; - } if ((bp->b_flags & B_DELWRI) == 0) panic("ffs_fsync: not dirty"); /* - * If this is a synchronous flush request, or it is not a - * file or device, start the write on this buffer immediately. + * Check for dependencies and potentially complete them. */ - if (wait || (vp->v_type != VREG && vp->v_type != VBLK)) { - - /* - * On our final pass through, do all I/O synchronously - * so that we can find out if our flush is failing - * because of write errors. - */ - if (passes > 0 || !wait) { - if ((bp->b_flags & B_CLUSTEROK) && !wait) { - (void) vfs_bio_awrite(bp); - } else { - bremfree(bp); - splx(s); - (void) bawrite(bp); - s = splbio(); - } - } else { - bremfree(bp); - splx(s); - if ((error = bwrite(bp)) != 0) - return (error); - s = splbio(); + if (!LIST_EMPTY(&bp->b_dep) && + (error = softdep_sync_buf(vp, bp, + wait ? MNT_WAIT : MNT_NOWAIT)) != 0) { + /* I/O error. */ + if (error != EBUSY) { + BUF_UNLOCK(bp); + return (error); } - } else if ((vp->v_type == VREG) && (bp->b_lblkno >= lbn)) { - /* - * If the buffer is for data that has been truncated - * off the file, then throw it away. - */ + /* If we deferred once, don't defer again. */ + if ((bp->b_flags & B_DEFERRED) == 0) { + bp->b_flags |= B_DEFERRED; + BUF_UNLOCK(bp); + goto next; + } + } + if (wait) { bremfree(bp); - bp->b_flags |= B_INVAL | B_NOCACHE; - splx(s); - brelse(bp); - s = splbio(); - } else - vfs_bio_awrite(bp); - + if ((error = bwrite(bp)) != 0) + return (error); + } else if ((bp->b_flags & B_CLUSTEROK)) { + (void) vfs_bio_awrite(bp); + } else { + bremfree(bp); + (void) bawrite(bp); + } +next: /* * Since we may have slept during the I/O, we need * to start from a known point. @@ -310,51 +299,44 @@ loop: BO_LOCK(bo); nbp = TAILQ_FIRST(&bo->bo_dirty.bv_hd); } + if (waitfor != MNT_WAIT) { + BO_UNLOCK(bo); + return (ffs_update(vp, waitfor)); + } + /* Drain IO to see if we're done. */ + bufobj_wwait(bo, 0, 0); /* - * If we were asked to do this synchronously, then go back for - * another pass, this time doing the metadata. + * Block devices associated with filesystems may have new I/O + * requests posted for them even if the vnode is locked, so no + * amount of trying will get them clean. We make several passes + * as a best effort. + * + * Regular files may need multiple passes to flush all dependency + * work as it is possible that we must write once per indirect + * level, once for the leaf, and once for the inode and each of + * these will be done with one sync and one async pass. */ - if (skipmeta) { - skipmeta = 0; - goto loop; - } - - if (wait) { - bufobj_wwait(bo, 3, 0); - BO_UNLOCK(bo); - - /* - * Ensure that any filesystem metatdata associated - * with the vnode has been written. - */ - splx(s); - if ((error = softdep_sync_metadata(vp)) != 0) - return (error); - s = splbio(); - - BO_LOCK(bo); - if (bo->bo_dirty.bv_cnt > 0) { - /* - * Block devices associated with filesystems may - * have new I/O requests posted for them even if - * the vnode is locked, so no amount of trying will - * get them clean. Thus we give block devices a - * good effort, then just give up. For all other file - * types, go around and try again until it is clean. - */ - if (passes > 0) { - passes -= 1; - goto loop; - } + if (bo->bo_dirty.bv_cnt > 0) { + /* Write the inode after sync passes to flush deps. */ + if (wait && DOINGSOFTDEP(vp)) { + BO_UNLOCK(bo); + ffs_update(vp, MNT_WAIT); + BO_LOCK(bo); + } + /* switch between sync/async. */ + wait = !wait; + if (wait == 1 || ++passes < NIADDR + 2) + goto loop; #ifdef INVARIANTS - if (!vn_isdisk(vp, NULL)) - vprint("ffs_fsync: dirty", vp); + if (!vn_isdisk(vp, NULL)) + vprint("ffs_fsync: dirty", vp); #endif - } } BO_UNLOCK(bo); - splx(s); - return (ffs_update(vp, wait)); + error = ffs_update(vp, MNT_WAIT); + if (DOINGSUJ(vp)) + softdep_journal_fsync(VTOI(vp)); + return (error); } static int Index: /usr/src/sys/ufs/ffs/ffs_alloc.c =================================================================== --- /usr/src/sys/ufs/ffs/ffs_alloc.c (revision 222894) +++ /usr/src/sys/ufs/ffs/ffs_alloc.c (working copy) @@ -217,7 +217,7 @@ nospace: (void) chkdq(ip, -btodb(size), cred, FORCE); UFS_LOCK(ump); #endif - if (reclaimed == 0) { + if (reclaimed == 0 && (flags & IO_BUFLOCKED) == 0) { reclaimed = 1; softdep_request_cleanup(fs, ITOV(ip), cred, FLUSH_BLOCKS_WAIT); goto retry; Index: /usr/src/sys/ufs/ffs/ffs_extern.h =================================================================== --- /usr/src/sys/ufs/ffs/ffs_extern.h (revision 222894) +++ /usr/src/sys/ufs/ffs/ffs_extern.h (working copy) @@ -107,7 +107,6 @@ extern struct vop_vector ffs_fifoops2; int softdep_check_suspend(struct mount *, struct vnode *, int, int, int, int); -int softdep_complete_trunc(struct vnode *, void *); void softdep_get_depcounts(struct mount *, int *, int *); void softdep_initialize(void); void softdep_uninitialize(void); @@ -139,15 +138,18 @@ void softdep_setup_blkfree(struct mount *, struct void softdep_setup_inofree(struct mount *, struct buf *, ino_t, struct workhead *); void softdep_setup_sbupdate(struct ufsmount *, struct fs *, struct buf *); -void *softdep_setup_trunc(struct vnode *vp, off_t length, int flags); void softdep_fsync_mountdev(struct vnode *); int softdep_sync_metadata(struct vnode *); +int softdep_sync_buf(struct vnode *, struct buf *, int); int softdep_process_worklist(struct mount *, int); int softdep_fsync(struct vnode *); int softdep_waitidle(struct mount *); int softdep_prealloc(struct vnode *, int); int softdep_journal_lookup(struct mount *, struct vnode **); +void softdep_journal_freeblocks(struct inode *, struct ucred *, off_t, int); +void softdep_journal_fsync(struct inode *); + /* * Things to request flushing in softdep_request_cleanup() */ Index: /usr/src/sys/ufs/ffs/softdep.h =================================================================== --- /usr/src/sys/ufs/ffs/softdep.h (revision 222894) +++ /usr/src/sys/ufs/ffs/softdep.h (working copy) @@ -127,7 +127,7 @@ #define DIRCHG 0x000080 /* diradd, dirrem only */ #define GOINGAWAY 0x000100 /* indirdep, jremref only */ #define IOSTARTED 0x000200 /* inodedep, pagedep, bmsafemap only */ -#define UNUSED400 0x000400 /* currently available. */ +#define DELAYEDFREE 0x000400 /* allocindirect free delayed. */ #define NEWBLOCK 0x000800 /* pagedep, jaddref only */ #define INPROGRESS 0x001000 /* dirrem, freeblks, freefrag, freefile only */ #define UFS1FMT 0x002000 /* indirdep only */ @@ -195,8 +195,9 @@ struct worklist { #define WK_JFREEBLK(wk) ((struct jfreeblk *)(wk)) #define WK_FREEDEP(wk) ((struct freedep *)(wk)) #define WK_JFREEFRAG(wk) ((struct jfreefrag *)(wk)) -#define WK_SBDEP(wk) ((struct sbdep *)wk) +#define WK_SBDEP(wk) ((struct sbdep *)(wk)) #define WK_JTRUNC(wk) ((struct jtrunc *)(wk)) +#define WK_JFSYNC(wk) ((struct jfsync *)(wk)) /* * Various types of lists @@ -213,10 +214,12 @@ LIST_HEAD(jaddrefhd, jaddref); LIST_HEAD(jremrefhd, jremref); LIST_HEAD(jmvrefhd, jmvref); LIST_HEAD(jnewblkhd, jnewblk); -LIST_HEAD(jfreeblkhd, jfreeblk); +LIST_HEAD(jblkdephd, jblkdep); LIST_HEAD(freeworkhd, freework); +TAILQ_HEAD(freeworklst, freework); TAILQ_HEAD(jseglst, jseg); TAILQ_HEAD(inoreflst, inoref); +TAILQ_HEAD(freeblklst, freeblks); /* * The "pagedep" structure tracks the various dependencies related to @@ -321,6 +324,7 @@ struct inodedep { struct allocdirectlst id_newinoupdt; /* updates when inode written */ struct allocdirectlst id_extupdt; /* extdata updates pre-inode write */ struct allocdirectlst id_newextupdt; /* extdata updates at ino write */ + struct freeblklst id_freeblklst; /* List of partial truncates. */ union { struct ufs1_dinode *idu_savedino1; /* saved ufs1_dinode contents */ struct ufs2_dinode *idu_savedino2; /* saved ufs2_dinode contents */ @@ -342,8 +346,9 @@ struct inodedep { struct bmsafemap { struct worklist sm_list; /* cylgrp buffer */ # define sm_state sm_list.wk_state + LIST_ENTRY(bmsafemap) sm_hash; /* Hash links. */ + LIST_ENTRY(bmsafemap) sm_next; /* Mount list. */ int sm_cg; - LIST_ENTRY(bmsafemap) sm_hash; /* Hash links. */ struct buf *sm_buf; /* associated buffer */ struct allocdirecthd sm_allocdirecthd; /* allocdirect deps */ struct allocdirecthd sm_allocdirectwr; /* writing allocdirect deps */ @@ -355,6 +360,8 @@ struct bmsafemap { struct newblkhd sm_newblkwr; /* writing newblk deps */ struct jaddrefhd sm_jaddrefhd; /* Pending inode allocations. */ struct jnewblkhd sm_jnewblkhd; /* Pending block allocations. */ + struct workhead sm_freehd; /* Freedep deps. */ + struct workhead sm_freewr; /* Written freedeps. */ }; /* @@ -442,14 +449,15 @@ struct indirdep { struct worklist ir_list; /* buffer holding indirect block */ # define ir_state ir_list.wk_state /* indirect block pointer state */ LIST_ENTRY(indirdep) ir_next; /* alloc{direct,indir} list */ + TAILQ_HEAD(, freework) ir_trunc; /* List of truncations. */ caddr_t ir_saveddata; /* buffer cache contents */ struct buf *ir_savebp; /* buffer holding safe copy */ + struct buf *ir_bp; /* buffer holding live copy */ struct allocindirhd ir_completehd; /* waiting for indirdep complete */ struct allocindirhd ir_writehd; /* Waiting for the pointer write. */ struct allocindirhd ir_donehd; /* done waiting to update safecopy */ struct allocindirhd ir_deplisthd; /* allocindir deps for this block */ - struct jnewblkhd ir_jnewblkhd; /* Canceled block allocations. */ - struct workhead ir_jwork; /* Journal work pending. */ + struct freeblks *ir_freeblks; /* Freeblks that frees this indir. */ }; /* @@ -471,6 +479,7 @@ struct allocindir { LIST_ENTRY(allocindir) ai_next; /* indirdep's list of allocindir's */ struct indirdep *ai_indirdep; /* address of associated indirdep */ ufs2_daddr_t ai_oldblkno; /* old value of block pointer */ + ufs_lbn_t ai_lbn; /* Logical block number. */ int ai_offset; /* Pointer offset in parent. */ }; #define ai_newblkno ai_block.nb_newblkno @@ -516,14 +525,22 @@ struct freefrag { struct freeblks { struct worklist fb_list; /* id_inowait or delayed worklist */ # define fb_state fb_list.wk_state /* inode and dirty block state */ - struct jfreeblkhd fb_jfreeblkhd; /* Journal entries pending */ + TAILQ_ENTRY(freeblks) fb_next; /* List of inode truncates. */ + struct jblkdephd fb_jblkdephd; /* Journal entries pending */ struct workhead fb_freeworkhd; /* Work items pending */ struct workhead fb_jwork; /* Journal work pending */ - ino_t fb_previousinum; /* inode of previous owner of blocks */ + struct vnode *fb_devvp; /* filesystem device vnode */ +#ifdef QUOTA + struct dquot *fb_quota[MAXQUOTAS]; /* quotas to be adjusted */ +#endif + uint64_t fb_modrev; /* Inode revision at start of trunc. */ + off_t fb_len; /* Length we're truncating to. */ + ufs2_daddr_t fb_chkcnt; /* Expected blks released. */ + ufs2_daddr_t fb_freecnt; /* Actual blocks released. */ + ino_t fb_inum; /* inode owner of blocks */ uid_t fb_uid; /* uid of previous owner of blocks */ - struct vnode *fb_devvp; /* filesystem device vnode */ - ufs2_daddr_t fb_chkcnt; /* used to check cnt of blks released */ int fb_ref; /* Children outstanding. */ + int fb_cgwait; /* cg writes outstanding. */ }; /* @@ -538,16 +555,18 @@ struct freeblks { struct freework { struct worklist fw_list; /* Delayed worklist. */ # define fw_state fw_list.wk_state - LIST_ENTRY(freework) fw_next; /* For seg journal list. */ - struct jnewblk *fw_jnewblk; /* Journal entry to cancel. */ + LIST_ENTRY(freework) fw_segs; /* Seg list. */ + TAILQ_ENTRY(freework) fw_next; /* Hash/Trunc list. */ + struct jnewblk *fw_jnewblk; /* Journal entry to cancel. */ struct freeblks *fw_freeblks; /* Root of operation. */ struct freework *fw_parent; /* Parent indirect. */ + struct indirdep *fw_indir; /* indirect block. */ ufs2_daddr_t fw_blkno; /* Our block #. */ ufs_lbn_t fw_lbn; /* Original lbn before free. */ - int fw_frags; /* Number of frags. */ - int fw_ref; /* Number of children out. */ - int fw_off; /* Current working position. */ - struct workhead fw_jwork; /* Journal work pending. */ + uint16_t fw_frags; /* Number of frags. */ + uint16_t fw_ref; /* Number of children out. */ + uint16_t fw_off; /* Current working position. */ + uint16_t fw_start; /* Start of partial truncate. */ }; /* @@ -674,6 +693,7 @@ struct dirrem { LIST_ENTRY(dirrem) dm_inonext; /* inodedep's list of dirrem's */ struct jremrefhd dm_jremrefhd; /* Pending remove reference deps. */ ino_t dm_oldinum; /* inum of the removed dir entry */ + doff_t dm_offset; /* offset of removed dir entry in blk */ union { struct pagedep *dmu_pagedep; /* pagedep dependency for remove */ ino_t dmu_dirinum; /* parent inode number (for rmdir) */ @@ -707,7 +727,7 @@ struct dirrem { */ struct newdirblk { struct worklist db_list; /* id_inowait or pg_newdirblk */ -# define db_state db_list.wk_state /* unused */ +# define db_state db_list.wk_state struct pagedep *db_pagedep; /* associated pagedep */ struct workhead db_mkdir; }; @@ -807,29 +827,36 @@ struct jnewblk { # define jn_state jn_list.wk_state struct jsegdep *jn_jsegdep; /* Will track our journal record. */ LIST_ENTRY(jnewblk) jn_deps; /* Jnewblks on sm_jnewblkhd. */ - LIST_ENTRY(jnewblk) jn_indirdeps; /* Jnewblks on ir_jnewblkhd. */ struct worklist *jn_dep; /* Dependency to ref completed seg. */ - ino_t jn_ino; /* Ino to which allocated. */ ufs_lbn_t jn_lbn; /* Lbn to which allocated. */ ufs2_daddr_t jn_blkno; /* Blkno allocated */ + ino_t jn_ino; /* Ino to which allocated. */ int jn_oldfrags; /* Previous fragments when extended. */ int jn_frags; /* Number of fragments. */ }; /* + * A "jblkdep" structure tracks jfreeblk and jtrunc records attached to a + * freeblks structure. + */ +struct jblkdep { + struct worklist jb_list; /* For softdep journal pending. */ + struct jsegdep *jb_jsegdep; /* Reference to the jseg. */ + struct freeblks *jb_freeblks; /* Back pointer to freeblks. */ + LIST_ENTRY(jblkdep) jb_deps; /* Dep list on freeblks. */ + +}; + +/* * A "jfreeblk" structure tracks the journal write for freeing a block * or tree of blocks. The block pointer must not be cleared in the inode * or indirect prior to the jfreeblk being written to the journal. */ struct jfreeblk { - struct worklist jf_list; /* Linked to softdep_journal_pending. */ -# define jf_state jf_list.wk_state - struct jsegdep *jf_jsegdep; /* Will track our journal record. */ - struct freeblks *jf_freeblks; /* Back pointer to freeblks. */ - LIST_ENTRY(jfreeblk) jf_deps; /* Jfreeblk on fb_jfreeblkhd. */ - ino_t jf_ino; /* Ino from which blocks freed. */ + struct jblkdep jf_dep; /* freeblks linkage. */ ufs_lbn_t jf_lbn; /* Lbn from which blocks freed. */ ufs2_daddr_t jf_blkno; /* Blkno being freed. */ + ino_t jf_ino; /* Ino from which blocks freed. */ int jf_frags; /* Number of frags being freed. */ }; @@ -843,27 +870,34 @@ struct jfreefrag { # define fr_state fr_list.wk_state struct jsegdep *fr_jsegdep; /* Will track our journal record. */ struct freefrag *fr_freefrag; /* Back pointer to freefrag. */ - ino_t fr_ino; /* Ino from which frag freed. */ ufs_lbn_t fr_lbn; /* Lbn from which frag freed. */ ufs2_daddr_t fr_blkno; /* Blkno being freed. */ + ino_t fr_ino; /* Ino from which frag freed. */ int fr_frags; /* Size of frag being freed. */ }; /* - * A "jtrunc" journals the intent to truncate an inode to a non-zero - * value. This is done synchronously prior to the synchronous partial - * truncation process. The jsegdep is not released until the truncation - * is complete and the truncated inode is fsync'd. + * A "jtrunc" journals the intent to truncate an inode's data or extent area. */ struct jtrunc { - struct worklist jt_list; /* Linked to softdep_journal_pending. */ - struct jsegdep *jt_jsegdep; /* Will track our journal record. */ - ino_t jt_ino; /* Ino being truncated. */ - off_t jt_size; /* Final file size. */ - int jt_extsize; /* Final extent size. */ + struct jblkdep jt_dep; /* freeblks linkage. */ + off_t jt_size; /* Final file size. */ + int jt_extsize; /* Final extent size. */ + ino_t jt_ino; /* Ino being truncated. */ }; /* + * A "jfsync" journals the completion of an fsync which invalidates earlier + * jtrunc records in the journal. + */ +struct jfsync { + struct worklist jfs_list; /* For softdep journal pending. */ + off_t jfs_size; /* Sync file size. */ + int jfs_extsize; /* Sync extent size. */ + ino_t jfs_ino; /* ino being synced. */ +}; + +/* * A "jsegdep" structure tracks a single reference to a written journal * segment so the journal space can be reclaimed when all dependencies * have been written. It can hang off of id_inowait, dm_jwork, da_jwork, Index: /usr/src/sys/ufs/ffs/ffs_balloc.c =================================================================== --- /usr/src/sys/ufs/ffs/ffs_balloc.c (revision 222894) +++ /usr/src/sys/ufs/ffs/ffs_balloc.c (working copy) @@ -105,6 +105,7 @@ ffs_balloc_ufs1(struct vnode *vp, off_t startoffse ufs2_daddr_t *lbns_remfree, lbns[NIADDR + 1]; int unwindidx = -1; int saved_inbdflush; + int reclaimed; ip = VTOI(vp); dp = ip->i_din1; @@ -112,6 +113,7 @@ ffs_balloc_ufs1(struct vnode *vp, off_t startoffse ump = ip->i_ump; lbn = lblkno(fs, startoffset); size = blkoff(fs, startoffset) + size; + reclaimed = 0; if (size > fs->fs_bsize) panic("ffs_balloc_ufs1: blk too big"); *bpp = NULL; @@ -276,6 +278,7 @@ ffs_balloc_ufs1(struct vnode *vp, off_t startoffse /* * Fetch through the indirect blocks, allocating as necessary. */ +retry: for (i = 1;;) { error = bread(vp, indirs[i].in_lbn, (int)fs->fs_bsize, NOCRED, &bp); @@ -296,8 +299,15 @@ ffs_balloc_ufs1(struct vnode *vp, off_t startoffse if (pref == 0) pref = ffs_blkpref_ufs1(ip, lbn, 0, (ufs1_daddr_t *)0); if ((error = ffs_alloc(ip, lbn, pref, (int)fs->fs_bsize, - flags, cred, &newb)) != 0) { + flags | IO_BUFLOCKED, cred, &newb)) != 0) { brelse(bp); + if (++reclaimed == 1) { + UFS_LOCK(ump); + softdep_request_cleanup(fs, vp, cred, + FLUSH_BLOCKS_WAIT); + UFS_UNLOCK(ump); + goto retry; + } goto fail; } nb = newb; @@ -349,10 +359,17 @@ ffs_balloc_ufs1(struct vnode *vp, off_t startoffse if (nb == 0) { UFS_LOCK(ump); pref = ffs_blkpref_ufs1(ip, lbn, indirs[i].in_off, &bap[0]); - error = ffs_alloc(ip, - lbn, pref, (int)fs->fs_bsize, flags, cred, &newb); + error = ffs_alloc(ip, lbn, pref, (int)fs->fs_bsize, + flags | IO_BUFLOCKED, cred, &newb); if (error) { brelse(bp); + if (++reclaimed == 1) { + UFS_LOCK(ump); + softdep_request_cleanup(fs, vp, cred, + FLUSH_BLOCKS_WAIT); + UFS_UNLOCK(ump); + goto retry; + } goto fail; } nb = newb; @@ -506,6 +523,7 @@ ffs_balloc_ufs2(struct vnode *vp, off_t startoffse int deallocated, osize, nsize, num, i, error; int unwindidx = -1; int saved_inbdflush; + int reclaimed; ip = VTOI(vp); dp = ip->i_din2; @@ -513,6 +531,7 @@ ffs_balloc_ufs2(struct vnode *vp, off_t startoffse ump = ip->i_ump; lbn = lblkno(fs, startoffset); size = blkoff(fs, startoffset) + size; + reclaimed = 0; if (size > fs->fs_bsize) panic("ffs_balloc_ufs2: blk too big"); *bpp = NULL; @@ -787,6 +806,7 @@ ffs_balloc_ufs2(struct vnode *vp, off_t startoffse /* * Fetch through the indirect blocks, allocating as necessary. */ +retry: for (i = 1;;) { error = bread(vp, indirs[i].in_lbn, (int)fs->fs_bsize, NOCRED, &bp); @@ -807,8 +827,15 @@ ffs_balloc_ufs2(struct vnode *vp, off_t startoffse if (pref == 0) pref = ffs_blkpref_ufs2(ip, lbn, 0, (ufs2_daddr_t *)0); if ((error = ffs_alloc(ip, lbn, pref, (int)fs->fs_bsize, - flags, cred, &newb)) != 0) { + flags | IO_BUFLOCKED, cred, &newb)) != 0) { brelse(bp); + if (++reclaimed == 1) { + UFS_LOCK(ump); + softdep_request_cleanup(fs, vp, cred, + FLUSH_BLOCKS_WAIT); + UFS_UNLOCK(ump); + goto retry; + } goto fail; } nb = newb; @@ -860,10 +887,17 @@ ffs_balloc_ufs2(struct vnode *vp, off_t startoffse if (nb == 0) { UFS_LOCK(ump); pref = ffs_blkpref_ufs2(ip, lbn, indirs[i].in_off, &bap[0]); - error = ffs_alloc(ip, - lbn, pref, (int)fs->fs_bsize, flags, cred, &newb); + error = ffs_alloc(ip, lbn, pref, (int)fs->fs_bsize, + flags | IO_BUFLOCKED, cred, &newb); if (error) { brelse(bp); + if (++reclaimed == 1) { + UFS_LOCK(ump); + softdep_request_cleanup(fs, vp, cred, + FLUSH_BLOCKS_WAIT); + UFS_UNLOCK(ump); + goto retry; + } goto fail; } nb = newb; Index: /usr/src/sys/ufs/ffs/ffs_inode.c =================================================================== --- /usr/src/sys/ufs/ffs/ffs_inode.c (revision 222894) +++ /usr/src/sys/ufs/ffs/ffs_inode.c (working copy) @@ -151,12 +151,12 @@ ffs_truncate(vp, length, flags, cred, td) ufs2_daddr_t bn, lbn, lastblock, lastiblock[NIADDR], indir_lbn[NIADDR]; ufs2_daddr_t oldblks[NDADDR + NIADDR], newblks[NDADDR + NIADDR]; ufs2_daddr_t count, blocksreleased = 0, datablocks; - void *cookie; struct bufobj *bo; struct fs *fs; struct buf *bp; struct ufsmount *ump; - int needextclean, softdepslowdown, extblocks; + int softdeptrunc, journaltrunc; + int needextclean, extblocks; int offset, size, level, nblocks; int i, error, allerror; off_t osize; @@ -165,7 +165,6 @@ ffs_truncate(vp, length, flags, cred, td) fs = ip->i_fs; ump = ip->i_ump; bo = &vp->v_bufobj; - cookie = NULL; ASSERT_VOP_LOCKED(vp, "ffs_truncate"); @@ -173,6 +172,11 @@ ffs_truncate(vp, length, flags, cred, td) return (EINVAL); if (length > fs->fs_maxfilesize) return (EFBIG); +#ifdef QUOTA + error = getinoquota(ip); + if (error) + return (error); +#endif /* * Historically clients did not have to specify which data * they were truncating. So, if not specified, we assume @@ -191,7 +195,10 @@ ffs_truncate(vp, length, flags, cred, td) */ allerror = 0; needextclean = 0; - softdepslowdown = DOINGSOFTDEP(vp) && softdep_slowdown(vp); + softdeptrunc = 0; + journaltrunc = DOINGSUJ(vp); + if (journaltrunc == 0 && DOINGSOFTDEP(vp) && length == 0) + softdeptrunc = !softdep_slowdown(vp); extblocks = 0; datablocks = DIP(ip, i_blocks); if (fs->fs_magic == FS_UFS2_MAGIC && ip->i_din2->di_extsize > 0) { @@ -199,27 +206,23 @@ ffs_truncate(vp, length, flags, cred, td) datablocks -= extblocks; } if ((flags & IO_EXT) && extblocks > 0) { - if (DOINGSOFTDEP(vp) && softdepslowdown == 0 && length == 0) { - if ((flags & IO_NORMAL) == 0) { - softdep_setup_freeblocks(ip, length, IO_EXT); - return (0); - } + if (length != 0) + panic("ffs_truncate: partial trunc of extdata"); + if (softdeptrunc || journaltrunc) { + if ((flags & IO_NORMAL) == 0) + goto extclean; needextclean = 1; } else { - if (length != 0) - panic("ffs_truncate: partial trunc of extdata"); if ((error = ffs_syncvnode(vp, MNT_WAIT)) != 0) return (error); - if (DOINGSUJ(vp)) - cookie = softdep_setup_trunc(vp, length, flags); - osize = ip->i_din2->di_extsize; - ip->i_din2->di_blocks -= extblocks; #ifdef QUOTA (void) chkdq(ip, -extblocks, NOCRED, 0); #endif vinvalbuf(vp, V_ALT, 0, 0); ffs_pages_remove(vp, OFF_TO_IDX(lblktosize(fs, -extblocks)), 0); + osize = ip->i_din2->di_extsize; + ip->i_din2->di_blocks -= extblocks; ip->i_din2->di_extsize = 0; for (i = 0; i < NXADDR; i++) { oldblks[i] = ip->i_din2->di_extb[i]; @@ -227,7 +230,7 @@ ffs_truncate(vp, length, flags, cred, td) } ip->i_flag |= IN_CHANGE; if ((error = ffs_update(vp, 1))) - goto out; + return (error); for (i = 0; i < NXADDR; i++) { if (oldblks[i] == 0) continue; @@ -236,10 +239,8 @@ ffs_truncate(vp, length, flags, cred, td) } } } - if ((flags & IO_NORMAL) == 0) { - error = 0; - goto out; - } + if ((flags & IO_NORMAL) == 0) + return (0); if (vp->v_type == VLNK && (ip->i_size < vp->v_mount->mnt_maxsymlinklen || datablocks == 0)) { @@ -252,24 +253,17 @@ ffs_truncate(vp, length, flags, cred, td) DIP_SET(ip, i_size, 0); ip->i_flag |= IN_CHANGE | IN_UPDATE; if (needextclean) - softdep_setup_freeblocks(ip, length, IO_EXT); - error = ffs_update(vp, 1); - goto out; + goto extclean; + return ffs_update(vp, 1); } if (ip->i_size == length) { ip->i_flag |= IN_CHANGE | IN_UPDATE; if (needextclean) - softdep_setup_freeblocks(ip, length, IO_EXT); - error = ffs_update(vp, 0); - goto out; + goto extclean; + return ffs_update(vp, 0); } if (fs->fs_ronly) panic("ffs_truncate: read-only filesystem"); -#ifdef QUOTA - error = getinoquota(ip); - if (error) - goto out; -#endif if ((ip->i_flags & SF_SNAPSHOT) != 0) ffs_snapremove(vp); vp->v_lasta = vp->v_clen = vp->v_cstart = vp->v_lastw = 0; @@ -285,7 +279,7 @@ ffs_truncate(vp, length, flags, cred, td) error = UFS_BALLOC(vp, length - 1, 1, cred, flags, &bp); if (error) { vnode_pager_setsize(vp, osize); - goto out; + return (error); } ip->i_size = length; DIP_SET(ip, i_size, length); @@ -296,11 +290,10 @@ ffs_truncate(vp, length, flags, cred, td) else bawrite(bp); ip->i_flag |= IN_CHANGE | IN_UPDATE; - error = ffs_update(vp, 1); - goto out; + return ffs_update(vp, 1); } if (DOINGSOFTDEP(vp)) { - if (length > 0 || softdepslowdown) { + if (softdeptrunc == 0 && journaltrunc == 0) { /* * If a file is only partially truncated, then * we have to clean up the data structures @@ -311,29 +304,37 @@ ffs_truncate(vp, length, flags, cred, td) * so that it will have no data structures left. */ if ((error = ffs_syncvnode(vp, MNT_WAIT)) != 0) - goto out; - /* - * We have to journal the truncation before we change - * any blocks so we don't leave the file partially - * truncated. - */ - if (DOINGSUJ(vp) && cookie == NULL) - cookie = softdep_setup_trunc(vp, length, flags); + return (error); } else { -#ifdef QUOTA - (void) chkdq(ip, -datablocks, NOCRED, 0); -#endif - softdep_setup_freeblocks(ip, length, needextclean ? - IO_EXT | IO_NORMAL : IO_NORMAL); + flags = IO_NORMAL | (needextclean ? IO_EXT: 0); + if (journaltrunc) + softdep_journal_freeblocks(ip, cred, length, + flags); + else + softdep_setup_freeblocks(ip, length, flags); ASSERT_VOP_LOCKED(vp, "ffs_truncate1"); - vinvalbuf(vp, needextclean ? 0 : V_NORMAL, 0, 0); - if (!needextclean) - ffs_pages_remove(vp, 0, + if (needextclean) { + vinvalbuf(vp, V_ALT, 0, 0); + ffs_pages_remove(vp, + OFF_TO_IDX(lblktosize(fs, -extblocks)), 0); + } + error = vtruncbuf(vp, cred, td, length, fs->fs_bsize); + /* + * Remove discarded indirect pages. vtruncbuf takes + * care of file data. + */ + if (length) { + ffs_pages_remove(vp, + OFF_TO_IDX(length + PAGE_MASK), OFF_TO_IDX(lblktosize(fs, -extblocks))); - vnode_pager_setsize(vp, 0); - ip->i_flag |= IN_CHANGE | IN_UPDATE; - error = ffs_update(vp, 0); - goto out; + } else + ffs_pages_remove(vp, 0, + OFF_TO_IDX(lblktosize(fs, -extblocks))); + if (journaltrunc == 0) { + ip->i_flag |= IN_CHANGE | IN_UPDATE; + error = ffs_update(vp, 0); + } + return (error); } } /* @@ -353,7 +354,7 @@ ffs_truncate(vp, length, flags, cred, td) flags |= BA_CLRBUF; error = UFS_BALLOC(vp, length - 1, 1, cred, flags, &bp); if (error) - goto out; + return (error); /* * When we are doing soft updates and the UFS_BALLOC * above fills in a direct block hole with a full sized @@ -365,7 +366,7 @@ ffs_truncate(vp, length, flags, cred, td) if (DOINGSOFTDEP(vp) && lbn < NDADDR && fragroundup(fs, blkoff(fs, length)) < fs->fs_bsize && (error = ffs_syncvnode(vp, MNT_WAIT)) != 0) - goto out; + return (error); ip->i_size = length; DIP_SET(ip, i_size, length); size = blksize(fs, ip, lbn); @@ -411,13 +412,7 @@ ffs_truncate(vp, length, flags, cred, td) DIP_SET(ip, i_db[i], 0); } ip->i_flag |= IN_CHANGE | IN_UPDATE; - /* - * When doing softupdate journaling we must preserve the size along - * with the old pointers until they are freed or we might not - * know how many fragments remain. - */ - if (!DOINGSUJ(vp)) - allerror = ffs_update(vp, 1); + allerror = ffs_update(vp, 1); /* * Having written the new inode to disk, save its new configuration @@ -541,14 +536,17 @@ done: #ifdef QUOTA (void) chkdq(ip, -blocksreleased, NOCRED, 0); #endif - error = allerror; -out: - if (cookie) { - allerror = softdep_complete_trunc(vp, cookie); - if (allerror != 0 && error == 0) - error = allerror; - } - return (error); + return (allerror); + +extclean: + if (journaltrunc) + softdep_journal_freeblocks(ip, cred, length, IO_EXT); + else + softdep_setup_freeblocks(ip, length, IO_EXT); + + vinvalbuf(vp, V_ALT, 0, 0); + ffs_pages_remove(vp, OFF_TO_IDX(lblktosize(fs, -extblocks)), 0); + return ffs_update(vp, MNT_WAIT); } /* Index: /usr/src/sys/ufs/ffs/fs.h =================================================================== --- /usr/src/sys/ufs/ffs/fs.h (revision 222894) +++ /usr/src/sys/ufs/ffs/fs.h (working copy) @@ -664,6 +664,7 @@ lbn_offset(struct fs *fs, int level) #define JOP_FREEBLK 4 /* Free a block or a tree of blocks. */ #define JOP_MVREF 5 /* Move a reference from one off to another. */ #define JOP_TRUNC 6 /* Partial truncation record. */ +#define JOP_SYNC 7 /* fsync() complete record. */ #define JREC_SIZE 32 /* Record and segment header size. */ @@ -715,7 +716,9 @@ struct jmvrec { /* * Block record. A set of frags or tree of blocks starting at an indirect are - * freed or a set of frags are allocated. + * freed or a set of frags are allocated. If indiroff is set, only a subset + * of the pointers in an indirect block are freed and the indirect itself + * is retained. */ struct jblkrec { uint32_t jb_op; @@ -724,12 +727,12 @@ struct jblkrec { ufs_lbn_t jb_lbn; uint16_t jb_frags; uint16_t jb_oldfrags; - uint32_t jb_unused; + uint32_t jb_indiroff; }; /* * Truncation record. Records a partial truncation so that it may be - * completed later. + * completed at check time. Also used for sync records. */ struct jtrncrec { uint32_t jt_op; Index: /usr/src/sys/kern/vfs_bio.c =================================================================== --- /usr/src/sys/kern/vfs_bio.c (revision 222894) +++ /usr/src/sys/kern/vfs_bio.c (working copy) @@ -3999,10 +3999,11 @@ DB_SHOW_COMMAND(buffer, db_show_buffer) db_printf("b_flags = 0x%b\n", (u_int)bp->b_flags, PRINT_BUF_FLAGS); db_printf( "b_error = %d, b_bufsize = %ld, b_bcount = %ld, b_resid = %ld\n" - "b_bufobj = (%p), b_data = %p, b_blkno = %jd, b_dep = %p\n", + "b_bufobj = (%p), b_data = %p, b_blkno = %jd, b_lblkno = %jd, " + "b_dep = %p\n", bp->b_error, bp->b_bufsize, bp->b_bcount, bp->b_resid, bp->b_bufobj, bp->b_data, (intmax_t)bp->b_blkno, - bp->b_dep.lh_first); + (intmax_t)bp->b_lblkno, bp->b_dep.lh_first); if (bp->b_npages) { int i; db_printf("b_npages = %d, pages(OBJ, IDX, PA): ", bp->b_npages); Index: /usr/src/sys/kern/vfs_subr.c =================================================================== --- /usr/src/sys/kern/vfs_subr.c (revision 222894) +++ /usr/src/sys/kern/vfs_subr.c (working copy) @@ -1376,7 +1376,7 @@ restart: } } - if (length > 0) { + if (length > 0 && (vp->v_mount->mnt_kern_flag & MNTK_SUJ) == 0) { restartsync: TAILQ_FOREACH_SAFE(bp, &bo->bo_dirty.bv_hd, b_bobufs, nbp) { if (bp->b_lblkno > 0) @@ -1393,9 +1393,7 @@ restartsync: VNASSERT((bp->b_flags & B_DELWRI), vp, ("buf(%p) on dirty queue without DELWRI", bp)); - BO_LOCK(bo); bremfree(bp); - BO_UNLOCK(bo); bawrite(bp); BO_LOCK(bo); goto restartsync; Index: /usr/src/sys/sys/vnode.h =================================================================== --- /usr/src/sys/sys/vnode.h (revision 222894) +++ /usr/src/sys/sys/vnode.h (working copy) @@ -302,6 +302,7 @@ struct vattr { #define IO_EXT 0x0400 /* operate on external attributes */ #define IO_NORMAL 0x0800 /* operate on regular data */ #define IO_NOMACCHECK 0x1000 /* MAC checks unnecessary */ +#define IO_BUFLOCKED 0x2000 /* ffs flag; indir buf is locked */ #define IO_SEQMAX 0x7F /* seq heuristic max value */ #define IO_SEQSHIFT 16 /* seq heuristic in upper 16 bits */ -- Test scenario: suj19.2h (SUJ, quota and snapshots test scenario).