GENERIC from Mon Feb 15 00:00:40 2010 +0200, nbufkv e0c7eab, vmcore.419 KDB: debugger backends: ddb KDB: current backend: ddb 524288K of memory above 4GB ignored Copyright (c) 1992-2010 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 r203875+e0c7eab-dirty: Tue Feb 16 19:49:30 CET 2010 pho@x4.osted.lan:/var/tmp/deviant2/sys/i386/compile/PHO i386 WARNING: WITNESS option enabled, expect reduced performance. WARNING: DIAGNOSTIC option enabled, expect reduced performance. Timecounter "i8254" frequency 1193182 Hz quality 0 CPU: AMD Phenom(tm) 9150e Quad-Core Processor (1799.99-MHz 686-class CPU) Origin = "AuthenticAMD" Id = 0x100f23 Stepping = 3 Features=0x178bfbff Features2=0x802009 AMD Features=0xee500800 AMD Features2=0x7ff TSC: P-state invariant real memory = 4294967296 (4096 MB) avail memory = 3536146432 (3372 MB) : Trying to mount root from ufs:/dev/ad4s1a Entropy harvesting: interrupts ethernet point_to_point kickstart. /dev/ad4s1a: FILE SYSTEM CLEAN; SKIPPING CHECKS /dev/ad4s1a: clean, 199301 free (1765 frags, 24692 blocks, 0.2% fragmentation) /dev/ad4s1e: FILE SYSTEM CLEAN; SKIPPING CHECKS /dev/ad4s1e: clean, 49746491 free (2067 frags, 6218053 blocks, 0.0% fragmentation) /dev/ad4s1f: FILE SYSTEM CLEAN; SKIPPING CHECKS /dev/ad4s1f: clean, 3904454 free (238374 frags, 458260 blocks, 1.1% fragmentation) /dev/ad4s1d: FILE SYSTEM CLEAN; SKIPPING CHECKS /dev/ad4s1d: clean, 11906317 free (97301 frags, 1476127 blocks, 0.2% fragmentation) Additional TCP/IP options: rfc1323 extensions=NO no-ipv4-mapped-ipv6. re0: link state changed to DOWN Starting Network: lo0 re0 fwe0 fwip0. Starting Network: fwe0. Starting Network: fwip0. 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 Additional ABI support: linux. lock order reversal: 1st 0xe6d1db40 bufwait (bufwait) @ kern/vfs_bio.c:2540 2nd 0xc7422400 dirhash (dirhash) @ ufs/ufs/ufs_dirhash.c:285 KDB: stack backtrace: db_trace_self_wrapper(c0ca4edf,f625d868,c08d8ae5,c08c952b,c0ca7e85,...) at db_trace_self_wrapper+0x26 kdb_backtrace(c08c952b,c0ca7e85,c6d2ffc8,c6d33910,f625d8c4,...) at kdb_backtrace+0x29 _witness_debugger(c0ca7e85,c7422400,c0cca369,c6d33910,c0cc9ffb,...) at _witness_debugger+0x25 witness_checkorder(c7422400,9,c0cc9ff2,11d,0,...) at witness_checkorder+0x839 _sx_xlock(c7422400,0,c0cc9ff2,11d,c760f32c,...) at _sx_xlock+0x85 ufsdirhash_acquire(e6d1dae0,f625da20,50,e77a85e8,f625d994,...) at ufsdirhash_acquire+0x48 ufsdirhash_add(c760f32c,f625da20,35e8,f625d980,f625d984,...) at ufsdirhash_add+0x13 ufs_direnter(c760e000,c7855000,f625da20,f625dc00,e6d1e300,...) at ufs_direnter+0x779 ufs_mkdir(f625dc28,c0cdf981,0,0,f625db6c,...) at ufs_mkdir+0x92e VOP_MKDIR_APV(c0dafec0,f625dc28,f625dc00,f625db6c,2,...) at VOP_MKDIR_APV+0xc5 kern_mkdirat(c741c480,ffffff9c,bfbfef5a,0,1ff,...) at kern_mkdirat+0x19e kern_mkdir(c741c480,bfbfef5a,0,1ff,f625dd2c,...) at kern_mkdir+0x2e mkdir(c741c480,f625dcf8,c0cdc9ff,c0ca872d,c77a1d48,...) at mkdir+0x29 syscall(f625dd38) at syscall+0x230 Xint0x80_syscall() at Xint0x80_syscall+0x20 --- syscall (136, FreeBSD ELF32, mkdir), eip = 0x2816bbd3, esp = 0xbfbfed6c, ebp = 0xbfbfee38 --- Configuring syscons: keymap blanktime. Local package initialization:lock order reversal: 1st 0xc760e310 ufs (ufs) @ kern/vfs_mount.c:1204 2nd 0xc74ef880 devfs (devfs) @ ufs/ffs/ffs_vfsops.c:1384 KDB: stack backtrace: db_trace_self_wrapper(c0ca4edf,f62cda10,c08d8ae5,c08c952b,c0ca7e85,...) at db_trace_self_wrapper+0x26 kdb_backtrace(c08c952b,c0ca7e85,c6d338a8,c6d33770,f62cda6c,...) at kdb_backtrace+0x29 _witness_debugger(c0ca7e85,c74ef880,c0c96135,c6d33770,c0cc9621,...) at _witness_debugger+0x25 witness_checkorder(c74ef880,9,c0cc9618,568,c74ef8ec,...) at witness_checkorder+0x839 __lockmgr_args(c74ef880,80400,c74ef8ec,0,0,...) at __lockmgr_args+0x804 vop_stdlock(f62cdb88,c0f3e660,c74f89a4,80400,c74ef828,...) at vop_stdlock+0x65 VOP_LOCK1_APV(c0d8a2c0,f62cdb88,f62cdba8,c0dca860,c74ef828,...) at VOP_LOCK1_APV+0xb5 _vn_lock(c74ef828,80400,c0cc9618,568,c0caf9b7,...) at _vn_lock+0x78 ffs_sync(c76105a8,1,c0cae71e,4f9,80,...) at ffs_sync+0x3d5 dounmount(c76105a8,8000000,c74f8900,47e,ff1ca3a5,...) at dounmount+0x44e unmount(c74f8900,f62cdcf8,c,c74f8900,c7abc000,...) at unmount+0x2ff syscall(f62cdd38) at syscall+0x230 Xint0x80_syscall() at Xint0x80_syscall+0x20 --- syscall (22, FreeBSD ELF32, unmount), eip = 0x280da49f, esp = 0xbfbfe68c, ebp = 0xbfbfe758 --- ** /dev/ad4s1e ** 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 47030 files, 1030584 used, 49746491 free (2067 frags, 6218053 blocks, 0.0% fragmentation) ***** FILE SYSTEM IS CLEAN ***** usage: kill [-s signal_name] pid ... kill -l [exit_status] kill -signal_name pid ... kill -signal_number pid ... fsck -y /tmp watchdogd. Tue Feb 16 20:11:59 CET 2010 FreeBSD/i386 (x4.osted.lan) (console) login: Feb 16 20:12:07 x4 su: pho to root on /dev/pts/0 panic: Lock fatlk not exclusively locked @ ../../../fs/msdosfs/msdosfs_fat.c:426 cpuid = 0 KDB: enter: panic [ thread pid 1423 tid 100161 ] Stopped at kdb_enter+0x3a: movl $0,kdb_why db> run pho db:0:pho> bt Tracing pid 1423 tid 100161 td 0xc7ad6b40 kdb_enter(c0ca19f2,c0ca19f2,c0c9e84a,f62dca14,0,...) at kdb_enter+0x3a panic(c0c9e84a,c0c22ec5,c0c967ea,1aa,f62dca50,...) at panic+0x136 _lockmgr_assert(c78af6b4,4,c0c967ea,1aa,0,...) at _lockmgr_assert+0x165 freeclusterchain(c78af600,4,c7ad6b40,0,0,...) at freeclusterchain+0xe1 detrunc(c7472180,0,0,0,c7ad6b40,...) at detrunc+0x2f2 msdosfs_inactive(f62dcb04,c0cdf7ae,c7462634,c7462634,c7462570,...) at msdosfs_inactive+0x99 VOP_INACTIVE_APV(c0d8a820,f62dcb04,c0caef20,8f5,c0dca820,...) at VOP_INACTIVE_APV+0xc5 vinactive(c0d8a820,f62dcb38,c0caef20,854,0,...) at vinactive+0xb1 vputx(f62dcc50,c092bb0a,c7462570,ffffffdf,c7462570,...) at vputx+0x307 vput(c7462570,ffffffdf,c7462570,f62dcc08,4,...) at vput+0x10 kern_unlinkat(c7ad6b40,ffffff9c,bfbfe724,0,0,...) at kern_unlinkat+0x1ea kern_unlink(c7ad6b40,bfbfe724,0,f62dcd2c,c0bc8aa0,...) at kern_unlink+0x2f unlink(c7ad6b40,f62dccf8,c0cdc9ff,c0cc3c45,c7abb2a8,...) at unlink+0x22 syscall(f62dcd38) at syscall+0x230 Xint0x80_syscall() at Xint0x80_syscall+0x20 --- syscall (10, FreeBSD ELF32, unlink), eip = 0x2817c14f, esp = 0xbfbfd6fc, ebp = 0xbfbfe7a8 --- db:0:bt> show allpcpu Current CPU: 0 cpuid = 0 dynamic pcpu = 0x65a080 curthread = 0xc7ad6b40: pid 1423 "rw" curpcb = 0xf62dcd90 fpcurthread = none idlethread = 0xc6d7b480: pid 11 "idle: cpu0" APIC ID = 0 currentldt = 0x50 spin locks held: cpuid = 1 dynamic pcpu = 0x5d3f080 curthread = 0xc6d7b6c0: pid 11 "idle: cpu1" curpcb = 0xc6b30d90 fpcurthread = none idlethread = 0xc6d7b6c0: pid 11 "idle: cpu1" APIC ID = 1 currentldt = 0x50 spin locks held: cpuid = 2 dynamic pcpu = 0x5d42080 curthread = 0xc6d7b900: pid 11 "idle: cpu2" curpcb = 0xc6b2dd90 fpcurthread = none idlethread = 0xc6d7b900: pid 11 "idle: cpu2" APIC ID = 2 currentldt = 0x50 spin locks held: cpuid = 3 dynamic pcpu = 0x5d45080 curthread = 0xc6d7bb40: pid 11 "idle: cpu3" curpcb = 0xc6b2ad90 fpcurthread = none idlethread = 0xc6d7bb40: pid 11 "idle: cpu3" APIC ID = 3 currentldt = 0x50 spin locks held: db:0:allpcpu> show alllocks Process 1423 (rw) thread 0xc7ad6b40 (100161) exclusive lockmgr bufwait (bufwait) r = 0 (0xe6db75e0) locked @ kern/vfs_bio.c:2540 exclusive lockmgr msdosfs (msdosfs) r = 0 (0xc74625c8) locked @ kern/vfs_subr.c:2054 Process 1288 (sshd) thread 0xc7ad8240 (100158) exclusive sx so_rcv_sx (so_rcv_sx) r = 0 (0xc7ad0560) locked @ kern/uipc_sockbuf.c:148 db:0:alllocks> show lockedvnods Locked vnodes 0xc7462570: tag msdosfs, type VREG usecount 0, writecount 0, refcount 2 mountedhere 0 flags (VI_DOINGINACT) v_object 0xc763f660 ref 0 pages 1 lock type msdosfs: EXCL by thread 0xc7ad6b40 (pid 1423) #0 0xc087b93e at __lockmgr_args+0xbfe #1 0xc09174c5 at vop_stdlock+0x65 #2 0xc0be1905 at VOP_LOCK1_APV+0xb5 #3 0xc0932608 at _vn_lock+0x78 #4 0xc0927269 at vget+0x99 #5 0xc091a86d at vfs_hash_get+0xed #6 0xc0819682 at deget+0x82 #7 0xc081d519 at msdosfs_lookup_+0x779 #8 0xc081d9ce at msdosfs_lookup+0x1e #9 0xc0be00d5 at VOP_CACHEDLOOKUP_APV+0xc5 #10 0xc0914d36 at vfs_cache_lookup+0xd6 #11 0xc0be2a85 at VOP_LOOKUP_APV+0xe5 #12 0xc091b9eb at lookup+0x58b #13 0xc091c38e at namei+0x38e #14 0xc092b971 at kern_unlinkat+0x51 #15 0xc092bb5f at kern_unlink+0x2f #16 0xc092bb92 at unlink+0x22 #17 0xc0bc8aa0 at syscall+0x230 startcluster 0, dircluster 3, diroffset 96, on dev md5a db:0:lockedvnods> show mount 0xc73b0b50 /dev/ad4s1a on / (ufs) 0xc73b1000 devfs on /dev (devfs) 0xc76102d4 /dev/ad4s1f on /usr (ufs) 0xc7610000 /dev/ad4s1d on /var (ufs) 0xc73b1b50 procfs on /proc (procfs) 0xc73b087c /dev/ad4s1e on /tmp (ufs) 0xc73b05a8 /dev/md5a on /mnt (msdosfs) More info: show mount db:0:mount> ps pid ppid pgrp uid state wmesg wchan cmd 1435 1422 1393 0 S+ nanslp 0xc0dff9e4 rw 1434 1422 1393 0 S+ nanslp 0xc0dff9e4 rw 1433 1422 1393 0 S+ nanslp 0xc0dff9e4 rw 1432 1422 1393 0 S+ nanslp 0xc0dff9e4 rw 1431 1424 1393 0 S+ nanslp 0xc0dff9e4 mkdir 1430 1422 1393 0 S+ nanslp 0xc0dff9e4 rw 1429 1424 1393 0 S+ nanslp 0xc0dff9e4 mkdir 1428 1422 1393 0 S+ nanslp 0xc0dff9e4 rw 1427 1424 1393 0 S+ nanslp 0xc0dff9e4 mkdir 1426 1422 1393 0 S+ nanslp 0xc0dff9e4 rw 1425 1422 1393 0 S+ nanslp 0xc0dff9e4 rw 1424 1421 1393 0 S+ wait 0xc79172a8 mkdir 1423 1422 1393 0 R+ CPU 0 rw 1422 1419 1393 0 S+ wait 0xc7916d48 rw 1421 1418 1393 0 S+ nanslp 0xc0dff9e4 mkdir 1419 1418 1393 0 S+ nanslp 0xc0dff9e4 rw 1418 1417 1393 0 S+ wait 0xc74f2550 run 1417 1416 1393 0 S+ wait 0xc79162a8 run 1416 1412 1393 0 S+ nanslp 0xc0dff9e4 run 1412 1393 1393 0 S+ wait 0xc7916aa0 sh 1406 0 0 0 DL mdwait 0xc73d1800 [md5] 1393 1388 1393 0 S+ wait 0xc74f2000 sh 1388 1384 1388 0 S+ wait 0xc77a12a8 bash 1384 1383 1384 0 S+ pause 0xc746a300 csh 1383 1291 1383 1001 S+ wait 0xc746e550 su 1382 1 1382 0 Ss+ ttyin 0xc6facc70 getty 1381 1 1381 0 Ss+ ttyin 0xc70eb270 getty 1380 1 1380 0 Ss+ ttyin 0xc70ea670 getty 1379 1 1379 0 Ss+ ttyin 0xc70eac70 getty 1378 1 1378 0 Ss+ ttyin 0xc6face70 getty 1377 1 1377 0 Ss+ ttyin 0xc6fac070 getty 1376 1 1376 0 Ss+ ttyin 0xc70ea270 getty 1375 1 1375 0 Ss+ ttyin 0xc6fac470 getty 1374 1 1374 0 Ss+ ttyin 0xc6faca70 getty 1343 1 1343 0 Ss select 0xc74ae7a4 inetd 1307 1 1307 0 Ss nanslp 0xc0dff9e4 watchdogd 1291 1290 1291 1001 Ss+ wait 0xc7abb7f8 bash 1290 1288 1288 1001 S select 0xc76565a4 sshd 1288 1256 1288 0 Ss sbwait 0xc7ad058c sshd 1275 1 1275 0 Ss nanslp 0xc0dff9e4 cron 1268 1 1268 25 Ss pause 0xc7425058 sendmail 1264 1 1264 0 Ss select 0xc73b6964 sendmail 1256 1 1256 0 Ss select 0xc76566a4 sshd 1184 1 1184 0 Ss select 0xc73b6e24 moused 1118 1 1118 0 Ss select 0xc73723a4 ntpd 1030 1 1030 0 Ss rpcsvc 0xc7476110 NLM: master 1023 1 1023 0 Ss select 0xc73b6ce4 rpc.statd 1016 1015 1015 0 S (threaded) nfsd 100140 S rpcsvc 0xc7476150 nfsd: service 100139 S rpcsvc 0xc7476190 nfsd: service 100138 S rpcsvc 0xc74761d0 nfsd: service 100077 S rpcsvc 0xc7657450 nfsd: master 1015 1 1015 0 Ss select 0xc73b7124 nfsd 1006 1 1006 0 Ss select 0xc7656ea4 mountd 913 1 913 0 Ss select 0xc76562e4 rpcbind 879 1 879 0 Ss select 0xc731dd64 syslogd 697 1 697 0 Ss select 0xc73714e4 devd 20 0 0 0 DL flowclea 0xc0f6c0c8 [flowcleaner] 19 0 0 0 DL sdflush 0xc0f77820 [softdepflush] 18 0 0 0 DL vlruwt 0xc73987f8 [vnlru] 17 0 0 0 DL syncer 0xc0f6bed4 [syncer] 16 0 0 0 DL psleep 0xc0f6bc20 [bufdaemon] 15 0 0 0 DL pgzero 0xc0f78614 [pagezero] 9 0 0 0 DL psleep 0xc0f78244 [vmdaemon] 8 0 0 0 DL psleep 0xc0f7820c [pagedaemon] 7 0 0 0 DL ccb_scan 0xc0dcbc54 [xpt_thrd] 6 0 0 0 DL - 0xc6fac83c [fdc0] 5 0 0 0 SL - 0xc6ff7000 [fw0_probe] 14 0 0 0 DL (threaded) [usb] 100057 D - 0xc6fd0d0c [usbus5] 100056 D - 0xc6fd0cdc [usbus5] 100055 D - 0xc6fd0cac [usbus5] 100054 D - 0xc6fd0c7c [usbus5] 100052 D - 0xc6fc6b5c [usbus4] 100051 D - 0xc6fc6b2c [usbus4] 100050 D - 0xc6fc6afc [usbus4] 100049 D - 0xc6fc6acc [usbus4] 100048 D - 0xc6fc2b5c [usbus3] 100047 D - 0xc6fc2b2c [usbus3] 100046 D - 0xc6fc2afc [usbus3] 100045 D - 0xc6fc2acc [usbus3] 100044 D - 0xc6fb8b5c [usbus2] 100043 D - 0xc6fb8b2c [usbus2] 100042 D - 0xc6fb8afc [usbus2] 100041 D - 0xc6fb8acc [usbus2] 100039 D - 0xc6fb2b5c [usbus1] 100038 D - 0xc6fb2b2c [usbus1] 100037 D - 0xc6fb2afc [usbus1] 100036 D - 0xc6fb2acc [usbus1] 100034 D - 0xc6fadb5c [usbus0] 100033 D - 0xc6fadb2c [usbus0] 100032 D - 0xc6fadafc [usbus0] 100031 D - 0xc6fadacc [usbus0] 13 0 0 0 DL - 0xc0dff844 [yarrow] 4 0 0 0 DL - 0xc0dfd5e4 [g_down] 3 0 0 0 DL - 0xc0dfd5e0 [g_up] 2 0 0 0 DL - 0xc0dfd5d8 [g_event] 12 0 0 0 WL (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: hdac1 ohci0] 100029 I [irq22: atapci0] 100028 I [irq256: hdac0] 100027 I [irq9: acpi0] 100026 I [swi5: +] 100024 I [swi2: cambio] 100020 I [swi6: task queue] 100019 I [swi6: Giant taskq] 100012 I [swi3: vm] 100011 I [swi4: clock] 100010 I [swi4: clock] 100009 I [swi4: clock] 100008 I [swi4: clock] 100007 I [swi1: netisr 0] 11 0 0 0 RL (threaded) [idle] 100006 CanRun [idle: cpu0] 100005 Run CPU 1 [idle: cpu1] 100004 Run CPU 2 [idle: cpu2] 100003 Run CPU 3 [idle: cpu3] 1 0 1 0 SLs wait 0xc6d79d48 [init] 10 0 0 0 DL audit_wo 0xc0f77140 [audit] 0 0 0 0 DLs (threaded) [kernel] 100066 D deadlkre 0xc0dff844 [deadlkres] 100060 D - 0xc6ff6800 [fw0_taskq] 100025 D - 0xc6f3f100 [kqueue taskq] 100023 D - 0xc6f3f240 [acpi_task_2] 100022 D - 0xc6f3f240 [acpi_task_1] 100021 D - 0xc6f3f240 [acpi_task_0] 100018 D - 0xc6f3f540 [thread taskq] 100016 D - 0xc6d60e40 [firmware taskq] 100000 D sched 0xc0dfd6c0 [swapper] 1420 1418 1393 0 Z+ creat db:0:ps> allt Tracing command rw pid 1435 tid 100105 td 0xc74f8000 sched_switch(c74f8000,0,104,191,2761c40a,...) at sched_switch+0x36a mi_switch(104,0,c0ca6009,1eb,5c,...) at mi_switch+0x200 sleepq_switch(c74f8000,0,c0ca6009,1a0,5c,...) at sleepq_switch+0x15f sleepq_catch_signals(3e9,c08cf130,c74f8000,1,100,...) at sleepq_catch_signals+0xb7 sleepq_timedwait_sig(c0dff9e4,5c,c0ca2c9f,100,0,...) at sleepq_timedwait_sig+0x1a _sleep(c0dff9e4,0,15c,c0ca2c9f,3e9,...) at _sleep+0x31e kern_nanosleep(c74f8000,f61d3c64,f61d3c6c,1,0,...) at kern_nanosleep+0xc1 nanosleep(c74f8000,f61d3cf8,c,c74f8000,c74f32a8,...) at nanosleep+0x6f syscall(f61d3d38) at syscall+0x230 Xint0x80_syscall() at Xint0x80_syscall+0x20 --- syscall (240, FreeBSD ELF32, nanosleep), eip = 0x281720f7, esp = 0xbfbfe66c, ebp = 0xbfbfe698 --- Tracing command rw pid 1434 tid 100106 td 0xc74f7d80 sched_switch(c74f7d80,0,104,191,275322e2,...) at sched_switch+0x36a mi_switch(104,0,c0ca6009,1eb,5c,...) at mi_switch+0x200 sleepq_switch(c74f7d80,0,c0ca6009,1a0,5c,...) at sleepq_switch+0x15f sleepq_catch_signals(3e9,c08cf130,c74f7d80,1,100,...) at sleepq_catch_signals+0xb7 sleepq_timedwait_sig(c0dff9e4,5c,c0ca2c9f,100,0,...) at sleepq_timedwait_sig+0x1a _sleep(c0dff9e4,0,15c,c0ca2c9f,3e9,...) at _sleep+0x31e kern_nanosleep(c74f7d80,f61d7c64,f61d7c6c,1,0,...) at kern_nanosleep+0xc1 nanosleep(c74f7d80,f61d7cf8,c,c74f7d80,c74f3000,...) at nanosleep+0x6f syscall(f61d7d38) at syscall+0x230 Xint0x80_syscall() at Xint0x80_syscall+0x20 --- syscall (240, FreeBSD ELF32, nanosleep), eip = 0x281720f7, esp = 0xbfbfe66c, ebp = 0xbfbfe698 --- Tracing command rw pid 1433 tid 100132 td 0xc77d3b40 sched_switch(c77d3b40,0,104,191,2756ddfe,...) at sched_switch+0x36a mi_switch(104,0,c0ca6009,1eb,5c,...) at mi_switch+0x200 sleepq_switch(c77d3b40,0,c0ca6009,1a0,5c,...) at sleepq_switch+0x15f sleepq_catch_signals(3e9,c08cf130,c77d3b40,1,100,...) at sleepq_catch_signals+0xb7 sleepq_timedwait_sig(c0dff9e4,5c,c0ca2c9f,100,0,...) at sleepq_timedwait_sig+0x1a _sleep(c0dff9e4,0,15c,c0ca2c9f,3e9,...) at _sleep+0x31e kern_nanosleep(c77d3b40,f6281c64,f6281c6c,1,0,...) at kern_nanosleep+0xc1 nanosleep(c77d3b40,f6281cf8,c,c77d3b40,c77a0550,...) at nanosleep+0x6f syscall(f6281d38) at syscall+0x230 Xint0x80_syscall() at Xint0x80_syscall+0x20 --- syscall (240, FreeBSD ELF32, nanosleep), eip = 0x281720f7, esp = 0xbfbfe66c, ebp = 0xbfbfe698 --- Tracing command rw pid 1432 tid 100094 td 0xc741cb40 sched_switch(c741cb40,0,104,191,276662f9,...) at sched_switch+0x36a mi_switch(104,0,c0ca6009,1eb,5c,...) at mi_switch+0x200 sleepq_switch(c741cb40,0,c0ca6009,1a0,5c,...) at sleepq_switch+0x15f sleepq_catch_signals(3e9,c08cf130,c741cb40,2,100,...) at sleepq_catch_signals+0xb7 sleepq_timedwait_sig(c0dff9e4,5c,c0ca2c9f,100,0,...) at sleepq_timedwait_sig+0x1a _sleep(c0dff9e4,0,15c,c0ca2c9f,3e9,...) at _sleep+0x31e kern_nanosleep(c741cb40,f61a3c64,f61a3c6c,1,0,...) at kern_nanosleep+0xc1 nanosleep(c741cb40,f61a3cf8,c,c741cb40,c7425550,...) at nanosleep+0x6f syscall(f61a3d38) at syscall+0x230 Xint0x80_syscall() at Xint0x80_syscall+0x20 --- syscall (240, FreeBSD ELF32, nanosleep), eip = 0x281720f7, esp = 0xbfbfe66c, ebp = 0xbfbfe698 --- Tracing command mkdir pid 1431 tid 100107 td 0xc74786c0 sched_switch(c74786c0,0,104,191,275fc047,...) at sched_switch+0x36a mi_switch(104,0,c0ca6009,1eb,5c,...) at mi_switch+0x200 sleepq_switch(c74786c0,0,c0ca6009,1a0,5c,...) at sleepq_switch+0x15f sleepq_catch_signals(3e9,c08cf130,c74786c0,2,100,...) at sleepq_catch_signals+0xb7 sleepq_timedwait_sig(c0dff9e4,5c,c0ca2c9f,100,0,...) at sleepq_timedwait_sig+0x1a _sleep(c0dff9e4,0,15c,c0ca2c9f,3e9,...) at _sleep+0x31e kern_nanosleep(c74786c0,f6225c64,f6225c6c,1,0,...) at kern_nanosleep+0xc1 nanosleep(c74786c0,f6225cf8,c,c74786c0,c746e000,...) at nanosleep+0x6f syscall(f6225d38) at syscall+0x230 Xint0x80_syscall() at Xint0x80_syscall+0x20 --- syscall (240, FreeBSD ELF32, nanosleep), eip = 0x281720f7, esp = 0xbfbfe63c, ebp = 0xbfbfe668 --- Tracing command rw pid 1430 tid 100113 td 0xc74f7b40 sched_switch(c74f7b40,0,104,191,275976fc,...) at sched_switch+0x36a mi_switch(104,0,c0ca6009,1eb,5c,...) at mi_switch+0x200 sleepq_switch(c74f7b40,0,c0ca6009,1a0,5c,...) at sleepq_switch+0x15f sleepq_catch_signals(3e9,c08cf130,c74f7b40,1,100,...) at sleepq_catch_signals+0xb7 sleepq_timedwait_sig(c0dff9e4,5c,c0ca2c9f,100,0,...) at sleepq_timedwait_sig+0x1a _sleep(c0dff9e4,0,15c,c0ca2c9f,3e9,...) at _sleep+0x31e kern_nanosleep(c74f7b40,f623dc64,f623dc6c,1,0,...) at kern_nanosleep+0xc1 nanosleep(c74f7b40,f623dcf8,c,c74f7b40,c74f2d48,...) at nanosleep+0x6f syscall(f623dd38) at syscall+0x230 Xint0x80_syscall() at Xint0x80_syscall+0x20 --- syscall (240, FreeBSD ELF32, nanosleep), eip = 0x281720f7, esp = 0xbfbfe66c, ebp = 0xbfbfe698 --- Tracing command mkdir pid 1429 tid 100099 td 0xc7452480 sched_switch(c7452480,0,104,191,27695476,...) at sched_switch+0x36a mi_switch(104,0,c0ca6009,1eb,5c,...) at mi_switch+0x200 sleepq_switch(c7452480,0,c0ca6009,1a0,5c,...) at sleepq_switch+0x15f sleepq_catch_signals(3e9,c08cf130,c7452480,2,100,...) at sleepq_catch_signals+0xb7 sleepq_timedwait_sig(c0dff9e4,5c,c0ca2c9f,100,0,...) at sleepq_timedwait_sig+0x1a _sleep(c0dff9e4,0,15c,c0ca2c9f,3e9,...) at _sleep+0x31e kern_nanosleep(c7452480,f61b8c64,f61b8c6c,1,0,...) at kern_nanosleep+0xc1 nanosleep(c7452480,f61b8cf8,c,c7452480,c74502a8,...) at nanosleep+0x6f syscall(f61b8d38) at syscall+0x230 Xint0x80_syscall() at Xint0x80_syscall+0x20 --- syscall (240, FreeBSD ELF32, nanosleep), eip = 0x281720f7, esp = 0xbfbfe63c, ebp = 0xbfbfe668 --- Tracing command rw pid 1428 tid 100101 td 0xc7452000 sched_switch(c7452000,0,104,191,27649fd4,...) at sched_switch+0x36a mi_switch(104,0,c0ca6009,1eb,5c,...) at mi_switch+0x200 sleepq_switch(c7452000,0,c0ca6009,1a0,5c,...) at sleepq_switch+0x15f sleepq_catch_signals(3e9,c08cf130,c7452000,1,100,...) at sleepq_catch_signals+0xb7 sleepq_timedwait_sig(c0dff9e4,5c,c0ca2c9f,100,0,...) at sleepq_timedwait_sig+0x1a _sleep(c0dff9e4,0,15c,c0ca2c9f,3e9,...) at _sleep+0x31e kern_nanosleep(c7452000,f61c0c64,f61c0c6c,1,0,...) at kern_nanosleep+0xc1 nanosleep(c7452000,f61c0cf8,c,c7452000,c7426d48,...) at nanosleep+0x6f syscall(f61c0d38) at syscall+0x230 Xint0x80_syscall() at Xint0x80_syscall+0x20 --- syscall (240, FreeBSD ELF32, nanosleep), eip = 0x281720f7, esp = 0xbfbfe66c, ebp = 0xbfbfe698 --- Tracing command mkdir pid 1427 tid 100089 td 0xc7478900 sched_switch(c7478900,0,104,191,28925064,...) at sched_switch+0x36a mi_switch(104,0,c0ca6009,1eb,5c,...) at mi_switch+0x200 sleepq_switch(c7478900,0,c0ca6009,1a0,5c,...) at sleepq_switch+0x15f sleepq_catch_signals(7d1,c08cf130,c7478900,0,100,...) at sleepq_catch_signals+0xb7 sleepq_timedwait_sig(c0dff9e4,5c,c0ca2c9f,100,0,...) at sleepq_timedwait_sig+0x1a _sleep(c0dff9e4,0,15c,c0ca2c9f,7d1,...) at _sleep+0x31e kern_nanosleep(c7478900,f618fc64,f618fc6c,2,0,...) at kern_nanosleep+0xc1 nanosleep(c7478900,f618fcf8,c,c7478900,c746e2a8,...) at nanosleep+0x6f syscall(f618fd38) at syscall+0x230 Xint0x80_syscall() at Xint0x80_syscall+0x20 --- syscall (240, FreeBSD ELF32, nanosleep), eip = 0x281720f7, esp = 0xbfbfe75c, ebp = 0xbfbfe788 --- Tracing command rw pid 1426 tid 100157 td 0xc74f86c0 sched_switch(c74f86c0,0,104,191,276317d4,...) at sched_switch+0x36a mi_switch(104,0,c0ca6009,1eb,5c,...) at mi_switch+0x200 sleepq_switch(c74f86c0,0,c0ca6009,1a0,5c,...) at sleepq_switch+0x15f sleepq_catch_signals(3e9,c08cf130,c74f86c0,2,100,...) at sleepq_catch_signals+0xb7 sleepq_timedwait_sig(c0dff9e4,5c,c0ca2c9f,100,0,...) at sleepq_timedwait_sig+0x1a _sleep(c0dff9e4,0,15c,c0ca2c9f,3e9,...) at _sleep+0x31e kern_nanosleep(c74f86c0,f62d0c64,f62d0c6c,1,0,...) at kern_nanosleep+0xc1 nanosleep(c74f86c0,f62d0cf8,c,c74f86c0,c7abbd48,...) at nanosleep+0x6f syscall(f62d0d38) at syscall+0x230 Xint0x80_syscall() at Xint0x80_syscall+0x20 --- syscall (240, FreeBSD ELF32, nanosleep), eip = 0x281720f7, esp = 0xbfbfe66c, ebp = 0xbfbfe698 --- Tracing command rw pid 1425 tid 100171 td 0xc7ad5480 sched_switch(c7ad5480,0,104,191,2767ecd4,...) at sched_switch+0x36a mi_switch(104,0,c0ca6009,1eb,5c,...) at mi_switch+0x200 sleepq_switch(c7ad5480,0,c0ca6009,1a0,5c,...) at sleepq_switch+0x15f sleepq_catch_signals(3e9,c08cf130,c7ad5480,1,100,...) at sleepq_catch_signals+0xb7 sleepq_timedwait_sig(c0dff9e4,5c,c0ca2c9f,100,0,...) at sleepq_timedwait_sig+0x1a _sleep(c0dff9e4,0,15c,c0ca2c9f,3e9,...) at _sleep+0x31e kern_nanosleep(c7ad5480,f62fac64,f62fac6c,1,0,...) at kern_nanosleep+0xc1 nanosleep(c7ad5480,f62facf8,c,c7ad5480,c79177f8,...) at nanosleep+0x6f syscall(f62fad38) at syscall+0x230 Xint0x80_syscall() at Xint0x80_syscall+0x20 --- syscall (240, FreeBSD ELF32, nanosleep), eip = 0x281720f7, esp = 0xbfbfe66c, ebp = 0xbfbfe698 --- Tracing command mkdir pid 1424 tid 100142 td 0xc741e900 sched_switch(c741e900,0,104,191,273cc140,...) at sched_switch+0x36a mi_switch(104,0,c0ca6009,1eb,5c,...) at mi_switch+0x200 sleepq_switch(c741e900,0,c0ca6009,1a0,5c,...) at sleepq_switch+0x15f sleepq_catch_signals(c0ca6009,160,0,100,100,...) at sleepq_catch_signals+0xb7 sleepq_wait_sig(c79172a8,5c,c0ca8802,100,0,...) at sleepq_wait_sig+0x17 _sleep(c79172a8,c7917330,15c,c0ca8802,0,...) at _sleep+0x354 kern_wait(c741e900,593,f62a3c74,0,0,...) at kern_wait+0xb76 wait4(c741e900,f62a3cf8,c,c741e900,c79172a8,...) at wait4+0x3b syscall(f62a3d38) at syscall+0x230 Xint0x80_syscall() at Xint0x80_syscall+0x20 --- syscall (7, FreeBSD ELF32, wait4), eip = 0x2810232b, esp = 0xbfbfe78c, ebp = 0xbfbfe7a8 --- Tracing command rw pid 1423 tid 100161 td 0xc7ad6b40 kdb_enter(c0ca19f2,c0ca19f2,c0c9e84a,f62dca14,0,...) at kdb_enter+0x3a panic(c0c9e84a,c0c22ec5,c0c967ea,1aa,f62dca50,...) at panic+0x136 _lockmgr_assert(c78af6b4,4,c0c967ea,1aa,0,...) at _lockmgr_assert+0x165 freeclusterchain(c78af600,4,c7ad6b40,0,0,...) at freeclusterchain+0xe1 detrunc(c7472180,0,0,0,c7ad6b40,...) at detrunc+0x2f2 msdosfs_inactive(f62dcb04,c0cdf7ae,c7462634,c7462634,c7462570,...) at msdosfs_inactive+0x99 VOP_INACTIVE_APV(c0d8a820,f62dcb04,c0caef20,8f5,c0dca820,...) at VOP_INACTIVE_APV+0xc5 vinactive(c0d8a820,f62dcb38,c0caef20,854,0,...) at vinactive+0xb1 vputx(f62dcc50,c092bb0a,c7462570,ffffffdf,c7462570,...) at vputx+0x307 vput(c7462570,ffffffdf,c7462570,f62dcc08,4,...) at vput+0x10 kern_unlinkat(c7ad6b40,ffffff9c,bfbfe724,0,0,...) at kern_unlinkat+0x1ea kern_unlink(c7ad6b40,bfbfe724,0,f62dcd2c,c0bc8aa0,...) at kern_unlink+0x2f unlink(c7ad6b40,f62dccf8,c0cdc9ff,c0cc3c45,c7abb2a8,...) at unlink+0x22 syscall(f62dcd38) at syscall+0x230 Xint0x80_syscall() at Xint0x80_syscall+0x20 --- syscall (10, FreeBSD ELF32, unlink), eip = 0x2817c14f, esp = 0xbfbfd6fc, ebp = 0xbfbfe7a8 --- Tracing command rw pid 1422 tid 100144 td 0xc741e480 sched_switch(c741e480,0,104,191,27548e8b,...) at sched_switch+0x36a mi_switch(104,0,c0ca6009,1eb,5c,...) at mi_switch+0x200 sleepq_switch(c741e480,0,c0ca6009,1a0,5c,...) at sleepq_switch+0x15f sleepq_catch_signals(c0ca6009,160,0,100,100,...) at sleepq_catch_signals+0xb7 sleepq_wait_sig(c7916d48,5c,c0ca8802,100,0,...) at sleepq_wait_sig+0x17 _sleep(c7916d48,c7916dd0,15c,c0ca8802,0,...) at _sleep+0x354 kern_wait(c741e480,58f,f62a9c74,0,0,...) at kern_wait+0xb76 wait4(c741e480,f62a9cf8,c,c741e480,c7916d48,...) at wait4+0x3b syscall(f62a9d38) at syscall+0x230 Xint0x80_syscall() at Xint0x80_syscall+0x20 --- syscall (7, FreeBSD ELF32, wait4), eip = 0x2810232b, esp = 0xbfbfe7ac, ebp = 0xbfbfe7c8 --- Tracing command mkdir pid 1421 tid 100091 td 0xc741d000 sched_switch(c741d000,0,104,191,2717f196,...) at sched_switch+0x36a mi_switch(104,0,c0ca6009,1eb,5c,...) at mi_switch+0x200 sleepq_switch(c741d000,0,c0ca6009,1a0,5c,...) at sleepq_switch+0x15f sleepq_catch_signals(3e9,c08cf130,c741d000,0,100,...) at sleepq_catch_signals+0xb7 sleepq_timedwait_sig(c0dff9e4,5c,c0ca2c9f,100,0,...) at sleepq_timedwait_sig+0x1a _sleep(c0dff9e4,0,15c,c0ca2c9f,3e9,...) at _sleep+0x31e kern_nanosleep(c741d000,f6197c64,f6197c6c,1,0,...) at kern_nanosleep+0xc1 nanosleep(c741d000,f6197cf8,c,c741d000,c7425aa0,...) at nanosleep+0x6f syscall(f6197d38) at syscall+0x230 Xint0x80_syscall() at Xint0x80_syscall+0x20 --- syscall (240, FreeBSD ELF32, nanosleep), eip = 0x281720f7, esp = 0xbfbfe7ac, ebp = 0xbfbfe7d8 --- Tracing command rw pid 1419 tid 100170 td 0xc7ad56c0 sched_switch(c7ad56c0,0,104,191,26ffa194,...) at sched_switch+0x36a mi_switch(104,0,c0ca6009,1eb,5c,...) at mi_switch+0x200 sleepq_switch(c7ad56c0,0,c0ca6009,1a0,5c,...) at sleepq_switch+0x15f sleepq_catch_signals(3e9,c08cf130,c7ad56c0,1,100,...) at sleepq_catch_signals+0xb7 sleepq_timedwait_sig(c0dff9e4,5c,c0ca2c9f,100,0,...) at sleepq_timedwait_sig+0x1a _sleep(c0dff9e4,0,15c,c0ca2c9f,3e9,...) at _sleep+0x31e kern_nanosleep(c7ad56c0,f62f7c64,f62f7c6c,1,0,...) at kern_nanosleep+0xc1 nanosleep(c7ad56c0,f62f7cf8,c,c7ad56c0,c7917aa0,...) at nanosleep+0x6f syscall(f62f7d38) at syscall+0x230 Xint0x80_syscall() at Xint0x80_syscall+0x20 --- syscall (240, FreeBSD ELF32, nanosleep), eip = 0x281720f7, esp = 0xbfbfe7cc, ebp = 0xbfbfe7f8 --- Tracing command run pid 1418 tid 100121 td 0xc74f7480 sched_switch(c74f7480,0,104,191,27f080b1,...) at sched_switch+0x36a mi_switch(104,0,c0ca6009,1eb,5c,...) at mi_switch+0x200 sleepq_switch(c74f7480,0,c0ca6009,1a0,5c,...) at sleepq_switch+0x15f sleepq_catch_signals(c0ca6009,160,0,100,100,...) at sleepq_catch_signals+0xb7 sleepq_wait_sig(c74f2550,5c,c0ca8802,100,0,...) at sleepq_wait_sig+0x17 _sleep(c74f2550,c74f25d8,15c,c0ca8802,0,...) at _sleep+0x354 kern_wait(c74f7480,58b,f6260c74,0,0,...) at kern_wait+0xb76 wait4(c74f7480,f6260cf8,c,c74f7480,c74f2550,...) at wait4+0x3b syscall(f6260d38) at syscall+0x230 Xint0x80_syscall() at Xint0x80_syscall+0x20 --- syscall (7, FreeBSD ELF32, wait4), eip = 0x2810232b, esp = 0xbfbfe29c, ebp = 0xbfbfe2b8 --- Tracing command run pid 1417 tid 100148 td 0xc791b900 sched_switch(c791b900,0,104,191,1ddb7213,...) at sched_switch+0x36a mi_switch(104,0,c0ca6009,1eb,5c,...) at mi_switch+0x200 sleepq_switch(c791b900,0,c0ca6009,1a0,5c,...) at sleepq_switch+0x15f sleepq_catch_signals(c0ca6009,160,0,100,100,...) at sleepq_catch_signals+0xb7 sleepq_wait_sig(c79162a8,5c,c0ca8802,100,0,...) at sleepq_wait_sig+0x17 _sleep(c79162a8,c7916330,15c,c0ca8802,0,...) at _sleep+0x354 kern_wait(c791b900,58a,f62b5c74,0,0,...) at kern_wait+0xb76 wait4(c791b900,f62b5cf8,c,c791b900,c79162a8,...) at wait4+0x3b syscall(f62b5d38) at syscall+0x230 Xint0x80_syscall() at Xint0x80_syscall+0x20 --- syscall (7, FreeBSD ELF32, wait4), eip = 0x2810232b, esp = 0xbfbfe74c, ebp = 0xbfbfe768 --- Tracing command run pid 1416 tid 100098 td 0xc74526c0 sched_switch(c74526c0,0,104,191,1dd1334c,...) at sched_switch+0x36a mi_switch(104,0,c0ca6009,1eb,5c,...) at mi_switch+0x200 sleepq_switch(c74526c0,0,c0ca6009,1a0,5c,...) at sleepq_switch+0x15f sleepq_catch_signals(3e9,c08cf130,c74526c0,1,100,...) at sleepq_catch_signals+0xb7 sleepq_timedwait_sig(c0dff9e4,5c,c0ca2c9f,100,0,...) at sleepq_timedwait_sig+0x1a _sleep(c0dff9e4,0,15c,c0ca2c9f,3e9,...) at _sleep+0x31e kern_nanosleep(c74526c0,f61b4c64,f61b4c6c,1,0,...) at kern_nanosleep+0xc1 nanosleep(c74526c0,f61b4cf8,c,c74526c0,c7450550,...) at nanosleep+0x6f syscall(f61b4d38) at syscall+0x230 Xint0x80_syscall() at Xint0x80_syscall+0x20 --- syscall (240, FreeBSD ELF32, nanosleep), eip = 0x281720f7, esp = 0xbfbfe76c, ebp = 0xbfbfe798 --- Tracing command sh pid 1412 tid 100145 td 0xc741e240 sched_switch(c741e240,0,104,191,155dd278,...) at sched_switch+0x36a mi_switch(104,0,c0ca6009,1eb,5c,...) at mi_switch+0x200 sleepq_switch(c741e240,0,c0ca6009,1a0,5c,...) at sleepq_switch+0x15f sleepq_catch_signals(c0ca6009,160,0,100,100,...) at sleepq_catch_signals+0xb7 sleepq_wait_sig(c7916aa0,5c,c0ca8802,100,0,...) at sleepq_wait_sig+0x17 _sleep(c7916aa0,c7916b28,15c,c0ca8802,0,...) at _sleep+0x354 kern_wait(c741e240,ffffffff,f62acc74,2,0,...) at kern_wait+0xb76 wait4(c741e240,f62accf8,c0cdc9ff,c0ca87e1,c7916aa0,...) at wait4+0x3b syscall(f62acd38) at syscall+0x230 Xint0x80_syscall() at Xint0x80_syscall+0x20 --- syscall (7, FreeBSD ELF32, wait4), eip = 0x2815f32b, esp = 0xbfbfe5ec, ebp = 0xbfbfe608 --- Tracing command md5 pid 1406 tid 100146 td 0xc791bd80 sched_switch(c791bd80,0,104,191,41556c97,...) at sched_switch+0x36a mi_switch(104,0,c0ca6009,1eb,4c,...) at mi_switch+0x200 sleepq_switch(c791bd80,0,c0ca6009,260,0,...) at sleepq_switch+0x15f sleepq_wait(c73d1800,4c,c0c74979,0,0,...) at sleepq_wait+0x63 _sleep(c73d1800,c73d1820,24c,c0c74979,0,...) at _sleep+0x36b md_kthread(c73d1800,f62afd38,c0c9cda4,343,c79167f8,...) at md_kthread+0x125 fork_exit(c06b7e50,c73d1800,f62afd38) at fork_exit+0xb8 fork_trampoline() at fork_trampoline+0x8 --- trap 0, eip = 0, esp = 0xf62afd70, ebp = 0 --- Tracing command sh pid 1393 tid 100124 td 0xc74f7000 sched_switch(c74f7000,0,104,191,bf18cc4,...) at sched_switch+0x36a mi_switch(104,0,c0ca6009,1eb,5c,...) at mi_switch+0x200 sleepq_switch(c74f7000,0,c0ca6009,1a0,5c,...) at sleepq_switch+0x15f sleepq_catch_signals(c0ca6009,160,0,100,100,...) at sleepq_catch_signals+0xb7 sleepq_wait_sig(c74f2000,5c,c0ca8802,100,0,...) at sleepq_wait_sig+0x17 _sleep(c74f2000,c74f2088,15c,c0ca8802,0,...) at _sleep+0x354 kern_wait(c74f7000,ffffffff,f6269c74,2,0,...) at kern_wait+0xb76 wait4(c74f7000,f6269cf8,c0cdc9ff,c0ca87e1,c74f2000,...) at wait4+0x3b syscall(f6269d38) at syscall+0x230 Xint0x80_syscall() at Xint0x80_syscall+0x20 --- syscall (7, FreeBSD ELF32, wait4), eip = 0x2815f32b, esp = 0xbfbfe98c, ebp = 0xbfbfe9a8 --- Tracing command bash pid 1388 tid 100127 td 0xc77d46c0 sched_switch(c77d46c0,0,104,191,12eb8289,...) at sched_switch+0x36a mi_switch(104,0,c0ca6009,1eb,5c,...) at mi_switch+0x200 sleepq_switch(c77d46c0,0,c0ca6009,1a0,5c,...) at sleepq_switch+0x15f sleepq_catch_signals(c0ca6009,160,0,100,100,...) at sleepq_catch_signals+0xb7 sleepq_wait_sig(c77a12a8,5c,c0ca8802,100,0,...) at sleepq_wait_sig+0x17 _sleep(c77a12a8,c77a1330,15c,c0ca8802,0,...) at _sleep+0x354 kern_wait(c77d46c0,ffffffff,f6272c74,6,0,...) at kern_wait+0xb76 wait4(c77d46c0,f6272cf8,c0cdc9ff,c0ca86f1,c77a12a8,...) at wait4+0x3b syscall(f6272d38) at syscall+0x230 Xint0x80_syscall() at Xint0x80_syscall+0x20 --- syscall (7, FreeBSD ELF32, wait4), eip = 0x282bf32b, esp = 0xbfbfe7bc, ebp = 0xbfbfe7d8 --- Tracing command csh pid 1384 tid 100112 td 0xc746fb40 sched_switch(c746fb40,0,104,191,9caca342,...) at sched_switch+0x36a mi_switch(104,0,c0ca6009,1eb,68,...) at mi_switch+0x200 sleepq_switch(c746fb40,0,c0ca6009,1a0,68,...) at sleepq_switch+0x15f sleepq_catch_signals(c0ca6009,160,0,100,100,...) at sleepq_catch_signals+0xb7 sleepq_wait_sig(c746a300,68,c0c54e4e,100,0,...) at sleepq_wait_sig+0x17 _sleep(c746a300,c746a330,168,c0c54e4e,0,...) at _sleep+0x354 kern_sigsuspend(c746fb40,0,0,0,0,...) at kern_sigsuspend+0xae sigsuspend(c746fb40,f6239cf8,c0cdc9ff,c0ca86f1,c746a2a8,...) at sigsuspend+0x4d syscall(f6239d38) at syscall+0x230 Xint0x80_syscall() at Xint0x80_syscall+0x20 --- syscall (4, FreeBSD ELF32, write), eip = 0x2817b25b, esp = 0xbfbfe5dc, ebp = 0xbfbfe648 --- Tracing command su pid 1383 tid 100088 td 0xc7478b40 sched_switch(c7478b40,0,104,191,39feee94,...) at sched_switch+0x36a mi_switch(104,0,c0ca6009,1eb,5c,...) at mi_switch+0x200 sleepq_switch(c7478b40,0,c0ca6009,1a0,5c,...) at sleepq_switch+0x15f sleepq_catch_signals(c0ca6009,160,0,100,100,...) at sleepq_catch_signals+0xb7 sleepq_wait_sig(c746e550,5c,c0ca8802,100,0,...) at sleepq_wait_sig+0x17 _sleep(c746e550,c746e5d8,15c,c0ca8802,0,...) at _sleep+0x354 kern_wait(c7478b40,568,f618bc74,2,0,...) at kern_wait+0xb76 wait4(c7478b40,f618bcf8,c,c7478b40,c746e550,...) at wait4+0x3b syscall(f618bd38) at syscall+0x230 Xint0x80_syscall() at Xint0x80_syscall+0x20 --- syscall (7, FreeBSD ELF32, wait4), eip = 0x2811f32b, esp = 0xbfbfe5fc, ebp = 0xbfbfe618 --- Tracing command getty pid 1382 tid 100095 td 0xc7452900 sched_switch(c7452900,0,104,191,466e07d5,...) at sched_switch+0x36a mi_switch(104,0,c0ca6009,1eb,0,...) at mi_switch+0x200 sleepq_switch(c7452900,0,c0ca6009,1a0,0,...) at sleepq_switch+0x15f sleepq_catch_signals(c0ca6009,160,0,c7452900,c7452900,...) at sleepq_catch_signals+0xb7 sleepq_wait_sig(c6facc70,0,c0caa5cd,101,0,...) at sleepq_wait_sig+0x17 _cv_wait_sig(c6facc70,c0dff190,c0ca9f9c,511,0,...) at _cv_wait_sig+0x240 tty_wait(c6facc00,c6facc70,f61a7c58,1,0,...) at tty_wait+0x71 ttydisc_read(c6facc00,f61a7c58,0,9f,0,...) at ttydisc_read+0x22c ttydev_read(c6fe4700,f61a7c58,0,0,1,...) at ttydev_read+0xaa devfs_read_f(c7400968,f61a7c58,c6d7f380,0,c7452900,...) at devfs_read_f+0x7e dofileread(f61a7c58,ffffffff,ffffffff,0,c7400968,...) at dofileread+0x96 kern_readv(c7452900,0,f61a7c58,f61a7c78,1,...) at kern_readv+0x58 read(c7452900,f61a7cf8,c0cdc9ff,c0cb9dd2,c74507f8,...) at read+0x4f syscall(f61a7d38) at syscall+0x230 Xint0x80_syscall() at Xint0x80_syscall+0x20 --- syscall (3, FreeBSD ELF32, read), eip = 0x2818e7e3, esp = 0xbfbfedbc, ebp = 0xbfbfede8 --- Tracing command getty pid 1381 tid 100078 td 0xc741e000 sched_switch(c741e000,0,104,191,4697b8b6,...) at sched_switch+0x36a mi_switch(104,0,c0ca6009,1eb,0,...) at mi_switch+0x200 sleepq_switch(c741e000,0,c0ca6009,1a0,0,...) at sleepq_switch+0x15f sleepq_catch_signals(c0ca6009,160,0,c741e000,c741e000,...) at sleepq_catch_signals+0xb7 sleepq_wait_sig(c70eb270,0,c0caa5cd,101,0,...) at sleepq_wait_sig+0x17 _cv_wait_sig(c70eb270,c0dff190,c0ca9f9c,511,0,...) at _cv_wait_sig+0x240 tty_wait(c70eb200,c70eb270,f6162c58,1,0,...) at tty_wait+0x71 ttydisc_read(c70eb200,f6162c58,0,9f,0,...) at ttydisc_read+0x22c ttydev_read(c6fe4800,f6162c58,0,0,1,...) at ttydev_read+0xaa devfs_read_f(c7400818,f6162c58,c6d7f380,0,c741e000,...) at devfs_read_f+0x7e dofileread(f6162c58,ffffffff,ffffffff,0,c7400818,...) at dofileread+0x96 kern_readv(c741e000,0,f6162c58,f6162c78,1,...) at kern_readv+0x58 read(c741e000,f6162cf8,c0cdc9ff,c0cb9dd2,c6f41aa0,...) at read+0x4f syscall(f6162d38) at syscall+0x230 Xint0x80_syscall() at Xint0x80_syscall+0x20 --- syscall (3, FreeBSD ELF32, read), eip = 0x2818e7e3, esp = 0xbfbfedbc, ebp = 0xbfbfede8 --- Tracing command getty pid 1380 tid 100111 td 0xc746fd80 sched_switch(c746fd80,0,104,191,4669fd09,...) at sched_switch+0x36a mi_switch(104,0,c0ca6009,1eb,0,...) at mi_switch+0x200 sleepq_switch(c746fd80,0,c0ca6009,1a0,0,...) at sleepq_switch+0x15f sleepq_catch_signals(c0ca6009,160,0,c746fd80,c746fd80,...) at sleepq_catch_signals+0xb7 sleepq_wait_sig(c70ea670,0,c0caa5cd,101,0,...) at sleepq_wait_sig+0x17 _cv_wait_sig(c70ea670,c0dff190,c0ca9f9c,511,0,...) at _cv_wait_sig+0x240 tty_wait(c70ea600,c70ea670,f6235c58,1,0,...) at tty_wait+0x71 ttydisc_read(c70ea600,f6235c58,0,9f,0,...) at ttydisc_read+0x22c ttydev_read(c6fe4900,f6235c58,0,0,1,...) at ttydev_read+0xaa devfs_read_f(c749fdc8,f6235c58,c6d7f380,0,c746fd80,...) at devfs_read_f+0x7e dofileread(f6235c58,ffffffff,ffffffff,0,c749fdc8,...) at dofileread+0x96 kern_readv(c746fd80,0,f6235c58,f6235c78,1,...) at kern_readv+0x58 read(c746fd80,f6235cf8,c0cdc9ff,c0cb9dd2,c746a550,...) at read+0x4f syscall(f6235d38) at syscall+0x230 Xint0x80_syscall() at Xint0x80_syscall+0x20 --- syscall (3, FreeBSD ELF32, read), eip = 0x2818e7e3, esp = 0xbfbfedbc, ebp = 0xbfbfede8 --- Tracing command getty pid 1379 tid 100114 td 0xc74f7900 sched_switch(c74f7900,0,104,191,4698794c,...) at sched_switch+0x36a mi_switch(104,0,c0ca6009,1eb,0,...) at mi_switch+0x200 sleepq_switch(c74f7900,0,c0ca6009,1a0,0,...) at sleepq_switch+0x15f sleepq_catch_signals(c0ca6009,160,0,c74f7900,c74f7900,...) at sleepq_catch_signals+0xb7 sleepq_wait_sig(c70eac70,0,c0caa5cd,101,0,...) at sleepq_wait_sig+0x17 _cv_wait_sig(c70eac70,c0dff190,c0ca9f9c,511,0,...) at _cv_wait_sig+0x240 tty_wait(c70eac00,c70eac70,f6241c58,1,0,...) at tty_wait+0x71 ttydisc_read(c70eac00,f6241c58,0,9f,0,...) at ttydisc_read+0x22c ttydev_read(c6fe4a00,f6241c58,0,0,1,...) at ttydev_read+0xaa devfs_read_f(c73ff968,f6241c58,c6d7f380,0,c74f7900,...) at devfs_read_f+0x7e dofileread(f6241c58,ffffffff,ffffffff,0,c73ff968,...) at dofileread+0x96 kern_readv(c74f7900,0,f6241c58,f6241c78,1,...) at kern_readv+0x58 read(c74f7900,f6241cf8,c0cdc9ff,c0cb9dd2,c74f2aa0,...) at read+0x4f syscall(f6241d38) at syscall+0x230 Xint0x80_syscall() at Xint0x80_syscall+0x20 --- syscall (3, FreeBSD ELF32, read), eip = 0x2818e7e3, esp = 0xbfbfedbc, ebp = 0xbfbfede8 --- Tracing command getty pid 1378 tid 100152 td 0xc791b000 sched_switch(c791b000,0,104,191,46970042,...) at sched_switch+0x36a mi_switch(104,0,c0ca6009,1eb,0,...) at mi_switch+0x200 sleepq_switch(c791b000,0,c0ca6009,1a0,0,...) at sleepq_switch+0x15f sleepq_catch_signals(c0ca6009,160,0,c791b000,c791b000,...) at sleepq_catch_signals+0xb7 sleepq_wait_sig(c6face70,0,c0caa5cd,101,0,...) at sleepq_wait_sig+0x17 _cv_wait_sig(c6face70,c0dff190,c0ca9f9c,511,0,...) at _cv_wait_sig+0x240 tty_wait(c6face00,c6face70,f62c1c58,1,0,...) at tty_wait+0x71 ttydisc_read(c6face00,f62c1c58,0,9f,0,...) at ttydisc_read+0x22c ttydev_read(c6fe4b00,f62c1c58,0,0,1,...) at ttydev_read+0xaa devfs_read_f(c749f348,f62c1c58,c6d7f380,0,c791b000,...) at devfs_read_f+0x7e dofileread(f62c1c58,ffffffff,ffffffff,0,c749f348,...) at dofileread+0x96 kern_readv(c791b000,0,f62c1c58,f62c1c78,1,...) at kern_readv+0x58 read(c791b000,f62c1cf8,c0cdc9ff,c0cb9dd2,c79157f8,...) at read+0x4f syscall(f62c1d38) at syscall+0x230 Xint0x80_syscall() at Xint0x80_syscall+0x20 --- syscall (3, FreeBSD ELF32, read), eip = 0x2818e7e3, esp = 0xbfbfedbc, ebp = 0xbfbfede8 --- Tracing command getty pid 1377 tid 100147 td 0xc791bb40 sched_switch(c791bb40,0,104,191,469d9d91,...) at sched_switch+0x36a mi_switch(104,0,c0ca6009,1eb,0,...) at mi_switch+0x200 sleepq_switch(c791bb40,0,c0ca6009,1a0,0,...) at sleepq_switch+0x15f sleepq_catch_signals(c0ca6009,160,0,c791bb40,c791bb40,...) at sleepq_catch_signals+0xb7 sleepq_wait_sig(c6fac070,0,c0caa5cd,101,0,...) at sleepq_wait_sig+0x17 _cv_wait_sig(c6fac070,c0dff190,c0ca9f9c,511,0,...) at _cv_wait_sig+0x240 tty_wait(c6fac000,c6fac070,f62b2c58,1,0,...) at tty_wait+0x71 ttydisc_read(c6fac000,f62b2c58,0,9f,0,...) at ttydisc_read+0x22c ttydev_read(c6fe4c00,f62b2c58,0,0,1,...) at ttydev_read+0xaa devfs_read_f(c749f310,f62b2c58,c6d7f380,0,c791bb40,...) at devfs_read_f+0x7e dofileread(f62b2c58,ffffffff,ffffffff,0,c749f310,...) at dofileread+0x96 kern_readv(c791bb40,0,f62b2c58,f62b2c78,1,...) at kern_readv+0x58 read(c791bb40,f62b2cf8,c0cdc9ff,c0cb9dd2,c7916550,...) at read+0x4f syscall(f62b2d38) at syscall+0x230 Xint0x80_syscall() at Xint0x80_syscall+0x20 --- syscall (3, FreeBSD ELF32, read), eip = 0x2818e7e3, esp = 0xbfbfedbc, ebp = 0xbfbfede8 --- Tracing command getty pid 1376 tid 100160 td 0xc7ad6d80 sched_switch(c7ad6d80,0,104,191,4664e9a6,...) at sched_switch+0x36a mi_switch(104,0,c0ca6009,1eb,0,...) at mi_switch+0x200 sleepq_switch(c7ad6d80,0,c0ca6009,1a0,0,...) at sleepq_switch+0x15f sleepq_catch_signals(c0ca6009,160,0,c7ad6d80,c7ad6d80,...) at sleepq_catch_signals+0xb7 sleepq_wait_sig(c70ea270,0,c0caa5cd,101,0,...) at sleepq_wait_sig+0x17 _cv_wait_sig(c70ea270,c0dff190,c0ca9f9c,511,0,...) at _cv_wait_sig+0x240 tty_wait(c70ea200,c70ea270,f62d9c58,1,0,...) at tty_wait+0x71 ttydisc_read(c70ea200,f62d9c58,0,9f,0,...) at ttydisc_read+0x22c ttydev_read(c6fe4d00,f62d9c58,0,0,1,...) at ttydev_read+0xaa devfs_read_f(c74a4b60,f62d9c58,c6d7f380,0,c7ad6d80,...) at devfs_read_f+0x7e dofileread(f62d9c58,ffffffff,ffffffff,0,c74a4b60,...) at dofileread+0x96 kern_readv(c7ad6d80,0,f62d9c58,f62d9c78,1,...) at kern_readv+0x58 read(c7ad6d80,f62d9cf8,c0cdc9ff,c0cb9dd2,c7abb550,...) at read+0x4f syscall(f62d9d38) at syscall+0x230 Xint0x80_syscall() at Xint0x80_syscall+0x20 --- syscall (3, FreeBSD ELF32, read), eip = 0x2818e7e3, esp = 0xbfbfedbc, ebp = 0xbfbfede8 --- Tracing command getty pid 1375 tid 100149 td 0xc791b6c0 sched_switch(c791b6c0,0,104,191,4687f2a7,...) at sched_switch+0x36a mi_switch(104,0,c0ca6009,1eb,0,...) at mi_switch+0x200 sleepq_switch(c791b6c0,0,c0ca6009,1a0,0,...) at sleepq_switch+0x15f sleepq_catch_signals(c0ca6009,160,0,c791b6c0,c791b6c0,...) at sleepq_catch_signals+0xb7 sleepq_wait_sig(c6fac470,0,c0caa5cd,101,0,...) at sleepq_wait_sig+0x17 _cv_wait_sig(c6fac470,c0dff190,c0ca9f9c,511,0,...) at _cv_wait_sig+0x240 tty_wait(c6fac400,c6fac470,f62b8c58,1,0,...) at tty_wait+0x71 ttydisc_read(c6fac400,f62b8c58,0,9f,0,...) at ttydisc_read+0x22c ttydev_read(c6fe4e00,f62b8c58,0,0,1,...) at ttydev_read+0xaa devfs_read_f(c74a4c40,f62b8c58,c6d7f380,0,c791b6c0,...) at devfs_read_f+0x7e dofileread(f62b8c58,ffffffff,ffffffff,0,c74a4c40,...) at dofileread+0x96 kern_readv(c791b6c0,0,f62b8c58,f62b8c78,1,...) at kern_readv+0x58 read(c791b6c0,f62b8cf8,c0cdc9ff,c0cb9dd2,c7916000,...) at read+0x4f syscall(f62b8d38) at syscall+0x230 Xint0x80_syscall() at Xint0x80_syscall+0x20 --- syscall (3, FreeBSD ELF32, read), eip = 0x2818e7e3, esp = 0xbfbfedbc, ebp = 0xbfbfede8 --- Tracing command getty pid 1374 tid 100076 td 0xc70f4240 sched_switch(c70f4240,0,104,191,3a9378e2,...) at sched_switch+0x36a mi_switch(104,0,c0ca6009,1eb,0,...) at mi_switch+0x200 sleepq_switch(c70f4240,0,c0ca6009,1a0,0,...) at sleepq_switch+0x15f sleepq_catch_signals(c088312a,c6faca04,0,c0ca0183,c70f4240,...) at sleepq_catch_signals+0xb7 sleepq_wait_sig(c6faca70,0,f615ab0c,101,0,...) at sleepq_wait_sig+0x17 _cv_wait_sig(c6faca70,c6faca04,c0ca9f9c,511,0,...) at _cv_wait_sig+0x240 tty_wait(c6faca00,c6faca70,f615ac58,1,0,...) at tty_wait+0x71 ttydisc_read(c6faca00,f615ac58,0,9f,0,...) at ttydisc_read+0x22c ttydev_read(c6d68c00,f615ac58,0,0,1,...) at ttydev_read+0xaa devfs_read_f(c749f1c0,f615ac58,c6d7f380,0,c70f4240,...) at devfs_read_f+0x7e dofileread(f615ac58,ffffffff,ffffffff,0,c749f1c0,...) at dofileread+0x96 kern_readv(c70f4240,0,f615ac58,f615ac78,1,...) at kern_readv+0x58 read(c70f4240,f615acf8,c0cdc9ff,c0cb9dd2,c7398000,...) at read+0x4f syscall(f615ad38) at syscall+0x230 Xint0x80_syscall() at Xint0x80_syscall+0x20 --- syscall (3, FreeBSD ELF32, read), eip = 0x2818e7e3, esp = 0xbfbfedbc, ebp = 0xbfbfede8 --- Tracing command inetd pid 1343 tid 100141 td 0xc741eb40 sched_switch(c741eb40,0,104,191,345f796f,...) at sched_switch+0x36a mi_switch(104,0,c0ca6009,1eb,0,...) at mi_switch+0x200 sleepq_switch(c741eb40,0,c0ca6009,1a0,0,...) at sleepq_switch+0x15f sleepq_catch_signals(c088312a,c74ae790,0,c0ca0183,c741eb40,...) at sleepq_catch_signals+0xb7 sleepq_wait_sig(c74ae7a4,0,f62a0a7c,101,0,...) at sleepq_wait_sig+0x17 _cv_wait_sig(c74ae7a4,c74ae790,c0ca8268,603,c74008f8,...) at _cv_wait_sig+0x240 seltdwait(c74008f8,58,c6d7f380,c741eb40,4,...) at seltdwait+0xa2 kern_select(c741eb40,8,bfbfdfd0,0,0,0,20,bfbfdf90,4) at kern_select+0x4f4 select(c741eb40,f62a0cf8,c0cdc9ff,c0ca884e,c7917550,...) at select+0x66 syscall(f62a0d38) at syscall+0x230 Xint0x80_syscall() at Xint0x80_syscall+0x20 --- syscall (93, FreeBSD ELF32, select), eip = 0x281a2763, esp = 0xbfbfdf8c, ebp = 0xbfbfee18 --- Tracing command watchdogd pid 1307 tid 100169 td 0xc7ad5900 sched_switch(c7ad5900,0,104,191,6edfa051,...) at sched_switch+0x36a mi_switch(104,0,c0ca6009,1eb,5c,...) at mi_switch+0x200 sleepq_switch(c7ad5900,0,c0ca6009,1a0,5c,...) at sleepq_switch+0x15f sleepq_catch_signals(ea61,c08cf130,c7ad5900,0,100,...) at sleepq_catch_signals+0xb7 sleepq_timedwait_sig(c0dff9e4,5c,c0ca2c9f,100,0,...) at sleepq_timedwait_sig+0x1a _sleep(c0dff9e4,0,15c,c0ca2c9f,ea61,...) at _sleep+0x31e kern_nanosleep(c7ad5900,f62f4c64,f62f4c6c,3c,0,...) at kern_nanosleep+0xc1 nanosleep(c7ad5900,f62f4cf8,c,c7ad5900,c7917d48,...) at nanosleep+0x6f syscall(f62f4d38) at syscall+0x230 Xint0x80_syscall() at Xint0x80_syscall+0x20 --- syscall (240, FreeBSD ELF32, nanosleep), eip = 0x281880f7, esp = 0xbfbfecdc, ebp = 0xbfbfed08 --- Tracing command bash pid 1291 tid 100159 td 0xc7ad8000 sched_switch(c7ad8000,0,104,191,fc45539b,...) at sched_switch+0x36a mi_switch(104,0,c0ca6009,1eb,5c,...) at mi_switch+0x200 sleepq_switch(c7ad8000,0,c0ca6009,1a0,5c,...) at sleepq_switch+0x15f sleepq_catch_signals(c0ca6009,160,0,100,100,...) at sleepq_catch_signals+0xb7 sleepq_wait_sig(c7abb7f8,5c,c0ca8802,100,0,...) at sleepq_wait_sig+0x17 _sleep(c7abb7f8,c7abb880,15c,c0ca8802,0,...) at _sleep+0x354 kern_wait(c7ad8000,ffffffff,f62d6c74,6,0,...) at kern_wait+0xb76 wait4(c7ad8000,f62d6cf8,c0cdc9ff,c0ca86f1,c7abb7f8,...) at wait4+0x3b syscall(f62d6d38) at syscall+0x230 Xint0x80_syscall() at Xint0x80_syscall+0x20 --- syscall (7, FreeBSD ELF32, wait4), eip = 0x282bf32b, esp = 0xbfbfe9ac, ebp = 0xbfbfe9c8 --- Tracing command sshd pid 1290 tid 100122 td 0xc74f7240 sched_switch(c74f7240,0,104,191,2703275e,...) at sched_switch+0x36a mi_switch(104,0,c0ca6009,1eb,0,...) at mi_switch+0x200 sleepq_switch(c74f7240,0,c0ca6009,1a0,0,...) at sleepq_switch+0x15f sleepq_catch_signals(c088312a,c7656590,0,c0ca0183,c74f7240,...) at sleepq_catch_signals+0xb7 sleepq_wait_sig(c76565a4,0,f6263a7c,101,0,...) at sleepq_wait_sig+0x17 _cv_wait_sig(c76565a4,c7656590,c0ca8268,603,c7413850,...) at _cv_wait_sig+0x240 seltdwait(c7413850,58,c73bd800,c74f7240,200246,...) at seltdwait+0xa2 kern_select(c74f7240,c,288060b8,288060dc,0,0,20,bfbfde60,0) at kern_select+0x4f4 select(c74f7240,f6263cf8,c0cdc9ff,c0c89476,c74f22a8,...) at select+0x66 syscall(f6263d38) at syscall+0x230 Xint0x80_syscall() at Xint0x80_syscall+0x20 --- syscall (93, FreeBSD ELF32, select), eip = 0x283cd763, esp = 0xbfbfde5c, ebp = 0xbfbfdea8 --- Tracing command sshd pid 1288 tid 100158 td 0xc7ad8240 sched_switch(c7ad8240,0,104,191,4b211ead,...) at sched_switch+0x36a mi_switch(104,0,c0ca6009,1eb,58,...) at mi_switch+0x200 sleepq_switch(c7ad8240,0,c0ca6009,1a0,58,...) at sleepq_switch+0x15f sleepq_catch_signals(c0ca6009,160,0,100,100,...) at sleepq_catch_signals+0xb7 sleepq_wait_sig(c7ad058c,58,c0cabc8a,100,0,...) at sleepq_wait_sig+0x17 _sleep(c7ad058c,c7ad054c,158,c0cabc8a,0) at _sleep+0x354 sbwait(c7ad0528,4,c0cabd59,5c5,c7ad054c,...) at sbwait+0x76 soreceive_generic(c7ad04d4,0,f62d3c58,0,0,...) at soreceive_generic+0x3f0 soreceive(c7ad04d4,0,f62d3c58,0,0,0) at soreceive+0x38 soo_read(c74139d8,f62d3c58,c74b1b80,0,c7ad8240,...) at soo_read+0x4e dofileread(f62d3c58,ffffffff,ffffffff,0,c74139d8,...) at dofileread+0x96 kern_readv(c7ad8240,5,f62d3c58,f62d3c78,1,...) at kern_readv+0x58 read(c7ad8240,f62d3cf8,c0cdc9ff,c0cc3c45,c7abbaa0,...) at read+0x4f syscall(f62d3d38) at syscall+0x230 Xint0x80_syscall() at Xint0x80_syscall+0x20 --- syscall (3, FreeBSD ELF32, read), eip = 0x283cd7e3, esp = 0xbfbfde4c, ebp = 0xbfbfde88 --- Tracing command cron pid 1275 tid 100153 td 0xc791ad80 sched_switch(c791ad80,0,104,191,e0f11c1b,...) at sched_switch+0x36a mi_switch(104,0,c0ca6009,1eb,5c,...) at mi_switch+0x200 sleepq_switch(c791ad80,0,c0ca6009,1a0,5c,...) at sleepq_switch+0x15f sleepq_catch_signals(e679,c08cf130,c791ad80,0,100,...) at sleepq_catch_signals+0xb7 sleepq_timedwait_sig(c0dff9e4,5c,c0ca2c9f,100,0,...) at sleepq_timedwait_sig+0x1a _sleep(c0dff9e4,0,15c,c0ca2c9f,e679,...) at _sleep+0x31e kern_nanosleep(c791ad80,f62c4c64,f62c4c6c,3b,0,...) at kern_nanosleep+0xc1 nanosleep(c791ad80,f62c4cf8,c0cdc9ff,c0ca8cb6,c7915550,...) at nanosleep+0x6f syscall(f62c4d38) at syscall+0x230 Xint0x80_syscall() at Xint0x80_syscall+0x20 --- syscall (240, FreeBSD ELF32, nanosleep), eip = 0x2817b0f7, esp = 0xbfbfec8c, ebp = 0xbfbfecb8 --- Tracing command sendmail pid 1268 tid 100097 td 0xc741c6c0 sched_switch(c741c6c0,0,104,191,ce08da47,...) at sched_switch+0x36a mi_switch(104,0,c0ca6009,1eb,68,...) at mi_switch+0x200 sleepq_switch(c741c6c0,0,c0ca6009,1a0,68,...) at sleepq_switch+0x15f sleepq_catch_signals(c0ca6009,160,0,100,100,...) at sleepq_catch_signals+0xb7 sleepq_wait_sig(c7425058,68,c0c54e4e,100,0,...) at sleepq_wait_sig+0x17 _sleep(c7425058,c7425088,168,c0c54e4e,0,...) at _sleep+0x354 kern_sigsuspend(c741c6c0,0,0,0,0,...) at kern_sigsuspend+0xae sigsuspend(c741c6c0,f61afcf8,c0cdc9ff,c0ca86f1,c7425000,...) at sigsuspend+0x4d syscall(f61afd38) at syscall+0x230 Xint0x80_syscall() at Xint0x80_syscall+0x20 --- syscall (4, FreeBSD ELF32, write), eip = 0x2833325b, esp = 0xbfbfcf8c, ebp = 0xbfbfcfb8 --- Tracing command sendmail pid 1264 tid 100130 td 0xc77d4000 sched_switch(c77d4000,0,104,191,350f17ba,...) at sched_switch+0x36a mi_switch(104,0,c0ca6009,1eb,0,...) at mi_switch+0x200 sleepq_switch(c77d4000,0,c0ca6009,1a0,0,...) at sleepq_switch+0x15f sleepq_catch_signals(f627ba4c,c088312a,c73b6950,0,c77d4000,...) at sleepq_catch_signals+0xb7 sleepq_timedwait_sig(c73b6964,0,f627ba7c,101,0,...) at sleepq_timedwait_sig+0x1a _cv_timedwait_sig(c73b6964,c73b6950,1389,603,c749f070,...) at _cv_timedwait_sig+0x250 seltdwait(f627bc28,f627bc30,c7714280,c77d4000,c15b1014,...) at seltdwait+0x8a kern_select(c77d4000,5,bfbfc510,0,0,f627bc70,20,5,0) at kern_select+0x4f4 select(c77d4000,f627bcf8,c0cdc9ff,c0ca8c15,c77a0aa0,...) at select+0x66 syscall(f627bd38) at syscall+0x230 Xint0x80_syscall() at Xint0x80_syscall+0x20 --- syscall (93, FreeBSD ELF32, select), eip = 0x283d8763, esp = 0xbfbfc47c, ebp = 0xbfbfcfa8 --- Tracing command sshd pid 1256 tid 100115 td 0xc74f76c0 sched_switch(c74f76c0,0,104,191,451e6e52,...) at sched_switch+0x36a mi_switch(104,0,c0ca6009,1eb,0,...) at mi_switch+0x200 sleepq_switch(c74f76c0,0,c0ca6009,1a0,0,...) at sleepq_switch+0x15f sleepq_catch_signals(c088312a,c7656690,0,c0ca0183,c74f76c0,...) at sleepq_catch_signals+0xb7 sleepq_wait_sig(c76566a4,0,f6245a7c,101,0,...) at sleepq_wait_sig+0x17 _cv_wait_sig(c76566a4,c7656690,c0ca8268,603,c78a0268,...) at _cv_wait_sig+0x240 seltdwait(c78a0268,58,c7714580,c74f76c0,f6245ae8,...) at seltdwait+0xa2 kern_select(c74f76c0,5,2880c0b0,0,0,0,20,bfbfdf20,a) at kern_select+0x4f4 select(c74f76c0,f6245cf8,c,c74f76c0,c74f27f8,...) at select+0x66 syscall(f6245d38) at syscall+0x230 Xint0x80_syscall() at Xint0x80_syscall+0x20 --- syscall (93, FreeBSD ELF32, select), eip = 0x283cd763, esp = 0xbfbfdf1c, ebp = 0xbfbfee38 --- Tracing command moused pid 1184 tid 100137 td 0xc77d3240 sched_switch(c77d3240,0,104,191,5f981236,...) at sched_switch+0x36a mi_switch(104,0,c0ca6009,1eb,0,...) at mi_switch+0x200 sleepq_switch(c77d3240,0,c0ca6009,1a0,0,...) at sleepq_switch+0x15f sleepq_catch_signals(c088312a,c73b6e10,0,c0ca0183,c77d3240,...) at sleepq_catch_signals+0xb7 sleepq_wait_sig(c73b6e24,0,f6290a7c,101,0,...) at sleepq_wait_sig+0x17 _cv_wait_sig(c73b6e24,c73b6e10,c0ca8268,603,c74a4e70,...) at _cv_wait_sig+0x240 seltdwait(c74a4e70,58,c6d7f380,c77d3240,0,...) at seltdwait+0xa2 kern_select(c77d3240,6,bfbfea34,0,0,0,20,bfbfe9c0,1) at kern_select+0x4f4 select(c77d3240,f6290cf8,c0cdc9ff,c0cb9dd2,c74f3aa0,...) at select+0x66 syscall(f6290d38) at syscall+0x230 Xint0x80_syscall() at Xint0x80_syscall+0x20 --- syscall (93, FreeBSD ELF32, select), eip = 0x281ab763, esp = 0xbfbfe9bc, ebp = 0xbfbfeb58 --- Tracing command ntpd pid 1118 tid 100087 td 0xc7455000 sched_switch(c7455000,0,104,191,f936cfbe,...) at sched_switch+0x36a mi_switch(104,0,c0ca6009,1eb,0,...) at mi_switch+0x200 sleepq_switch(c7455000,0,c0ca6009,1a0,0,...) at sleepq_switch+0x15f sleepq_catch_signals(c088312a,c7372390,0,c0ca0183,c7455000,...) at sleepq_catch_signals+0xb7 sleepq_wait_sig(c73723a4,0,f6187a7c,101,0,...) at sleepq_wait_sig+0x17 _cv_wait_sig(c73723a4,c7372390,c0ca8268,603,c74a4460,...) at _cv_wait_sig+0x240 seltdwait(c74a4460,58,c6d7f380,c7455000,0,...) at seltdwait+0xa2 kern_select(c7455000,1c,bfbfed28,0,0,0,20,bfbfed00,0) at kern_select+0x4f4 select(c7455000,f6187cf8,16,c7455000,c7451000,...) at select+0x66 syscall(f6187d38) at syscall+0x230 Xint0x80_syscall() at Xint0x80_syscall+0x20 --- syscall (93, FreeBSD ELF32, select), eip = 0x28355763, esp = 0xbfbfecfc, ebp = 0xbfbfedc8 --- Tracing command rpc.lockd pid 1030 tid 100100 td 0xc7452240 sched_switch(c7452240,0,104,191,686b3c27,...) at sched_switch+0x36a mi_switch(104,0,c0ca6009,1eb,0,...) at mi_switch+0x200 sleepq_switch(c7452240,0,c0ca6009,1a0,0,...) at sleepq_switch+0x15f sleepq_catch_signals(f61bc9fc,c088312a,c74b1980,0,c7452240,...) at sleepq_catch_signals+0xb7 sleepq_timedwait_sig(c7476110,0,f61bca2c,101,0,...) at sleepq_timedwait_sig+0x1a _cv_timedwait_sig(c7476110,c74b1980,1388,3af,c7870a00,...) at _cv_timedwait_sig+0x250 svc_run_internal(c74523a8,14,c0cc53cc,c0cc4ac1,f61bcb8c,...) at svc_run_internal+0x356 svc_run(c74b1980,0,4,c0a78e70,f61bcb8c,...) at svc_run+0x7f nlm_syscall(c7452240,f61bccf8,c0cdc9ff,c0ca9055,c7450000,...) at nlm_syscall+0x77d syscall(f61bcd38) at syscall+0x230 Xint0x80_syscall() at Xint0x80_syscall+0x20 --- syscall (154, FreeBSD ELF32, nlm_syscall), eip = 0x280f9e5b, esp = 0xbfbfed4c, ebp = 0xbfbfee18 --- Tracing command rpc.statd pid 1023 tid 100128 td 0xc77d4480 sched_switch(c77d4480,0,104,191,4b5053ce,...) at sched_switch+0x36a mi_switch(104,0,c0ca6009,1eb,0,...) at mi_switch+0x200 sleepq_switch(c77d4480,0,c0ca6009,1a0,0,...) at sleepq_switch+0x15f sleepq_catch_signals(f6275a4c,c088312a,c73b6cd0,0,c77d4480,...) at sleepq_catch_signals+0xb7 sleepq_timedwait_sig(c73b6ce4,0,f6275a7c,101,0,...) at sleepq_timedwait_sig+0x1a _cv_timedwait_sig(c73b6ce4,c73b6cd0,7531,603,c749fa48,...) at _cv_timedwait_sig+0x250 seltdwait(f6275c28,f6275c30,c6d7f380,c77d4480,c7870600,...) at seltdwait+0x8a kern_select(c77d4480,8,bfbfed34,0,0,f6275c70,20,1e,0) at kern_select+0x4f4 select(c77d4480,f6275cf8,c0cdc9ff,c0ca893f,c77a1000,...) at select+0x66 syscall(f6275d38) at syscall+0x230 Xint0x80_syscall() at Xint0x80_syscall+0x20 --- syscall (93, FreeBSD ELF32, select), eip = 0x28188763, esp = 0xbfbfec8c, ebp = 0xbfbfedc8 --- Tracing command nfsd pid 1016 tid 100140 td 0xc74f8b40 sched_switch(c74f8b40,0,104,191,59dd99a0,...) at sched_switch+0x36a mi_switch(104,0,c0ca6009,1eb,0,...) at mi_switch+0x200 sleepq_switch(c74f8b40,0,c0ca6009,1a0,0,...) at sleepq_switch+0x15f sleepq_catch_signals(f629dbf8,c088312a,c7259a00,0,c74f8b40,...) at sleepq_catch_signals+0xb7 sleepq_timedwait_sig(c7476150,0,f629dc28,101,0,...) at sleepq_timedwait_sig+0x1a _cv_timedwait_sig(c7476150,c7259a00,1388,3ea,0,...) at _cv_timedwait_sig+0x250 svc_run_internal(f629dd24,c0868f28,c7259a00,f629dd38,c0c9cda4,...) at svc_run_internal+0x356 svc_thread_start(c7259a00,f629dd38,c0c9cda4,343,c6f41d48,...) at svc_thread_start+0x10 fork_exit(c0a86ec0,c7259a00,f629dd38) at fork_exit+0xb8 fork_trampoline() at fork_trampoline+0x8 --- trap 0x2e, eip = 0xc, esp = 0x33, ebp = 0 --- Tracing command nfsd pid 1016 tid 100139 td 0xc74f8d80 sched_switch(c74f8d80,0,104,191,59dd50cb,...) at sched_switch+0x36a mi_switch(104,0,c0ca6009,1eb,0,...) at mi_switch+0x200 sleepq_switch(c74f8d80,0,c0ca6009,1a0,0,...) at sleepq_switch+0x15f sleepq_catch_signals(f629abf8,c088312a,c7259a00,0,c74f8d80,...) at sleepq_catch_signals+0xb7 sleepq_timedwait_sig(c7476190,0,f629ac28,101,0,...) at sleepq_timedwait_sig+0x1a _cv_timedwait_sig(c7476190,c7259a00,1388,3ea,0,...) at _cv_timedwait_sig+0x250 svc_run_internal(f629ad24,c0868f28,c7259a00,f629ad38,c0c9cda4,...) at svc_run_internal+0x356 svc_thread_start(c7259a00,f629ad38,c0c9cda4,343,c6f41d48,...) at svc_thread_start+0x10 fork_exit(c0a86ec0,c7259a00,f629ad38) at fork_exit+0xb8 fork_trampoline() at fork_trampoline+0x8 --- trap 0x2e, eip = 0xc, esp = 0x33, ebp = 0 --- Tracing command nfsd pid 1016 tid 100138 td 0xc77d3000 sched_switch(c77d3000,0,104,191,59a65c77,...) at sched_switch+0x36a mi_switch(104,0,c0ca6009,1eb,0,...) at mi_switch+0x200 sleepq_switch(c77d3000,0,c0ca6009,1a0,0,...) at sleepq_switch+0x15f sleepq_catch_signals(f6297bf8,c088312a,c7259a00,0,c77d3000,...) at sleepq_catch_signals+0xb7 sleepq_timedwait_sig(c74761d0,0,f6297c28,101,0,...) at sleepq_timedwait_sig+0x1a _cv_timedwait_sig(c74761d0,c7259a00,1388,3af,2,...) at _cv_timedwait_sig+0x250 svc_run_internal(f6297d24,c0868f28,c7259a00,f6297d38,c0c9cda4,...) at svc_run_internal+0x356 svc_thread_start(c7259a00,f6297d38,c0c9cda4,343,c6f41d48,...) at svc_thread_start+0x10 fork_exit(c0a86ec0,c7259a00,f6297d38) at fork_exit+0xb8 fork_trampoline() at fork_trampoline+0x8 --- trap 0x2e, eip = 0xc, esp = 0x33, ebp = 0 --- Tracing command nfsd pid 1016 tid 100077 td 0xc70f4000 sched_switch(c70f4000,0,104,191,5953fa7b,...) at sched_switch+0x36a mi_switch(104,0,c0ca6009,1eb,0,...) at mi_switch+0x200 sleepq_switch(c70f4000,0,c0ca6009,1a0,0,...) at sleepq_switch+0x15f sleepq_catch_signals(f615eae8,c088312a,c7259a00,0,c70f4000,...) at sleepq_catch_signals+0xb7 sleepq_timedwait_sig(c7657450,0,f615eb18,101,0,...) at sleepq_timedwait_sig+0x1a _cv_timedwait_sig(c7657450,c7259a00,1388,3af,f615eb60,...) at _cv_timedwait_sig+0x250 svc_run_internal(c70f4168,14,c0cc53cc,c0cc3e80,f615ec3c,...) at svc_run_internal+0x356 svc_run(c7259a00,0,c0cc4184,1c2,0,...) at svc_run+0x7f nfssvc_nfsd(bfbfe8b0,f615ec3c,c,c6d7f380,f615ec50,...) at nfssvc_nfsd+0xad nfssvc_nfsserver(c70f4000,f615ecf8,bfbfe8b0,c70f4000,0,...) at nfssvc_nfsserver+0x24f nfssvc(c70f4000,f615ecf8,c0cdc9ff,c0ca8c15,c6f41d48,...) at nfssvc+0x83 syscall(f615ed38) at syscall+0x230 Xint0x80_syscall() at Xint0x80_syscall+0x20 --- syscall (155, FreeBSD ELF32, nfssvc), eip = 0x280dae3b, esp = 0xbfbfe86c, ebp = 0xbfbfead8 --- Tracing command nfsd pid 1015 tid 100120 td 0xc741c480 sched_switch(c741c480,0,104,191,60e9c4f,...) at sched_switch+0x36a mi_switch(104,0,c0ca6009,1eb,0,...) at mi_switch+0x200 sleepq_switch(c741c480,0,c0ca6009,1a0,0,...) at sleepq_switch+0x15f sleepq_catch_signals(c088312a,c73b7110,0,c0ca0183,c741c480,...) at sleepq_catch_signals+0xb7 sleepq_wait_sig(c73b7124,0,f625da7c,101,0,...) at sleepq_wait_sig+0x17 _cv_wait_sig(c73b7124,c73b7110,c0ca8268,603,c73ffb60,...) at _cv_wait_sig+0x240 seltdwait(c73ffb60,58,c6d7f380,c741c480,f625dae8,...) at seltdwait+0xa2 kern_select(c741c480,5,bfbfece0,0,0,0,20,bfbfeae0,1) at kern_select+0x4f4 select(c741c480,f625dcf8,c,c741c480,c77a1d48,...) at select+0x66 syscall(f625dd38) at syscall+0x230 Xint0x80_syscall() at Xint0x80_syscall+0x20 --- syscall (93, FreeBSD ELF32, select), eip = 0x2817f763, esp = 0xbfbfeadc, ebp = 0xbfbfee18 --- Tracing command mountd pid 1006 tid 100096 td 0xc741c900 sched_switch(c741c900,0,104,191,bb4b0e7,...) at sched_switch+0x36a mi_switch(104,0,c0ca6009,1eb,0,...) at mi_switch+0x200 sleepq_switch(c741c900,0,c0ca6009,1a0,0,...) at sleepq_switch+0x15f sleepq_catch_signals(c088312a,c7656e90,0,c0ca0183,c741c900,...) at sleepq_catch_signals+0xb7 sleepq_wait_sig(c7656ea4,0,f61aba7c,101,0,...) at sleepq_wait_sig+0x17 _cv_wait_sig(c7656ea4,c7656e90,c0ca8268,603,c7400a80,...) at _cv_wait_sig+0x240 seltdwait(c7400a80,58,c6d7f380,c741c900,c0cb03b2,...) at seltdwait+0xa2 kern_select(c741c900,9,bfbfed7c,0,0,0,20,bfbfed50,bfbfed7c) at kern_select+0x4f4 select(c741c900,f61abcf8,c0cdc9ff,c0cc3c45,c74252a8,...) at select+0x66 syscall(f61abd38) at syscall+0x230 Xint0x80_syscall() at Xint0x80_syscall+0x20 --- syscall (93, FreeBSD ELF32, select), eip = 0x28192763, esp = 0xbfbfed4c, ebp = 0xbfbfee18 --- Tracing command rpcbind pid 913 tid 100092 td 0xc7452b40 sched_switch(c7452b40,0,104,191,3551373d,...) at sched_switch+0x36a mi_switch(104,0,c0ca6009,1eb,0,...) at mi_switch+0x200 sleepq_switch(c7452b40,0,c0ca6009,1a0,0,...) at sleepq_switch+0x15f sleepq_catch_signals(f619baa8,c088312a,c76562d0,0,c7452b40,...) at sleepq_catch_signals+0xb7 sleepq_timedwait_sig(c76562e4,0,f619bad8,101,0,...) at sleepq_timedwait_sig+0x1a _cv_timedwait_sig(c76562e4,c76562d0,7531,603,f619bb8c,...) at _cv_timedwait_sig+0x250 seltdwait(f619bc5c,f619bc64,511,c7452b40,f619bb5c,...) at seltdwait+0x8a poll(c7452b40,f619bcf8,c0cdc9ff,c0ca893f,c7450aa0,...) at poll+0x300 syscall(f619bd38) at syscall+0x230 Xint0x80_syscall() at Xint0x80_syscall+0x20 --- syscall (209, FreeBSD ELF32, poll), eip = 0x28140cdf, esp = 0xbfbfcc0c, ebp = 0xbfbfedd8 --- Tracing command syslogd pid 879 tid 100079 td 0xc741dd80 sched_switch(c741dd80,0,104,191,42c2f801,...) at sched_switch+0x36a mi_switch(104,0,c0ca6009,1eb,0,...) at mi_switch+0x200 sleepq_switch(c741dd80,0,c0ca6009,1a0,0,...) at sleepq_switch+0x15f sleepq_catch_signals(c088312a,c731dd50,0,c0ca0183,c741dd80,...) at sleepq_catch_signals+0xb7 sleepq_wait_sig(c731dd64,0,f6166a7c,101,0,...) at sleepq_wait_sig+0x17 _cv_wait_sig(c731dd64,c731dd50,c0ca8268,603,c73ff930,...) at _cv_wait_sig+0x240 seltdwait(c73ff930,58,c6d7f380,c741dd80,58,...) at seltdwait+0xa2 kern_select(c741dd80,9,2842c0ac,0,0,0,20,bfbfe2b0,0) at kern_select+0x4f4 select(c741dd80,f6166cf8,c0cdc9ff,c0c40525,c6f417f8,...) at select+0x66 syscall(f6166d38) at syscall+0x230 Xint0x80_syscall() at Xint0x80_syscall+0x20 --- syscall (93, FreeBSD ELF32, select), eip = 0x28191763, esp = 0xbfbfe2ac, ebp = 0xbfbfee18 --- Tracing command devd pid 697 tid 100102 td 0xc741ed80 sched_switch(c741ed80,0,104,191,ee4da270,...) at sched_switch+0x36a mi_switch(104,0,c0ca6009,1eb,0,...) at mi_switch+0x200 sleepq_switch(c741ed80,0,c0ca6009,1a0,0,...) at sleepq_switch+0x15f sleepq_catch_signals(c088312a,c73714d0,0,c0ca0183,c741ed80,...) at sleepq_catch_signals+0xb7 sleepq_wait_sig(c73714e4,0,f61c4a7c,101,0,...) at sleepq_wait_sig+0x17 _cv_wait_sig(c73714e4,c73714d0,c0ca8268,603,c73ff7e0,...) at _cv_wait_sig+0x240 seltdwait(c73ff7e0,58,c6d7f380,c741ed80,c0c996b4,...) at seltdwait+0xa2 kern_select(c741ed80,6,bfbfe9a0,0,0,0,20,bfbfe970,10) at kern_select+0x4f4 select(c741ed80,f61c4cf8,c0cdc9ff,c0c40525,c7426aa0,...) at select+0x66 syscall(f61c4d38) at syscall+0x230 Xint0x80_syscall() at Xint0x80_syscall+0x20 --- syscall (93, FreeBSD ELF32, select), eip = 0x8088c03, esp = 0xbfbfe96c, ebp = 0xbfbfee48 --- Tracing command flowcleaner pid 20 tid 100075 td 0xc70f4480 sched_switch(c70f4480,0,104,191,ce3088bb,...) at sched_switch+0x36a mi_switch(104,0,c0ca6009,1eb,0,...) at mi_switch+0x200 sleepq_switch(c70f4480,0,c0ca6009,283,c70f4480,...) at sleepq_switch+0x15f sleepq_timedwait(c0f6c0c8,0,f3f6acc4,1,0,...) at sleepq_timedwait+0x6b _cv_timedwait(c0f6c0c8,c0f6c0d0,2710,3f0,0,...) at _cv_timedwait+0x250 flowtable_cleaner(0,f3f6ad38,c0c9cda4,343,c73982a8,...) at flowtable_cleaner+0x1bf fork_exit(c093b9c0,0,f3f6ad38) at fork_exit+0xb8 fork_trampoline() at fork_trampoline+0x8 --- trap 0, eip = 0, esp = 0xf3f6ad70, ebp = 0 --- Tracing command softdepflush pid 19 tid 100074 td 0xc70f46c0 sched_switch(c70f46c0,0,104,191,d46de6c,...) at sched_switch+0x36a mi_switch(104,0,c0ca6009,1eb,44,...) at mi_switch+0x200 sleepq_switch(c70f46c0,0,c0ca6009,283,0,...) at sleepq_switch+0x15f sleepq_timedwait(c0f77820,44,c0cc8f10,0,0,...) at sleepq_timedwait+0x6b _sleep(c0f77820,c0f777c4,44,c0cc8f10,3e8,...) at _sleep+0x339 softdep_flush(0,f3f67d38,c0c9cda4,343,c7398550,...) at softdep_flush+0x1ec fork_exit(c0ac7810,0,f3f67d38) at fork_exit+0xb8 fork_trampoline() at fork_trampoline+0x8 --- trap 0, eip = 0, esp = 0xf3f67d70, ebp = 0 --- Tracing command vnlru pid 18 tid 100073 td 0xc70f4900 sched_switch(c70f4900,0,104,191,d9900ac,...) at sched_switch+0x36a mi_switch(104,0,c0ca6009,1eb,50,...) at mi_switch+0x200 sleepq_switch(c70f4900,0,c0ca6009,283,0,...) at sleepq_switch+0x15f sleepq_timedwait(c73987f8,50,c0caff01,0,0,...) at sleepq_timedwait+0x6b _sleep(c73987f8,c0f6be98,250,c0caff01,3e8,...) at _sleep+0x339 vnlru_proc(0,f3f64d38,c0c9cda4,343,c73987f8,...) at vnlru_proc+0xe7 fork_exit(c0929610,0,f3f64d38) at fork_exit+0xb8 fork_trampoline() at fork_trampoline+0x8 --- trap 0, eip = 0, esp = 0xf3f64d70, ebp = 0 --- Tracing command syncer pid 17 tid 100072 td 0xc70f4b40 sched_switch(c70f4b40,0,104,191,2150422c,...) at sched_switch+0x36a mi_switch(104,0,c0ca6009,1eb,0,...) at mi_switch+0x200 sleepq_switch(c70f4b40,0,c0ca6009,283,c70f4b40,...) at sleepq_switch+0x15f sleepq_timedwait(c0f6bed4,0,f3f61c84,1,0,...) at sleepq_timedwait+0x6b _cv_timedwait(c0f6bed4,c0f6bec0,3e8,6a3,4e20,...) at _cv_timedwait+0x250 sched_sync(0,f3f61d38,c0c9cda4,343,c7398aa0,...) at sched_sync+0x54f fork_exit(c0928a70,0,f3f61d38) at fork_exit+0xb8 fork_trampoline() at fork_trampoline+0x8 --- trap 0, eip = 0, esp = 0xf3f61d70, ebp = 0 --- Tracing command bufdaemon pid 16 tid 100071 td 0xc70f4d80 sched_switch(c70f4d80,0,104,191,e7eb978,...) at sched_switch+0x36a mi_switch(104,0,c0ca6009,1eb,44,...) at mi_switch+0x200 sleepq_switch(c70f4d80,0,c0ca6009,283,0,...) at sleepq_switch+0x15f sleepq_timedwait(c0f6bc20,44,c0cad47c,0,0,...) at sleepq_timedwait+0x6b _sleep(c0f6bc20,c0f6bc24,44,c0cad47c,3e8,...) at _sleep+0x339 buf_daemon(0,f3f5ed38,c0c9cda4,343,c7398d48,...) at buf_daemon+0x138 fork_exit(c0911810,0,f3f5ed38) at fork_exit+0xb8 fork_trampoline() at fork_trampoline+0x8 --- trap 0, eip = 0, esp = 0xf3f5ed70, ebp = 0 --- Tracing command pagezero pid 15 tid 100070 td 0xc70f6000 sched_switch(c70f6000,0,104,191,4339835a,...) at sched_switch+0x36a mi_switch(104,0,c0ca6009,1eb,0,...) at mi_switch+0x200 sleepq_switch(c70f6000,0,c0ca6009,283,0,...) at sleepq_switch+0x15f sleepq_timedwait(c0f78614,0,c0ccee75,0,0,...) at sleepq_timedwait+0x6b _sleep(c0f78614,c0f78100,0,c0ccee75,493e0,...) at _sleep+0x339 vm_pagezero(0,f3f5bd38,c0c9cda4,343,c6d7a2a8,...) at vm_pagezero+0xdc fork_exit(c0b06d80,0,f3f5bd38) at fork_exit+0xb8 fork_trampoline() at fork_trampoline+0x8 --- trap 0, eip = 0, esp = 0xf3f5bd70, ebp = 0 --- Tracing command vmdaemon pid 9 tid 100069 td 0xc70f6240 sched_switch(c70f6240,0,104,191,4333c3a6,...) at sched_switch+0x36a mi_switch(104,0,c0ca6009,1eb,68,...) at mi_switch+0x200 sleepq_switch(c70f6240,0,c0ca6009,260,0,...) at sleepq_switch+0x15f sleepq_wait(c0f78244,68,c0cad47c,0,0,...) at sleepq_wait+0x63 _sleep(c0f78244,c0f78248,68,c0cad47c,0,...) at _sleep+0x36b vm_daemon(0,f3f58d38,c0c9cda4,343,c6d7a550,...) at vm_daemon+0x59 fork_exit(c0b012a0,0,f3f58d38) at fork_exit+0xb8 fork_trampoline() at fork_trampoline+0x8 --- trap 0, eip = 0, esp = 0xf3f58d70, ebp = 0 --- Tracing command pagedaemon pid 8 tid 100068 td 0xc70f6480 sched_switch(c70f6480,0,104,191,ccdb9d6d,...) at sched_switch+0x36a mi_switch(104,0,c0ca6009,1eb,44,...) at mi_switch+0x200 sleepq_switch(c70f6480,0,c0ca6009,283,0,...) at sleepq_switch+0x15f sleepq_timedwait(c0f7820c,44,c0cad47c,0,0,...) at sleepq_timedwait+0x6b _sleep(c0f7820c,c0f78100,44,c0cad47c,1388,...) at _sleep+0x339 vm_pageout(0,f3f55d38,c0c9cda4,343,c6d7a7f8,...) at vm_pageout+0x2bb fork_exit(c0b02140,0,f3f55d38) at fork_exit+0xb8 fork_trampoline() at fork_trampoline+0x8 --- trap 0, eip = 0, esp = 0xf3f55d70, ebp = 0 --- Tracing command xpt_thrd pid 7 tid 100067 td 0xc70f66c0 sched_switch(c70f66c0,0,104,191,aeb83fe0,...) at sched_switch+0x36a mi_switch(104,0,c0ca6009,1eb,4c,...) at mi_switch+0x200 sleepq_switch(c70f66c0,0,c0ca6009,260,0,...) at sleepq_switch+0x15f sleepq_wait(c0dcbc54,4c,c0c3b626,0,0,...) at sleepq_wait+0x63 _sleep(c0dcbc54,c0dcbc98,4c,c0c3b626,0,...) at _sleep+0x36b xpt_scanner_thread(0,f3ef2d38,c0c9cda4,343,c6d7aaa0,...) at xpt_scanner_thread+0x47 fork_exit(c0483c30,0,f3ef2d38) at fork_exit+0xb8 fork_trampoline() at fork_trampoline+0x8 --- trap 0, eip = 0, esp = 0xf3ef2d70, ebp = 0 --- Tracing command fdc0 pid 6 tid 100063 td 0xc6fb7240 sched_switch(c6fb7240,0,104,191,38fcfa34,...) at sched_switch+0x36a mi_switch(104,0,c0ca6009,1eb,4c,...) at mi_switch+0x200 sleepq_switch(c6fb7240,0,c0ca6009,283,0,...) at sleepq_switch+0x15f sleepq_timedwait(c6fac83c,4c,c0c97043,0,0,...) at sleepq_timedwait+0x6b _sleep(c6fac83c,c6fac8f0,4c,c0c97043,3e8,...) at _sleep+0x339 fdc_thread(c6fac800,f3ee6d38,c0c9cda4,343,c6d7ad48,...) at fdc_thread+0x27d fork_exit(c0b842b0,c6fac800,f3ee6d38) at fork_exit+0xb8 fork_trampoline() at fork_trampoline+0x8 --- trap 0, eip = 0, esp = 0xf3ee6d70, ebp = 0 --- Tracing command fw0_probe pid 5 tid 100061 td 0xc6fb76c0 sched_switch(c6fb76c0,0,104,191,95b1cd44,...) at sched_switch+0x36a mi_switch(104,0,c0ca6009,1eb,5c,...) at mi_switch+0x200 sleepq_switch(c6fb76c0,0,c0ca6009,1a0,5c,...) at sleepq_switch+0x15f sleepq_catch_signals(c0ca6009,160,0,100,100,...) at sleepq_catch_signals+0xb7 sleepq_wait_sig(c6ff7000,5c,c0c97043,100,0,...) at sleepq_wait_sig+0x17 _sleep(c6ff7000,c6ffb488,15c,c0c97043,0,...) at _sleep+0x354 fw_bus_probe_thread(c6ff7000,f3ed6d38,c0c9cda4,343,c6f41000,...) at fw_bus_probe_thread+0xa08 fork_exit(c065d7d0,c6ff7000,f3ed6d38) at fork_exit+0xb8 fork_trampoline() at fork_trampoline+0x8 --- trap 0, eip = 0, esp = 0xf3ed6d70, ebp = 0 --- Tracing command usb pid 14 tid 100057 td 0xc6fcb000 sched_switch(c6fcb000,0,104,191,2b53c746,...) at sched_switch+0x36a mi_switch(104,0,c0ca6009,1eb,0,...) at mi_switch+0x200 sleepq_switch(c6fcb000,0,c0ca6009,260,c6fcb000,...) at sleepq_switch+0x15f sleepq_wait(c6fd0d0c,0,f3ebfcbc,1,0,...) at sleepq_wait+0x63 _cv_wait(c6fd0d0c,c6fd0dac,c0c8fcd6,6c,c6fd0d14,...) at _cv_wait+0x240 usb_process(c6fd0d04,f3ebfd38,c0c9cda4,343,c6f412a8,...) at usb_process+0x193 fork_exit(c07c3cc0,c6fd0d04,f3ebfd38) at fork_exit+0xb8 fork_trampoline() at fork_trampoline+0x8 --- trap 0, eip = 0, esp = 0xf3ebfd70, ebp = 0 --- Tracing command usb pid 14 tid 100056 td 0xc6fcb240 sched_switch(c6fcb240,0,104,191,40e4b0ae,...) at sched_switch+0x36a mi_switch(104,0,c0ca6009,1eb,0,...) at mi_switch+0x200 sleepq_switch(c6fcb240,0,c0ca6009,260,c6fcb240,...) at sleepq_switch+0x15f sleepq_wait(c6fd0cdc,0,f3ebccbc,1,0,...) at sleepq_wait+0x63 _cv_wait(c6fd0cdc,c6fd0dac,c0c8fcd6,6c,c6fd0ce4,...) at _cv_wait+0x240 usb_process(c6fd0cd4,f3ebcd38,c0c9cda4,343,c6f412a8,...) at usb_process+0x193 fork_exit(c07c3cc0,c6fd0cd4,f3ebcd38) at fork_exit+0xb8 fork_trampoline() at fork_trampoline+0x8 --- trap 0, eip = 0, esp = 0xf3ebcd70, ebp = 0 --- Tracing command usb pid 14 tid 100055 td 0xc6fcb480 sched_switch(c6fcb480,0,104,191,2aed92f3,...) at sched_switch+0x36a mi_switch(104,0,c0ca6009,1eb,0,...) at mi_switch+0x200 sleepq_switch(c6fcb480,0,c0ca6009,260,c6fcb480,...) at sleepq_switch+0x15f sleepq_wait(c6fd0cac,0,f3eb9cbc,1,0,...) at sleepq_wait+0x63 _cv_wait(c6fd0cac,c6fd0dac,c0c8fcd6,6c,c6fd0cb4,...) at _cv_wait+0x240 usb_process(c6fd0ca4,f3eb9d38,c0c9cda4,343,c6f412a8,...) at usb_process+0x193 fork_exit(c07c3cc0,c6fd0ca4,f3eb9d38) at fork_exit+0xb8 fork_trampoline() at fork_trampoline+0x8 --- trap 0, eip = 0, esp = 0xf3eb9d70, ebp = 0 --- Tracing command usb pid 14 tid 100054 td 0xc6fcb6c0 sched_switch(c6fcb6c0,0,104,191,2aed81d1,...) at sched_switch+0x36a mi_switch(104,0,c0ca6009,1eb,0,...) at mi_switch+0x200 sleepq_switch(c6fcb6c0,0,c0ca6009,260,c6fcb6c0,...) at sleepq_switch+0x15f sleepq_wait(c6fd0c7c,0,f3eb6cbc,1,0,...) at sleepq_wait+0x63 _cv_wait(c6fd0c7c,c6fd0dac,c0c8fcd6,6c,c6fd0c84,...) at _cv_wait+0x240 usb_process(c6fd0c74,f3eb6d38,c0c9cda4,343,c6f412a8,...) at usb_process+0x193 fork_exit(c07c3cc0,c6fd0c74,f3eb6d38) at fork_exit+0xb8 fork_trampoline() at fork_trampoline+0x8 --- trap 0, eip = 0, esp = 0xf3eb6d70, ebp = 0 --- Tracing command usb pid 14 tid 100052 td 0xc6fcbb40 sched_switch(c6fcbb40,0,104,191,2aed6b22,...) at sched_switch+0x36a mi_switch(104,0,c0ca6009,1eb,0,...) at mi_switch+0x200 sleepq_switch(c6fcbb40,0,c0ca6009,260,c6fcbb40,...) at sleepq_switch+0x15f sleepq_wait(c6fc6b5c,0,f3eaecbc,1,0,...) at sleepq_wait+0x63 _cv_wait(c6fc6b5c,c6fc6bfc,c0c8fcd6,6c,c6fc6b64,...) at _cv_wait+0x240 usb_process(c6fc6b54,f3eaed38,c0c9cda4,343,c6f412a8,...) at usb_process+0x193 fork_exit(c07c3cc0,c6fc6b54,f3eaed38) at fork_exit+0xb8 fork_trampoline() at fork_trampoline+0x8 --- trap 0, eip = 0, esp = 0xf3eaed70, ebp = 0 --- Tracing command usb pid 14 tid 100051 td 0xc6fcbd80 sched_switch(c6fcbd80,0,104,191,39477c08,...) at sched_switch+0x36a mi_switch(104,0,c0ca6009,1eb,0,...) at mi_switch+0x200 sleepq_switch(c6fcbd80,0,c0ca6009,260,c6fcbd80,...) at sleepq_switch+0x15f sleepq_wait(c6fc6b2c,0,f3eabcbc,1,0,...) at sleepq_wait+0x63 _cv_wait(c6fc6b2c,c6fc6bfc,c0c8fcd6,6c,c6fc6b34,...) at _cv_wait+0x240 usb_process(c6fc6b24,f3eabd38,c0c9cda4,343,c6f412a8,...) at usb_process+0x193 fork_exit(c07c3cc0,c6fc6b24,f3eabd38) at fork_exit+0xb8 fork_trampoline() at fork_trampoline+0x8 --- trap 0, eip = 0, esp = 0xf3eabd70, ebp = 0 --- Tracing command usb pid 14 tid 100050 td 0xc6f956c0 sched_switch(c6f956c0,0,104,191,2a88d74f,...) at sched_switch+0x36a mi_switch(104,0,c0ca6009,1eb,0,...) at mi_switch+0x200 sleepq_switch(c6f956c0,0,c0ca6009,260,c6f956c0,...) at sleepq_switch+0x15f sleepq_wait(c6fc6afc,0,f3ea8cbc,1,0,...) at sleepq_wait+0x63 _cv_wait(c6fc6afc,c6fc6bfc,c0c8fcd6,6c,c6fc6b04,...) at _cv_wait+0x240 usb_process(c6fc6af4,f3ea8d38,c0c9cda4,343,c6f412a8,...) at usb_process+0x193 fork_exit(c07c3cc0,c6fc6af4,f3ea8d38) at fork_exit+0xb8 fork_trampoline() at fork_trampoline+0x8 --- trap 0, eip = 0, esp = 0xf3ea8d70, ebp = 0 --- Tracing command usb pid 14 tid 100049 td 0xc6f95900 sched_switch(c6f95900,0,104,191,2a88c6fd,...) at sched_switch+0x36a mi_switch(104,0,c0ca6009,1eb,0,...) at mi_switch+0x200 sleepq_switch(c6f95900,0,c0ca6009,260,c6f95900,...) at sleepq_switch+0x15f sleepq_wait(c6fc6acc,0,f3ea5cbc,1,0,...) at sleepq_wait+0x63 _cv_wait(c6fc6acc,c6fc6bfc,c0c8fcd6,6c,c6fc6ad4,...) at _cv_wait+0x240 usb_process(c6fc6ac4,f3ea5d38,c0c9cda4,343,c6f412a8,...) at usb_process+0x193 fork_exit(c07c3cc0,c6fc6ac4,f3ea5d38) at fork_exit+0xb8 fork_trampoline() at fork_trampoline+0x8 --- trap 0, eip = 0, esp = 0xf3ea5d70, ebp = 0 --- Tracing command usb pid 14 tid 100048 td 0xc6f95b40 sched_switch(c6f95b40,0,104,191,2a88b3c6,...) at sched_switch+0x36a mi_switch(104,0,c0ca6009,1eb,0,...) at mi_switch+0x200 sleepq_switch(c6f95b40,0,c0ca6009,260,c6f95b40,...) at sleepq_switch+0x15f sleepq_wait(c6fc2b5c,0,f3ea1cbc,1,0,...) at sleepq_wait+0x63 _cv_wait(c6fc2b5c,c6fc2bfc,c0c8fcd6,6c,c6fc2b64,...) at _cv_wait+0x240 usb_process(c6fc2b54,f3ea1d38,c0c9cda4,343,c6f412a8,...) at usb_process+0x193 fork_exit(c07c3cc0,c6fc2b54,f3ea1d38) at fork_exit+0xb8 fork_trampoline() at fork_trampoline+0x8 --- trap 0, eip = 0, esp = 0xf3ea1d70, ebp = 0 --- Tracing command usb pid 14 tid 100047 td 0xc6f95d80 sched_switch(c6f95d80,0,104,191,39471c20,...) at sched_switch+0x36a mi_switch(104,0,c0ca6009,1eb,0,...) at mi_switch+0x200 sleepq_switch(c6f95d80,0,c0ca6009,260,c6f95d80,...) at sleepq_switch+0x15f sleepq_wait(c6fc2b2c,0,f3e9ecbc,1,0,...) at sleepq_wait+0x63 _cv_wait(c6fc2b2c,c6fc2bfc,c0c8fcd6,6c,c6fc2b34,...) at _cv_wait+0x240 usb_process(c6fc2b24,f3e9ed38,c0c9cda4,343,c6f412a8,...) at usb_process+0x193 fork_exit(c07c3cc0,c6fc2b24,f3e9ed38) at fork_exit+0xb8 fork_trampoline() at fork_trampoline+0x8 --- trap 0, eip = 0, esp = 0xf3e9ed70, ebp = 0 --- Tracing command usb pid 14 tid 100046 td 0xc6fb6000 sched_switch(c6fb6000,0,104,191,2a24c1b6,...) at sched_switch+0x36a mi_switch(104,0,c0ca6009,1eb,0,...) at mi_switch+0x200 sleepq_switch(c6fb6000,0,c0ca6009,260,c6fb6000,...) at sleepq_switch+0x15f sleepq_wait(c6fc2afc,0,f3e9bcbc,1,0,...) at sleepq_wait+0x63 _cv_wait(c6fc2afc,c6fc2bfc,c0c8fcd6,6c,c6fc2b04,...) at _cv_wait+0x240 usb_process(c6fc2af4,f3e9bd38,c0c9cda4,343,c6f412a8,...) at usb_process+0x193 fork_exit(c07c3cc0,c6fc2af4,f3e9bd38) at fork_exit+0xb8 fork_trampoline() at fork_trampoline+0x8 --- trap 0, eip = 0, esp = 0xf3e9bd70, ebp = 0 --- Tracing command usb pid 14 tid 100045 td 0xc6fb6240 sched_switch(c6fb6240,0,104,191,2a24b017,...) at sched_switch+0x36a mi_switch(104,0,c0ca6009,1eb,0,...) at mi_switch+0x200 sleepq_switch(c6fb6240,0,c0ca6009,260,c6fb6240,...) at sleepq_switch+0x15f sleepq_wait(c6fc2acc,0,f3e98cbc,1,0,...) at sleepq_wait+0x63 _cv_wait(c6fc2acc,c6fc2bfc,c0c8fcd6,6c,c6fc2ad4,...) at _cv_wait+0x240 usb_process(c6fc2ac4,f3e98d38,c0c9cda4,343,c6f412a8,...) at usb_process+0x193 fork_exit(c07c3cc0,c6fc2ac4,f3e98d38) at fork_exit+0xb8 fork_trampoline() at fork_trampoline+0x8 --- trap 0, eip = 0, esp = 0xf3e98d70, ebp = 0 --- Tracing command usb pid 14 tid 100044 td 0xc6fb6480 sched_switch(c6fb6480,0,104,191,2a249c24,...) at sched_switch+0x36a mi_switch(104,0,c0ca6009,1eb,0,...) at mi_switch+0x200 sleepq_switch(c6fb6480,0,c0ca6009,260,c6fb6480,...) at sleepq_switch+0x15f sleepq_wait(c6fb8b5c,0,f3e94cbc,1,0,...) at sleepq_wait+0x63 _cv_wait(c6fb8b5c,c6fb8bfc,c0c8fcd6,6c,c6fb8b64,...) at _cv_wait+0x240 usb_process(c6fb8b54,f3e94d38,c0c9cda4,343,c6f412a8,...) at usb_process+0x193 fork_exit(c07c3cc0,c6fb8b54,f3e94d38) at fork_exit+0xb8 fork_trampoline() at fork_trampoline+0x8 --- trap 0, eip = 0, esp = 0xf3e94d70, ebp = 0 --- Tracing command usb pid 14 tid 100043 td 0xc6fb66c0 sched_switch(c6fb66c0,0,104,191,3946bd27,...) at sched_switch+0x36a mi_switch(104,0,c0ca6009,1eb,0,...) at mi_switch+0x200 sleepq_switch(c6fb66c0,0,c0ca6009,260,c6fb66c0,...) at sleepq_switch+0x15f sleepq_wait(c6fb8b2c,0,f3e91cbc,1,0,...) at sleepq_wait+0x63 _cv_wait(c6fb8b2c,c6fb8bfc,c0c8fcd6,6c,c6fb8b34,...) at _cv_wait+0x240 usb_process(c6fb8b24,f3e91d38,c0c9cda4,343,c6f412a8,...) at usb_process+0x193 fork_exit(c07c3cc0,c6fb8b24,f3e91d38) at fork_exit+0xb8 fork_trampoline() at fork_trampoline+0x8 --- trap 0, eip = 0, esp = 0xf3e91d70, ebp = 0 --- Tracing command usb pid 14 tid 100042 td 0xc6fb6900 sched_switch(c6fb6900,0,104,191,29c0c053,...) at sched_switch+0x36a mi_switch(104,0,c0ca6009,1eb,0,...) at mi_switch+0x200 sleepq_switch(c6fb6900,0,c0ca6009,260,c6fb6900,...) at sleepq_switch+0x15f sleepq_wait(c6fb8afc,0,f3e8ecbc,1,0,...) at sleepq_wait+0x63 _cv_wait(c6fb8afc,c6fb8bfc,c0c8fcd6,6c,c6fb8b04,...) at _cv_wait+0x240 usb_process(c6fb8af4,f3e8ed38,c0c9cda4,343,c6f412a8,...) at usb_process+0x193 fork_exit(c07c3cc0,c6fb8af4,f3e8ed38) at fork_exit+0xb8 fork_trampoline() at fork_trampoline+0x8 --- trap 0, eip = 0, esp = 0xf3e8ed70, ebp = 0 --- Tracing command usb pid 14 tid 100041 td 0xc6fb6b40 sched_switch(c6fb6b40,0,104,191,29c0aeed,...) at sched_switch+0x36a mi_switch(104,0,c0ca6009,1eb,0,...) at mi_switch+0x200 sleepq_switch(c6fb6b40,0,c0ca6009,260,c6fb6b40,...) at sleepq_switch+0x15f sleepq_wait(c6fb8acc,0,f3e8bcbc,1,0,...) at sleepq_wait+0x63 _cv_wait(c6fb8acc,c6fb8bfc,c0c8fcd6,6c,c6fb8ad4,...) at _cv_wait+0x240 usb_process(c6fb8ac4,f3e8bd38,c0c9cda4,343,c6f412a8,...) at usb_process+0x193 fork_exit(c07c3cc0,c6fb8ac4,f3e8bd38) at fork_exit+0xb8 fork_trampoline() at fork_trampoline+0x8 --- trap 0, eip = 0, esp = 0xf3e8bd70, ebp = 0 --- Tracing command usb pid 14 tid 100039 td 0xc6fb7000 sched_switch(c6fb7000,0,104,191,29c09afe,...) at sched_switch+0x36a mi_switch(104,0,c0ca6009,1eb,0,...) at mi_switch+0x200 sleepq_switch(c6fb7000,0,c0ca6009,260,c6fb7000,...) at sleepq_switch+0x15f sleepq_wait(c6fb2b5c,0,f3e84cbc,1,0,...) at sleepq_wait+0x63 _cv_wait(c6fb2b5c,c6fb2bfc,c0c8fcd6,6c,c6fb2b64,...) at _cv_wait+0x240 usb_process(c6fb2b54,f3e84d38,c0c9cda4,343,c6f412a8,...) at usb_process+0x193 fork_exit(c07c3cc0,c6fb2b54,f3e84d38) at fork_exit+0xb8 fork_trampoline() at fork_trampoline+0x8 --- trap 0, eip = 0, esp = 0xf3e84d70, ebp = 0 --- Tracing command usb pid 14 tid 100038 td 0xc6f53d80 sched_switch(c6f53d80,0,104,191,39468859,...) at sched_switch+0x36a mi_switch(104,0,c0ca6009,1eb,0,...) at mi_switch+0x200 sleepq_switch(c6f53d80,0,c0ca6009,260,c6f53d80,...) at sleepq_switch+0x15f sleepq_wait(c6fb2b2c,0,f3e81cbc,1,0,...) at sleepq_wait+0x63 _cv_wait(c6fb2b2c,c6fb2bfc,c0c8fcd6,6c,c6fb2b34,...) at _cv_wait+0x240 usb_process(c6fb2b24,f3e81d38,c0c9cda4,343,c6f412a8,...) at usb_process+0x193 fork_exit(c07c3cc0,c6fb2b24,f3e81d38) at fork_exit+0xb8 fork_trampoline() at fork_trampoline+0x8 --- trap 0, eip = 0, esp = 0xf3e81d70, ebp = 0 --- Tracing command usb pid 14 tid 100037 td 0xc6f93000 sched_switch(c6f93000,0,104,191,295bec4c,...) at sched_switch+0x36a mi_switch(104,0,c0ca6009,1eb,0,...) at mi_switch+0x200 sleepq_switch(c6f93000,0,c0ca6009,260,c6f93000,...) at sleepq_switch+0x15f sleepq_wait(c6fb2afc,0,f3e7ecbc,1,0,...) at sleepq_wait+0x63 _cv_wait(c6fb2afc,c6fb2bfc,c0c8fcd6,6c,c6fb2b04,...) at _cv_wait+0x240 usb_process(c6fb2af4,f3e7ed38,c0c9cda4,343,c6f412a8,...) at usb_process+0x193 fork_exit(c07c3cc0,c6fb2af4,f3e7ed38) at fork_exit+0xb8 fork_trampoline() at fork_trampoline+0x8 --- trap 0, eip = 0, esp = 0xf3e7ed70, ebp = 0 --- Tracing command usb pid 14 tid 100036 td 0xc6f93240 sched_switch(c6f93240,0,104,191,295bd989,...) at sched_switch+0x36a mi_switch(104,0,c0ca6009,1eb,0,...) at mi_switch+0x200 sleepq_switch(c6f93240,0,c0ca6009,260,c6f93240,...) at sleepq_switch+0x15f sleepq_wait(c6fb2acc,0,f3e7bcbc,1,0,...) at sleepq_wait+0x63 _cv_wait(c6fb2acc,c6fb2bfc,c0c8fcd6,6c,c6fb2ad4,...) at _cv_wait+0x240 usb_process(c6fb2ac4,f3e7bd38,c0c9cda4,343,c6f412a8,...) at usb_process+0x193 fork_exit(c07c3cc0,c6fb2ac4,f3e7bd38) at fork_exit+0xb8 fork_trampoline() at fork_trampoline+0x8 --- trap 0, eip = 0, esp = 0xf3e7bd70, ebp = 0 --- Tracing command usb pid 14 tid 100034 td 0xc6f936c0 sched_switch(c6f936c0,0,104,191,295bc2d0,...) at sched_switch+0x36a mi_switch(104,0,c0ca6009,1eb,0,...) at mi_switch+0x200 sleepq_switch(c6f936c0,0,c0ca6009,260,c6f936c0,...) at sleepq_switch+0x15f sleepq_wait(c6fadb5c,0,f3e74cbc,1,0,...) at sleepq_wait+0x63 _cv_wait(c6fadb5c,c6fadbfc,c0c8fcd6,6c,c6fadb64,...) at _cv_wait+0x240 usb_process(c6fadb54,f3e74d38,c0c9cda4,343,c6f412a8,...) at usb_process+0x193 fork_exit(c07c3cc0,c6fadb54,f3e74d38) at fork_exit+0xb8 fork_trampoline() at fork_trampoline+0x8 --- trap 0, eip = 0, esp = 0xf3e74d70, ebp = 0 --- Tracing command usb pid 14 tid 100033 td 0xc6f93900 sched_switch(c6f93900,0,104,191,39462260,...) at sched_switch+0x36a mi_switch(104,0,c0ca6009,1eb,0,...) at mi_switch+0x200 sleepq_switch(c6f93900,0,c0ca6009,260,c6f93900,...) at sleepq_switch+0x15f sleepq_wait(c6fadb2c,0,f3e71cbc,1,0,...) at sleepq_wait+0x63 _cv_wait(c6fadb2c,c6fadbfc,c0c8fcd6,6c,c6fadb34,...) at _cv_wait+0x240 usb_process(c6fadb24,f3e71d38,c0c9cda4,343,c6f412a8,...) at usb_process+0x193 fork_exit(c07c3cc0,c6fadb24,f3e71d38) at fork_exit+0xb8 fork_trampoline() at fork_trampoline+0x8 --- trap 0, eip = 0, esp = 0xf3e71d70, ebp = 0 --- Tracing command usb pid 14 tid 100032 td 0xc6f93b40 sched_switch(c6f93b40,0,104,191,28f13a27,...) at sched_switch+0x36a mi_switch(104,0,c0ca6009,1eb,0,...) at mi_switch+0x200 sleepq_switch(c6f93b40,0,c0ca6009,260,c6f93b40,...) at sleepq_switch+0x15f sleepq_wait(c6fadafc,0,f3e6ecbc,1,0,...) at sleepq_wait+0x63 _cv_wait(c6fadafc,c6fadbfc,c0c8fcd6,6c,c6fadb04,...) at _cv_wait+0x240 usb_process(c6fadaf4,f3e6ed38,c0c9cda4,343,c6f412a8,...) at usb_process+0x193 fork_exit(c07c3cc0,c6fadaf4,f3e6ed38) at fork_exit+0xb8 fork_trampoline() at fork_trampoline+0x8 --- trap 0, eip = 0, esp = 0xf3e6ed70, ebp = 0 --- Tracing command usb pid 14 tid 100031 td 0xc6f93d80 sched_switch(c6f93d80,0,104,191,28f127b2,...) at sched_switch+0x36a mi_switch(104,0,c0ca6009,1eb,0,...) at mi_switch+0x200 sleepq_switch(c6f93d80,0,c0ca6009,260,c6f93d80,...) at sleepq_switch+0x15f sleepq_wait(c6fadacc,0,f3e6bcbc,1,0,...) at sleepq_wait+0x63 _cv_wait(c6fadacc,c6fadbfc,c0c8fcd6,6c,c6fadad4,...) at _cv_wait+0x240 usb_process(c6fadac4,f3e6bd38,c0c9cda4,343,c6f412a8,...) at usb_process+0x193 fork_exit(c07c3cc0,c6fadac4,f3e6bd38) at fork_exit+0xb8 fork_trampoline() at fork_trampoline+0x8 --- trap 0, eip = 0, esp = 0xf3e6bd70, ebp = 0 --- Tracing command yarrow pid 13 tid 100017 td 0xc6d7d240 sched_switch(c6d7d240,0,104,191,42e085a0,...) at sched_switch+0x36a mi_switch(104,0,c0ca6009,1eb,0,...) at mi_switch+0x200 sleepq_switch(c6d7d240,0,c0ca6009,283,2,...) at sleepq_switch+0x15f sleepq_timedwait(c0dff844,0,c0c97043,2,0,...) at sleepq_timedwait+0x6b _sleep(c0dff844,0,0,c0c97043,64,...) at _sleep+0x339 pause(c0c97043,64,c0c839ce,111,0,...) at pause+0x47 random_kthread(0,c6b55d38,c0c9cda4,343,c6f41550,...) at random_kthread+0x1ef fork_exit(c073aa70,0,c6b55d38) at fork_exit+0xb8 fork_trampoline() at fork_trampoline+0x8 --- trap 0, eip = 0, esp = 0xc6b55d70, ebp = 0 --- Tracing command g_down pid 4 tid 100015 td 0xc6d7d6c0 sched_switch(c6d7d6c0,0,104,191,4146aa93,...) at sched_switch+0x36a mi_switch(104,0,c0ca6009,1eb,4c,...) at mi_switch+0x200 sleepq_switch(c6d7d6c0,0,c0ca6009,260,0,...) at sleepq_switch+0x15f sleepq_wait(c0dfd5e4,4c,c0c97043,0,0,...) at sleepq_wait+0x63 _sleep(c0dfd5e4,c0dfd548,24c,c0c97043,0,...) at _sleep+0x36b g_io_schedule_down(c6d7d6c0,0,c0c9874f,74,0,...) at g_io_schedule_down+0x56 g_down_procbody(0,c6b4fd38,c0c9cda4,343,c6d79000,...) at g_down_procbody+0x8d fork_exit(c08308b0,0,c6b4fd38) at fork_exit+0xb8 fork_trampoline() at fork_trampoline+0x8 --- trap 0, eip = 0, esp = 0xc6b4fd70, ebp = 0 --- Tracing command g_up pid 3 tid 100014 td 0xc6d7d900 sched_switch(c6d7d900,0,104,191,4155b6a0,...) at sched_switch+0x36a mi_switch(104,0,c0ca6009,1eb,4c,...) at mi_switch+0x200 sleepq_switch(c6d7d900,0,c0ca6009,260,0,...) at sleepq_switch+0x15f sleepq_wait(c0dfd5e0,4c,c0c97043,0,0,...) at sleepq_wait+0x63 _sleep(c0dfd5e0,c0dfd568,24c,c0c97043,0,...) at _sleep+0x36b g_io_schedule_up(c6d7d900,0,c0c9874f,5d,0,...) at g_io_schedule_up+0x11e g_up_procbody(0,c6b4cd38,c0c9cda4,343,c6d792a8,...) at g_up_procbody+0x8d fork_exit(c0830940,0,c6b4cd38) at fork_exit+0xb8 fork_trampoline() at fork_trampoline+0x8 --- trap 0, eip = 0, esp = 0xc6b4cd70, ebp = 0 --- Tracing command g_event pid 2 tid 100013 td 0xc6d7db40 sched_switch(c6d7db40,0,104,191,405a7744,...) at sched_switch+0x36a mi_switch(104,0,c0ca6009,1eb,4c,...) at mi_switch+0x200 sleepq_switch(c6d7db40,0,c0ca6009,283,0,...) at sleepq_switch+0x15f sleepq_timedwait(c0dfd5d8,4c,c0c97043,0,0,...) at sleepq_timedwait+0x6b _sleep(c0dfd5d8,0,4c,c0c97043,64,...) at _sleep+0x339 g_event_procbody(0,c6b49d38,c0c9cda4,343,c6d79550,...) at g_event_procbody+0xcb fork_exit(c08309d0,0,c6b49d38) at fork_exit+0xb8 fork_trampoline() at fork_trampoline+0x8 --- trap 0, eip = 0, esp = 0xc6b49d70, ebp = 0 --- Tracing command intr pid 12 tid 100065 td 0xc70f6b40 fork_trampoline() at fork_trampoline Tracing command intr pid 12 tid 100064 td 0xc70f6d80 sched_switch(c70f6d80,0,109,191,28edcb61,...) at sched_switch+0x36a mi_switch(109,0,c0c9d023,52d,c6d7f2f0,...) at mi_switch+0x200 ithread_loop(c70ef190,f3ee9d38,c0c9cda4,343,c6d797f8,...) at ithread_loop+0x1f6 fork_exit(c086bf10,c70ef190,f3ee9d38) at fork_exit+0xb8 fork_trampoline() at fork_trampoline+0x8 --- trap 0, eip = 0, esp = 0xf3ee9d70, ebp = 0 --- Tracing command intr pid 12 tid 100062 td 0xc6fb7480 sched_switch(c6fb7480,0,109,191,3a9364ca,...) at sched_switch+0x36a mi_switch(109,0,c0c9d023,52d,c70004f0,...) at mi_switch+0x200 ithread_loop(c70e3a90,f3ed9d38,c0c9cda4,343,c6d797f8,...) at ithread_loop+0x1f6 fork_exit(c086bf10,c70e3a90,f3ed9d38) at fork_exit+0xb8 fork_trampoline() at fork_trampoline+0x8 --- trap 0, eip = 0, esp = 0xf3ed9d70, ebp = 0 --- Tracing command intr pid 12 tid 100059 td 0xc6fb7b40 sched_switch(c6fb7b40,0,109,191,28d4e8fe,...) at sched_switch+0x36a mi_switch(109,0,c0c9d023,52d,c6d7e870,...) at mi_switch+0x200 ithread_loop(c6fd2630,f3ecdd38,c0c9cda4,343,c6d797f8,...) at ithread_loop+0x1f6 fork_exit(c086bf10,c6fd2630,f3ecdd38) at fork_exit+0xb8 fork_trampoline() at fork_trampoline+0x8 --- trap 0, eip = 0, esp = 0xf3ecdd70, ebp = 0 --- Tracing command intr pid 12 tid 100058 td 0xc6fb7d80 sched_switch(c6fb7d80,0,109,191,986bddb5,...) at sched_switch+0x36a mi_switch(109,0,c0c9d023,52d,c6d7eb70,...) at mi_switch+0x200 ithread_loop(c6fa9bb0,f3ec5d38,c0c9cda4,343,c6d797f8,...) at ithread_loop+0x1f6 fork_exit(c086bf10,c6fa9bb0,f3ec5d38) at fork_exit+0xb8 fork_trampoline() at fork_trampoline+0x8 --- trap 0, eip = 0, esp = 0xf3ec5d70, ebp = 0 --- Tracing command intr pid 12 tid 100053 td 0xc6fcb900 fork_trampoline() at fork_trampoline Tracing command intr pid 12 tid 100040 td 0xc6fb6d80 sched_switch(c6fb6d80,0,109,191,4d586d31,...) at sched_switch+0x36a mi_switch(109,0,c0c9d023,52d,c6d7e970,...) at mi_switch+0x200 ithread_loop(c6fa9670,f3e88d38,c0c9cda4,343,c6d797f8,...) at ithread_loop+0x1f6 fork_exit(c086bf10,c6fa9670,f3e88d38) at fork_exit+0xb8 fork_trampoline() at fork_trampoline+0x8 --- trap 0, eip = 0, esp = 0xf3e88d70, ebp = 0 --- Tracing command intr pid 12 tid 100035 td 0xc6f93480 sched_switch(c6f93480,0,109,191,4c99951f,...) at sched_switch+0x36a mi_switch(109,0,c0c9d023,52d,c6d7e9f0,...) at mi_switch+0x200 ithread_loop(c6fa4a50,f3e78d38,c0c9cda4,343,c6d797f8,...) at ithread_loop+0x1f6 fork_exit(c086bf10,c6fa4a50,f3e78d38) at fork_exit+0xb8 fork_trampoline() at fork_trampoline+0x8 --- trap 0, eip = 0, esp = 0xf3e78d70, ebp = 0 --- Tracing command intr pid 12 tid 100030 td 0xc6f95000 sched_switch(c6f95000,0,109,191,2549ffc5,...) at sched_switch+0x36a mi_switch(109,0,c0c9d023,52d,c6d7ea70,...) at mi_switch+0x200 ithread_loop(c6fa4830,f3e68d38,c0c9cda4,343,c6d797f8,...) at ithread_loop+0x1f6 fork_exit(c086bf10,c6fa4830,f3e68d38) at fork_exit+0xb8 fork_trampoline() at fork_trampoline+0x8 --- trap 0, eip = 0, esp = 0xf3e68d70, ebp = 0 --- Tracing command intr pid 12 tid 100029 td 0xc6f95240 sched_switch(c6f95240,0,109,191,4153f962,...) at sched_switch+0x36a mi_switch(109,0,c0c9d023,52d,c6d7e770,...) at mi_switch+0x200 ithread_loop(c6fa4030,f3d59d38,c0c9cda4,343,c6d797f8,...) at ithread_loop+0x1f6 fork_exit(c086bf10,c6fa4030,f3d59d38) at fork_exit+0xb8 fork_trampoline() at fork_trampoline+0x8 --- trap 0, eip = 0, esp = 0xf3d59d70, ebp = 0 --- Tracing command intr pid 12 tid 100028 td 0xc6f95480 sched_switch(c6f95480,0,109,191,a5173591,...) at sched_switch+0x36a mi_switch(109,0,c0c9d023,52d,c6f7f9f0,...) at mi_switch+0x200 ithread_loop(c6f8d9a0,c6ba4d38,c0c9cda4,343,c6d797f8,...) at ithread_loop+0x1f6 fork_exit(c086bf10,c6f8d9a0,c6ba4d38) at fork_exit+0xb8 fork_trampoline() at fork_trampoline+0x8 --- trap 0, eip = 0, esp = 0xc6ba4d70, ebp = 0 --- Tracing command intr pid 12 tid 100027 td 0xc6dc16c0 sched_switch(c6dc16c0,0,109,191,28ee6abc,...) at sched_switch+0x36a mi_switch(109,0,c0c9d023,52d,c6d7edf0,...) at mi_switch+0x200 ithread_loop(c6d78600,c6b9ad38,c0c9cda4,343,c6d797f8,...) at ithread_loop+0x1f6 fork_exit(c086bf10,c6d78600,c6b9ad38) at fork_exit+0xb8 fork_trampoline() at fork_trampoline+0x8 --- trap 0, eip = 0, esp = 0xc6b9ad70, ebp = 0 --- Tracing command intr pid 12 tid 100026 td 0xc6dc1900 sched_switch(c6dc1900,0,109,191,2706e6b1,...) at sched_switch+0x36a mi_switch(109,0,c0c9d023,52d,c6d7f7f0,...) at mi_switch+0x200 ithread_loop(c6d784e0,c6b70d38,c0c9cda4,343,c6d797f8,...) at ithread_loop+0x1f6 fork_exit(c086bf10,c6d784e0,c6b70d38) at fork_exit+0xb8 fork_trampoline() at fork_trampoline+0x8 --- trap 0, eip = 0, esp = 0xc6b70d70, ebp = 0 --- Tracing command intr pid 12 tid 100024 td 0xc6dc1d80 sched_switch(c6dc1d80,0,109,191,41c12c48,...) at sched_switch+0x36a mi_switch(109,0,c0c9d023,52d,c6d7f870,...) at mi_switch+0x200 ithread_loop(c6d783b0,c6b6ad38,c0c9cda4,343,c6d797f8,...) at ithread_loop+0x1f6 fork_exit(c086bf10,c6d783b0,c6b6ad38) at fork_exit+0xb8 fork_trampoline() at fork_trampoline+0x8 --- trap 0, eip = 0, esp = 0xc6b6ad70, ebp = 0 --- Tracing command intr pid 12 tid 100020 td 0xc6f536c0 sched_switch(c6f536c0,0,109,191,a1ae69ef,...) at sched_switch+0x36a mi_switch(109,0,c0c9d023,52d,c6d7faf0,...) at mi_switch+0x200 ithread_loop(c6d29a20,c6b5ed38,c0c9cda4,343,c6d797f8,...) at ithread_loop+0x1f6 fork_exit(c086bf10,c6d29a20,c6b5ed38) at fork_exit+0xb8 fork_trampoline() at fork_trampoline+0x8 --- trap 0, eip = 0, esp = 0xc6b5ed70, ebp = 0 --- Tracing command intr pid 12 tid 100019 td 0xc6f53900 fork_trampoline() at fork_trampoline Tracing command intr pid 12 tid 100012 td 0xc6d7dd80 fork_trampoline() at fork_trampoline Tracing command intr pid 12 tid 100011 td 0xc6dc1000 sched_switch(c6dc1000,0,109,191,42dc4c2f,...) at sched_switch+0x36a mi_switch(109,0,c0c9d023,52d,c6d7e0f0,...) at mi_switch+0x200 ithread_loop(c6d781c0,c6b43d38,c0c9cda4,343,c6d797f8,...) at ithread_loop+0x1f6 fork_exit(c086bf10,c6d781c0,c6b43d38) at fork_exit+0xb8 fork_trampoline() at fork_trampoline+0x8 --- trap 0, eip = 0, esp = 0xc6b43d70, ebp = 0 --- Tracing command intr pid 12 tid 100010 td 0xc6dc1240 sched_switch(c6dc1240,0,109,191,2880836b,...) at sched_switch+0x36a mi_switch(109,0,c0c9d023,52d,c6d7e170,...) at mi_switch+0x200 ithread_loop(c6d781d0,c6b40d38,c0c9cda4,343,c6d797f8,...) at ithread_loop+0x1f6 fork_exit(c086bf10,c6d781d0,c6b40d38) at fork_exit+0xb8 fork_trampoline() at fork_trampoline+0x8 --- trap 0, eip = 0, esp = 0xc6b40d70, ebp = 0 --- Tracing command intr pid 12 tid 100009 td 0xc6dc1480 sched_switch(c6dc1480,0,109,191,58ce388,...) at sched_switch+0x36a mi_switch(109,0,c0c9d023,52d,c6d7e570,...) at mi_switch+0x200 ithread_loop(c6d781e0,c6b3dd38,c0c9cda4,343,c6d797f8,...) at ithread_loop+0x1f6 fork_exit(c086bf10,c6d781e0,c6b3dd38) at fork_exit+0xb8 fork_trampoline() at fork_trampoline+0x8 --- trap 0, eip = 0, esp = 0xc6b3dd70, ebp = 0 --- Tracing command intr pid 12 tid 100008 td 0xc6d7b000 sched_switch(c6d7b000,0,109,191,44ece6ed,...) at sched_switch+0x36a mi_switch(109,0,c0c9d023,52d,c6d7e5f0,...) at mi_switch+0x200 ithread_loop(c6d781f0,c6b3ad38,c0c9cda4,343,c6d797f8,...) at ithread_loop+0x1f6 fork_exit(c086bf10,c6d781f0,c6b3ad38) at fork_exit+0xb8 fork_trampoline() at fork_trampoline+0x8 --- trap 0, eip = 0, esp = 0xc6b3ad70, ebp = 0 --- Tracing command intr pid 12 tid 100007 td 0xc6d7b240 sched_switch(c6d7b240,0,109,191,10cda2c7,...) at sched_switch+0x36a mi_switch(109,0,c0c9d023,52d,c6d7e670,...) at mi_switch+0x200 ithread_loop(c6d78200,c6b37d38,c0c9cda4,343,c6d797f8,...) at ithread_loop+0x1f6 fork_exit(c086bf10,c6d78200,c6b37d38) at fork_exit+0xb8 fork_trampoline() at fork_trampoline+0x8 --- trap 0, eip = 0, esp = 0xc6b37d70, ebp = 0 --- Tracing command idle pid 11 tid 100006 td 0xc6d7b480 sched_switch(c6d7b480,0,60c,18c,4155ad5a,...) at sched_switch+0x36a mi_switch(60c,0,c0ca35ee,806,0,...) at mi_switch+0x200 sched_preempt(c6d7b480,0,1f4,c6b33c6c,c0bab30e,...) at sched_preempt+0x9f ipi_bitmap_handler(8,28,28,c6e95418,c6e95400,...) at ipi_bitmap_handler+0x34 Xipi_intr_bitmap_handler() at Xipi_intr_bitmap_handler+0x2e --- interrupt, eip = 0xc0b9f405, esp = 0xc6b33c6c, ebp = 0xc6b33c6c --- acpi_cpu_c1(0,c6b33cd4,0,ffffffff,c6b33cb4,...) at acpi_cpu_c1+0x5 acpi_cpu_idle(2710,c0e033c0,c6b33cb4,c0bb6bab,1,...) at acpi_cpu_idle+0x11c cpu_idle_amdc1e(1,c6b33cf8,c08b83fe,1,c6b33cd4,...) at cpu_idle_amdc1e+0x56 cpu_idle(1,c6b33cd4,c0ca35ee,9fa,c6d7b480,...) at cpu_idle+0x1b sched_idletd(0,c6b33d38,c0c9cda4,343,c6d79aa0,...) at sched_idletd+0x23e fork_exit(c08b81c0,0,c6b33d38) at fork_exit+0xb8 fork_trampoline() at fork_trampoline+0x8 --- trap 0, eip = 0, esp = 0xc6b33d70, ebp = 0 --- Tracing command idle pid 11 tid 100005 td 0xc6d7b6c0 cpustop_handler(2,c6b30c20,c0bc8d26,c0dffa5c,c6b30bb4,...) at cpustop_handler+0x32 ipi_nmi_handler(c0dffa5c,c6b30bb4,c0882d04,c0dffa5c,c6d79aa0,...) at ipi_nmi_handler+0x2f trap(c6b30c2c) at trap+0x36 calltrap() at calltrap+0x6 --- trap 0x13, eip = 0xc0b9f405, esp = 0xc6b30c6c, ebp = 0xc6b30c6c --- acpi_cpu_c1(30,c6b30cd4,1,ffffffff,c6b30cb4,...) at acpi_cpu_c1+0x5 acpi_cpu_idle(ffffffff,0,c6b30cb4,c0bb6bab,0,...) at acpi_cpu_idle+0x11c cpu_idle_amdc1e(0,c6b30cf8,c08b83fe,0,c6b30cd4,...) at cpu_idle_amdc1e+0x56 cpu_idle(0,c6b30cd4,c0ca35ee,9fa,c6d7b6c0,...) at cpu_idle+0x1b sched_idletd(0,c6b30d38,c0c9cda4,343,c6d79aa0,...) at sched_idletd+0x23e fork_exit(c08b81c0,0,c6b30d38) at fork_exit+0xb8 fork_trampoline() at fork_trampoline+0x8 --- trap 0, eip = 0, esp = 0xc6b30d70, ebp = 0 --- Tracing command idle pid 11 tid 100004 td 0xc6d7b900 cpustop_handler(4,c6b2dc20,c0bc8d26,c0dffa98,c6b2dbb4,...) at cpustop_handler+0x32 ipi_nmi_handler(c0dffa98,c6b2dbb4,c0882d04,c0dffa98,c6d79aa0,...) at ipi_nmi_handler+0x2f trap(c6b2dc2c) at trap+0x36 calltrap() at calltrap+0x6 --- trap 0x13, eip = 0xc0b9f405, esp = 0xc6b2dc6c, ebp = 0xc6b2dc6c --- acpi_cpu_c1(28,c6b2dcd4,2,ffffffff,c6b2dcb4,...) at acpi_cpu_c1+0x5 acpi_cpu_idle(ffffffff,0,c6b2dcb4,c0bb6bab,0,...) at acpi_cpu_idle+0x11c cpu_idle_amdc1e(0,c6b2dcf8,c08b83fe,0,c6b2dcd4,...) at cpu_idle_amdc1e+0x56 cpu_idle(0,c6b2dcd4,c0ca35ee,9fa,c6d7b900,...) at cpu_idle+0x1b sched_idletd(0,c6b2dd38,c0c9cda4,343,c6d79aa0,...) at sched_idletd+0x23e fork_exit(c08b81c0,0,c6b2dd38) at fork_exit+0xb8 fork_trampoline() at fork_trampoline+0x8 --- trap 0, eip = 0, esp = 0xc6b2dd70, ebp = 0 --- Tracing command idle pid 11 tid 100003 td 0xc6d7bb40 cpustop_handler(8,c6b2ac20,c0bc8d26,c0dffad4,c6b2abb4,...) at cpustop_handler+0x32 ipi_nmi_handler(c0dffad4,c6b2abb4,c0882d04,c0dffad4,c6d79aa0,...) at ipi_nmi_handler+0x2f trap(c6b2ac2c) at trap+0x36 calltrap() at calltrap+0x6 --- trap 0x13, eip = 0xc0b9f405, esp = 0xc6b2ac6c, ebp = 0xc6b2ac6c --- acpi_cpu_c1(c0bab1ff,c6b2acd4,3,ffffffff,c6b2acb4,...) at acpi_cpu_c1+0x5 acpi_cpu_idle(ffffffff,0,c6b2acb4,c0bb6bab,0,...) at acpi_cpu_idle+0x11c cpu_idle_amdc1e(0,c6b2acf8,c08b83fe,0,c6b2acd4,...) at cpu_idle_amdc1e+0x56 cpu_idle(0,c6b2acd4,c0ca35ee,9fa,c6d7bb40,...) at cpu_idle+0x1b sched_idletd(0,c6b2ad38,c0c9cda4,343,c6d79aa0,...) at sched_idletd+0x23e fork_exit(c08b81c0,0,c6b2ad38) at fork_exit+0xb8 fork_trampoline() at fork_trampoline+0x8 --- trap 0, eip = 0, esp = 0xc6b2ad70, ebp = 0 --- Tracing command init pid 1 tid 100002 td 0xc6d7bd80 sched_switch(c6d7bd80,0,104,191,3de7b118,...) at sched_switch+0x36a mi_switch(104,0,c0ca6009,1eb,5c,...) at mi_switch+0x200 sleepq_switch(c6d7bd80,0,c0ca6009,1a0,5c,...) at sleepq_switch+0x15f sleepq_catch_signals(c0ca6009,160,0,100,100,...) at sleepq_catch_signals+0xb7 sleepq_wait_sig(c6d79d48,5c,c0ca8802,100,0,...) at sleepq_wait_sig+0x17 _sleep(c6d79d48,c6d79dd0,15c,c0ca8802,0,...) at _sleep+0x354 kern_wait(c6d7bd80,ffffffff,c6b26c74,0,0,...) at kern_wait+0xb76 wait4(c6d7bd80,c6b26cf8,c,c6d7bd80,c6d79d48,...) at wait4+0x3b syscall(c6b26d38) at syscall+0x230 Xint0x80_syscall() at Xint0x80_syscall+0x20 --- syscall (7, FreeBSD ELF32, wait4), eip = 0x805523f, esp = 0xbfbfe90c, ebp = 0xbfbfe928 --- Tracing command audit pid 10 tid 100001 td 0xc6d7d000 sched_switch(c6d7d000,0,104,191,28eed290,...) at sched_switch+0x36a mi_switch(104,0,c0ca6009,1eb,0,...) at mi_switch+0x200 sleepq_switch(c6d7d000,0,c0ca6009,260,c6d7d000,...) at sleepq_switch+0x15f sleepq_wait(c0f77140,0,c6b23c9c,1,0,...) at sleepq_wait+0x63 _cv_wait(c0f77140,c0f77124,c0cc6133,191,0,...) at _cv_wait+0x240 audit_worker(0,c6b23d38,c0c9cda4,343,c6d7a000,...) at audit_worker+0x84 fork_exit(c0a96d10,0,c6b23d38) at fork_exit+0xb8 fork_trampoline() at fork_trampoline+0x8 --- trap 0, eip = 0, esp = 0xc6b23d70, ebp = 0 --- Tracing command kernel pid 0 tid 100066 td 0xc70f6900 sched_switch(c70f6900,0,104,191,144252c2,...) at sched_switch+0x36a mi_switch(104,0,c0ca6009,1eb,0,...) at mi_switch+0x200 sleepq_switch(c70f6900,0,c0ca6009,283,2,...) at sleepq_switch+0x15f sleepq_timedwait(c0dff844,0,c0c9b369,2,0,...) at sleepq_timedwait+0x6b _sleep(c0dff844,0,0,c0c9b369,bb8,...) at _sleep+0x339 pause(c0c9b369,bb8,100,fe,c0dfd748,...) at pause+0x47 deadlkres(0,f3eefd38,c0c9cda4,343,c0dfd6c0,...) at deadlkres+0x318 fork_exit(c084fc00,0,f3eefd38) at fork_exit+0xb8 fork_trampoline() at fork_trampoline+0x8 --- trap 0, eip = 0, esp = 0xf3eefd70, ebp = 0 --- Tracing command kernel pid 0 tid 100060 td 0xc6fb7900 sched_switch(c6fb7900,0,104,191,3b6dad50,...) at sched_switch+0x36a mi_switch(104,0,c0ca6009,1eb,0,...) at mi_switch+0x200 sleepq_switch(c6fb7900,0,c0ca6009,260,c6fb7900,...) at sleepq_switch+0x15f sleepq_wait(c6ff6800,0,c0ca25e7,c0c97043,0,...) at sleepq_wait+0x63 msleep_spin(c6ff6800,c6ff6818,c0c97043,0,c0ca0183,...) at msleep_spin+0x21d taskqueue_thread_loop(c6ffb49c,f3ed3d38,c0c9cda4,343,c0dfd6c0,...) at taskqueue_thread_loop+0x94 fork_exit(c08d1bd0,c6ffb49c,f3ed3d38) at fork_exit+0xb8 fork_trampoline() at fork_trampoline+0x8 --- trap 0, eip = 0, esp = 0xf3ed3d70, ebp = 0 --- Tracing command kernel pid 0 tid 100025 td 0xc6dc1b40 sched_switch(c6dc1b40,0,104,191,95bcdeab,...) at sched_switch+0x36a mi_switch(104,0,c0ca6009,1eb,0,...) at mi_switch+0x200 sleepq_switch(c6dc1b40,0,c0ca6009,260,0,...) at sleepq_switch+0x15f sleepq_wait(c6f3f100,0,c0c97043,0,0,...) at sleepq_wait+0x63 _sleep(c6f3f100,c6f3f118,0,c0c97043,0,...) at _sleep+0x36b taskqueue_thread_loop(c0dfdf58,c6b6dd38,c0c9cda4,343,c0dfd6c0,...) at taskqueue_thread_loop+0xba fork_exit(c08d1bd0,c0dfdf58,c6b6dd38) at fork_exit+0xb8 fork_trampoline() at fork_trampoline+0x8 --- trap 0, eip = 0, esp = 0xc6b6dd70, ebp = 0 --- Tracing command kernel pid 0 tid 100023 td 0xc6f53000 sched_switch(c6f53000,0,104,191,95bccc01,...) at sched_switch+0x36a mi_switch(104,0,c0ca6009,1eb,0,...) at mi_switch+0x200 sleepq_switch(c6f53000,0,c0ca6009,260,c6f53000,...) at sleepq_switch+0x15f sleepq_wait(c6f3f240,0,c0ca25e7,c0c97043,0,...) at sleepq_wait+0x63 msleep_spin(c6f3f240,c6f3f258,c0c97043,0,c0ca0183,...) at msleep_spin+0x21d taskqueue_thread_loop(c0dceac0,c6b67d38,c0c9cda4,343,c0dfd6c0,...) at taskqueue_thread_loop+0x94 fork_exit(c08d1bd0,c0dceac0,c6b67d38) at fork_exit+0xb8 fork_trampoline() at fork_trampoline+0x8 --- trap 0, eip = 0, esp = 0xc6b67d70, ebp = 0 --- Tracing command kernel pid 0 tid 100022 td 0xc6f53240 sched_switch(c6f53240,0,104,191,95bcbef6,...) at sched_switch+0x36a mi_switch(104,0,c0ca6009,1eb,0,...) at mi_switch+0x200 sleepq_switch(c6f53240,0,c0ca6009,260,c6f53240,...) at sleepq_switch+0x15f sleepq_wait(c6f3f240,0,c0ca25e7,c0c97043,0,...) at sleepq_wait+0x63 msleep_spin(c6f3f240,c6f3f258,c0c97043,0,c0ca0183,...) at msleep_spin+0x21d taskqueue_thread_loop(c0dceac0,c6b64d38,c0c9cda4,343,c0dfd6c0,...) at taskqueue_thread_loop+0x94 fork_exit(c08d1bd0,c0dceac0,c6b64d38) at fork_exit+0xb8 fork_trampoline() at fork_trampoline+0x8 --- trap 0, eip = 0, esp = 0xc6b64d70, ebp = 0 --- Tracing command kernel pid 0 tid 100021 td 0xc6f53480 sched_switch(c6f53480,0,104,191,95bcb072,...) at sched_switch+0x36a mi_switch(104,0,c0ca6009,1eb,0,...) at mi_switch+0x200 sleepq_switch(c6f53480,0,c0ca6009,260,c6f53480,...) at sleepq_switch+0x15f sleepq_wait(c6f3f240,0,c0ca25e7,c0c97043,0,...) at sleepq_wait+0x63 msleep_spin(c6f3f240,c6f3f258,c0c97043,0,c0ca0183,...) at msleep_spin+0x21d taskqueue_thread_loop(c0dceac0,c6b61d38,c0c9cda4,343,c0dfd6c0,...) at taskqueue_thread_loop+0x94 fork_exit(c08d1bd0,c0dceac0,c6b61d38) at fork_exit+0xb8 fork_trampoline() at fork_trampoline+0x8 --- trap 0, eip = 0, esp = 0xc6b61d70, ebp = 0 --- Tracing command kernel pid 0 tid 100018 td 0xc6f53b40 sched_switch(c6f53b40,0,104,191,41c294fc,...) at sched_switch+0x36a mi_switch(104,0,c0ca6009,1eb,0,...) at mi_switch+0x200 sleepq_switch(c6f53b40,0,c0ca6009,260,0,...) at sleepq_switch+0x15f sleepq_wait(c6f3f540,0,c0c97043,0,0,...) at sleepq_wait+0x63 _sleep(c6f3f540,c6f3f558,0,c0c97043,0,...) at _sleep+0x36b taskqueue_thread_loop(c0e11e48,c6b58d38,c0c9cda4,343,c0dfd6c0,...) at taskqueue_thread_loop+0xba fork_exit(c08d1bd0,c0e11e48,c6b58d38) at fork_exit+0xb8 fork_trampoline() at fork_trampoline+0x8 --- trap 0, eip = 0, esp = 0xc6b58d70, ebp = 0 --- Tracing command kernel pid 0 tid 100016 td 0xc6d7d480 sched_switch(c6d7d480,0,104,191,47a46e81,...) at sched_switch+0x36a mi_switch(104,0,c0ca6009,1eb,0,...) at mi_switch+0x200 sleepq_switch(c6d7d480,0,c0ca6009,260,0,...) at sleepq_switch+0x15f sleepq_wait(c6d60e40,0,c0c97043,0,0,...) at sleepq_wait+0x63 _sleep(c6d60e40,c6d60e58,0,c0c97043,0,...) at _sleep+0x36b taskqueue_thread_loop(c0e108e0,c6b52d38,c0c9cda4,343,c0dfd6c0,...) at taskqueue_thread_loop+0xba fork_exit(c08d1bd0,c0e108e0,c6b52d38) at fork_exit+0xb8 fork_trampoline() at fork_trampoline+0x8 --- trap 0, eip = 0, esp = 0xc6b52d70, ebp = 0 --- Tracing command kernel pid 0 tid 100000 td 0xc0dfd970 sched_switch(c0dfd970,0,104,191,ce7860f2,...) at sched_switch+0x36a mi_switch(104,0,c0ca6009,1eb,44,...) at mi_switch+0x200 sleepq_switch(c0dfd970,0,c0ca6009,283,0,...) at sleepq_switch+0x15f sleepq_timedwait(c0dfd6c0,44,c0ca3e63,0,0,...) at sleepq_timedwait+0x6b _sleep(c0dfd6c0,0,44,c0ca3e63,2710,...) at _sleep+0x339 scheduler(0,141ec00,141ec00,141e000,1425000,...) at scheduler+0x23e mi_startup() at mi_startup+0x96 begin() at begin+0x2c db:0:allt> call doadump Physical memory: 3439 MB Dumping 212 MB: 197 181 165 149 133 117 101 85 69 53 37 21 5 Dump complete = 0xf db:0:doadump> reset (kgdb) bt #0 doadump () at pcpu.h:246 #1 0xc04d16f9 in db_fncall (dummy1=0xc08c52aa, dummy2=0x0, dummy3=0xffffffff, dummy4=0xf62dc6b4 "ÈÆ-ö") at ../../../ddb/db_command.c:548 #2 0xc04d1b2f in db_command (last_cmdp=0xc0dccc9c, cmd_table=0x0, dopager=0x0) at ../../../ddb/db_command.c:445 #3 0xc04d1be4 in db_command_script (command=0xc0dcdba8 "call doadump") at ../../../ddb/db_command.c:516 #4 0xc04d5db0 in db_script_exec (scriptname=0xc0dcd500 "doadump", warnifnotfound=Variable "warnifnotfound" is not available. ) at ../../../ddb/db_script.c:302 #5 0xc04d5e41 in db_run_cmd (addr=0x1, have_addr=0x0, count=0xc0fcbf60, modif=0xf62dc7ec "") at ../../../ddb/db_script.c:375 #6 0xc04d1af1 in db_command (last_cmdp=0xc0dccc9c, cmd_table=0x0, dopager=0x1) at ../../../ddb/db_command.c:445 #7 0xc04d1c4a in db_command_loop () at ../../../ddb/db_command.c:498 #8 0xc04d3aed in db_trap (type=0x3, code=0x0) at ../../../ddb/db_main.c:229 #9 0xc08c5126 in kdb_trap (type=0x3, code=0x0, tf=0xf62dc994) at ../../../kern/subr_kdb.c:535 #10 0xc0bc931b in trap (frame=0xf62dc994) at ../../../i386/i386/trap.c:690 #11 0xc0baac1b in calltrap () at ../../../i386/i386/exception.s:165 #12 0xc08c52aa in kdb_enter (why=0xc0ca19f2 "panic", msg=0xc0ca19f2 "panic") at cpufunc.h:71 #13 0xc0892926 in panic (fmt=0xc0c9e84a "Lock %s not exclusively locked @ %s:%d\n") at ../../../kern/kern_shutdown.c:562 #14 0xc087a6e5 in _lockmgr_assert (lk=0xc78af6b4, what=0x4, file=0xc0c967ea "../../../fs/msdosfs/msdosfs_fat.c", line=0x1aa) at ../../../kern/kern_lock.c:1329 #15 0xc081acf1 in freeclusterchain (pmp=0xc78af600, cluster=0x4) at ../../../fs/msdosfs/msdosfs_fat.c:426 #16 0xc0819e02 in detrunc (dep=0xc7472180, length=0x0, flags=0x0, cred=0x0, td=0xc7ad6b40) at ../../../fs/msdosfs/msdosfs_denode.c:457 #17 0xc0819ed9 in msdosfs_inactive (ap=0xf62dcb04) at ../../../fs/msdosfs/msdosfs_denode.c:608 #18 0xc0be1405 in VOP_INACTIVE_APV (vop=0xc0d8a820, a=0xf62dcb04) at vnode_if.c:1863 #19 0xc0927171 in vinactive (vp=0xc7462570, td=0xc7ad6b40) at vnode_if.h:807 #20 0xc09284f7 in vputx (vp=0xc7462570, func=0x2) at ../../../kern/vfs_subr.c:2176 #21 0xc0928570 in vput (vp=0xc7462570) at ../../../kern/vfs_subr.c:2203 #22 0xc092bb0a in kern_unlinkat (td=0xc7ad6b40, fd=0xffffff9c, path=0xbfbfe724
, pathseg=UIO_USERSPACE, oldinum=0x0) at ../../../kern/vfs_syscalls.c:1809 #23 0xc092bb5f in kern_unlink (td=0xc7ad6b40, path=0xbfbfe724
, pathseg=UIO_USERSPACE) at ../../../kern/vfs_syscalls.c:1744 #24 0xc092bb92 in unlink (td=0xc7ad6b40, uap=0xf62dccf8) at ../../../kern/vfs_syscalls.c:1714 #25 0xc0bc8aa0 in syscall (frame=0xf62dcd38) at ../../../i386/i386/trap.c:1109 #26 0xc0baac80 in Xint0x80_syscall () at ../../../i386/i386/exception.s:261 #27 0x00000033 in ?? () Previous frame inner to this frame (corrupt stack?) (kgdb) f 15 #15 0xc081acf1 in freeclusterchain (pmp=0xc78af600, cluster=0x4) at ../../../fs/msdosfs/msdosfs_fat.c:426 426 MSDOSFS_ASSERT_MP_LOCKED(pmp); (kgdb) l 421 usemap_free(pmp, cn) 422 struct msdosfsmount *pmp; 423 u_long cn; 424 { 425 426 MSDOSFS_ASSERT_MP_LOCKED(pmp); 427 pmp->pm_freeclustercount++; 428 pmp->pm_inusemap[cn / N_INUSEBITS] &= ~(1 << (cn % N_INUSEBITS)); 429 } 430 (kgdb) p *pmp $1 = {pm_mountp = 0xc73b05a8, pm_cp = 0xc7cf4080, pm_bo = 0xc7c653b0, pm_uid = 0x0, pm_gid = 0x0, pm_mask = 0x1ed, pm_dirmask = 0x1ed, pm_devvp = 0xc7c652b8, pm_dev = 0xc7b4fe00, pm_bpb = {bpbBytesPerSec = 0x200, bpbSecPerClust = 0x0, bpbResSectors = 0x1, bpbFATs = 0x2, bpbRootDirEnts = 0x200, bpbSectors = 0x0, bpbMedia = 0xf0, bpbFATsecs = 0x0, bpbSecPerTrack = 0x3f, bpbHeads = 0x10, bpbHiddenSecs = 0x0, bpbHugeSectors = 0x3ffc0}, pm_BlkPerSec = 0x1, pm_FATsecs = 0x40, pm_fatblk = 0x1, pm_rootdirblk = 0x81, pm_rootdirsize = 0x20, pm_firstcluster = 0xa1, pm_maxcluster = 0x3ff2, pm_freeclustercount = 0x3e05, pm_cnshift = 0xd, pm_crbomask = 0x1fff, pm_bnshift = 0x9, pm_bpcluster = 0x2000, pm_fmod = 0x1, pm_fatblocksize = 0x1000, pm_fatblocksec = 0x8, pm_fatsize = 0x8000, pm_fatmask = 0xffff, pm_fsinfo = 0x0, pm_nxtfree = 0x1ee, pm_fatmult = 0x2, pm_fatdiv = 0x1, pm_curfat = 0x0, pm_inusemap = 0xc73d0000, pm_flags = 0x20000002, pm_u2w = 0x0, pm_w2u = 0x0, pm_u2d = 0x0, pm_d2u = 0x0, pm_nfileno = 0x0, pm_filenos = {rbh_root = 0x0}, pm_fatlock = {lock_object = { lo_name = 0xc0c22ec5 "fatlk", lo_flags = 0x5730000, lo_data = 0x0, lo_witness = 0xc6d33ff8}, lk_lock = 0x1, lk_exslpfail = 0x0, lk_timo = 0x0, lk_pri = 0x0, lk_stack = {depth = 0xb, pcs = {0xc087b93e, 0xc081b135, 0xc081b83a, 0xc082119e, 0xc0be2436, 0xc09335ea, 0xc08db1d5, 0xc08dc928, 0xc08dca3f, 0xc0bc8aa0, 0xc0baac80, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0}}}} (kgdb) up #16 0xc0819e02 in detrunc (dep=0xc7472180, length=0x0, flags=0x0, cred=0x0, td=0xc7ad6b40) at ../../../fs/msdosfs/msdosfs_denode.c:457 457 freeclusterchain(pmp, chaintofree); (kgdb) l 452 /* 453 * Now free the clusters removed from the file because of the 454 * truncation. 455 */ 456 if (chaintofree != 0 && !MSDOSFSEOF(pmp, chaintofree)) 457 freeclusterchain(pmp, chaintofree); 458 459 return (allerror); 460 } 461 (kgdb) info loc error = 0xc7472180 allerror = 0x0 eofentry = 0xffffffff chaintofree = 0x4 isadir = 0x0 bp = (struct buf *) 0xf62dcac8 pmp = (struct msdosfsmount *) 0xc78af600 (kgdb) git diff master diff --git a/sys/cddl/compat/opensolaris/kern/opensolaris_kobj.c b/sys/cddl/compat/opensolaris/kern/opensolaris_kobj.c index d794345..1ef151a 100644 --- a/sys/cddl/compat/opensolaris/kern/opensolaris_kobj.c +++ b/sys/cddl/compat/opensolaris/kern/opensolaris_kobj.c @@ -69,7 +69,7 @@ kobj_open_file_vnode(const char *file) struct thread *td = curthread; struct filedesc *fd; struct nameidata nd; - int error, flags, vfslocked; + int error, flags; fd = td->td_proc->p_fd; FILEDESC_XLOCK(fd); @@ -84,15 +84,13 @@ kobj_open_file_vnode(const char *file) FILEDESC_XUNLOCK(fd); flags = FREAD | O_NOFOLLOW; - NDINIT(&nd, LOOKUP, MPSAFE, UIO_SYSSPACE, file, td); + NDINIT(&nd, LOOKUP, 0, UIO_SYSSPACE, file, td); error = vn_open_cred(&nd, &flags, 0, 0, curthread->td_ucred, NULL); if (error != 0) return (NULL); - vfslocked = NDHASGIANT(&nd); NDFREE(&nd, NDF_ONLY_PNBUF); /* We just unlock so we hold a reference. */ VOP_UNLOCK(nd.ni_vp, 0); - VFS_UNLOCK_GIANT(vfslocked); return (nd.ni_vp); } @@ -130,15 +128,13 @@ kobj_get_filesize_vnode(struct _buf *file, uint64_t *size) { struct vnode *vp = file->ptr; struct vattr va; - int error, vfslocked; + int error; - vfslocked = VFS_LOCK_GIANT(vp->v_mount); vn_lock(vp, LK_SHARED | LK_RETRY); error = VOP_GETATTR(vp, &va, curthread->td_ucred); VOP_UNLOCK(vp, 0); if (error == 0) *size = (uint64_t)va.va_size; - VFS_UNLOCK_GIANT(vfslocked); return (error); } @@ -171,7 +167,7 @@ kobj_read_file_vnode(struct _buf *file, char *buf, unsigned size, unsigned off) struct thread *td = curthread; struct uio auio; struct iovec aiov; - int error, vfslocked; + int error; bzero(&aiov, sizeof(aiov)); bzero(&auio, sizeof(auio)); @@ -187,11 +183,9 @@ kobj_read_file_vnode(struct _buf *file, char *buf, unsigned size, unsigned off) auio.uio_resid = size; auio.uio_td = td; - vfslocked = VFS_LOCK_GIANT(vp->v_mount); vn_lock(vp, LK_SHARED | LK_RETRY); error = VOP_READ(vp, &auio, IO_UNIT | IO_SYNC, td->td_ucred); VOP_UNLOCK(vp, 0); - VFS_UNLOCK_GIANT(vfslocked); return (error != 0 ? -1 : size - auio.uio_resid); } @@ -222,14 +216,7 @@ void kobj_close_file(struct _buf *file) { - if (file->mounted) { - struct vnode *vp = file->ptr; - struct thread *td = curthread; - int vfslocked; - - vfslocked = VFS_LOCK_GIANT(vp->v_mount); - vn_close(vp, FREAD, td->td_ucred, td); - VFS_UNLOCK_GIANT(vfslocked); - } + if (file->mounted) + vn_close(file->ptr, FREAD, curthread->td_ucred, curthread); kmem_free(file, sizeof(*file)); } diff --git a/sys/cddl/compat/opensolaris/kern/opensolaris_lookup.c b/sys/cddl/compat/opensolaris/kern/opensolaris_lookup.c index ba79027..a7ec8b9 100644 --- a/sys/cddl/compat/opensolaris/kern/opensolaris_lookup.c +++ b/sys/cddl/compat/opensolaris/kern/opensolaris_lookup.c @@ -54,7 +54,7 @@ lookupnameat(char *dirname, enum uio_seg seg, enum symfollow follow, vref(startvp); ltype = VOP_ISLOCKED(startvp); VOP_UNLOCK(startvp, 0); - NDINIT_ATVP(&nd, LOOKUP, LOCKLEAF | MPSAFE | follow, seg, dirname, + NDINIT_ATVP(&nd, LOOKUP, LOCKLEAF | follow, seg, dirname, startvp, curthread); error = namei(&nd); *compvpp = nd.ni_vp; diff --git a/sys/cddl/compat/opensolaris/sys/vnode.h b/sys/cddl/compat/opensolaris/sys/vnode.h index 7296635..8938c1e 100644 --- a/sys/cddl/compat/opensolaris/sys/vnode.h +++ b/sys/cddl/compat/opensolaris/sys/vnode.h @@ -181,7 +181,7 @@ vn_openat(char *pnamep, enum uio_seg seg, int filemode, int createmode, if (startvp != NULL) vref(startvp); - NDINIT_ATVP(&nd, operation, MPSAFE, UIO_SYSSPACE, pnamep, startvp, td); + NDINIT_ATVP(&nd, operation, 0, UIO_SYSSPACE, pnamep, startvp, td); filemode |= O_NOFOLLOW; error = vn_open_cred(&nd, &filemode, createmode, 0, td->td_ucred, NULL); NDFREE(&nd, NDF_ONLY_PNBUF); @@ -211,12 +211,11 @@ zfs_vn_rdwr(enum uio_rw rw, vnode_t *vp, caddr_t base, ssize_t len, ssize_t *residp) { struct thread *td = curthread; - int error, vfslocked, resid; + int error, resid; ASSERT(ioflag == 0); ASSERT(ulimit == RLIM64_INFINITY); - vfslocked = VFS_LOCK_GIANT(vp->v_mount); if (rw == UIO_WRITE) { ioflag = IO_SYNC; } else { @@ -224,7 +223,6 @@ zfs_vn_rdwr(enum uio_rw rw, vnode_t *vp, caddr_t base, ssize_t len, } error = vn_rdwr(rw, vp, base, len, offset, seg, ioflag, cr, NOCRED, &resid, td); - VFS_UNLOCK_GIANT(vfslocked); if (residp != NULL) *residp = (ssize_t)resid; return (error); @@ -236,11 +234,10 @@ static __inline int zfs_vop_fsync(vnode_t *vp, int flag, cred_t *cr) { struct mount *mp; - int error, vfslocked; + int error; ASSERT(flag == FSYNC); - vfslocked = VFS_LOCK_GIANT(vp->v_mount); if ((error = vn_start_write(vp, &mp, V_WAIT | PCATCH)) != 0) goto drop; vn_lock(vp, LK_EXCLUSIVE | LK_RETRY); @@ -248,7 +245,6 @@ zfs_vop_fsync(vnode_t *vp, int flag, cred_t *cr) VOP_UNLOCK(vp, 0); vn_finished_write(mp); drop: - VFS_UNLOCK_GIANT(vfslocked); return (error); } #define VOP_FSYNC(vp, flag, cr, ct) zfs_vop_fsync((vp), (flag), (cr)) @@ -256,14 +252,12 @@ drop: static __inline int zfs_vop_close(vnode_t *vp, int flag, int count, offset_t offset, cred_t *cr) { - int error, vfslocked; + int error; ASSERT(count == 1); ASSERT(offset == 0); - vfslocked = VFS_LOCK_GIANT(vp->v_mount); error = vn_close(vp, flag, cr, curthread); - VFS_UNLOCK_GIANT(vfslocked); return (error); } #define VOP_CLOSE(vp, oflags, count, offset, cr, ct) \ diff --git a/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_file.c b/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_file.c index 30b3f35..61bb2f6 100644 --- a/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_file.c +++ b/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_file.c @@ -41,7 +41,7 @@ vdev_file_open(vdev_t *vd, uint64_t *psize, uint64_t *ashift) vdev_file_t *vf; vnode_t *vp; vattr_t vattr; - int error, vfslocked; + int error; /* * We must have a pathname, and it must be absolute. @@ -84,11 +84,9 @@ vdev_file_open(vdev_t *vd, uint64_t *psize, uint64_t *ashift) * Determine the physical size of the file. */ vattr.va_mask = AT_SIZE; - vfslocked = VFS_LOCK_GIANT(vp->v_mount); vn_lock(vp, LK_SHARED | LK_RETRY); error = VOP_GETATTR(vp, &vattr, kcred); VOP_UNLOCK(vp, 0); - VFS_UNLOCK_GIANT(vfslocked); if (error) { (void) VOP_CLOSE(vp, spa_mode, 1, 0, kcred, NULL); vd->vdev_stat.vs_aux = VDEV_AUX_OPEN_FAILED; diff --git a/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c b/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c index 4f61f5f..603ac17 100644 --- a/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c +++ b/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c @@ -925,9 +925,7 @@ zfs_get_done(dmu_buf_t *db, void *vzgd) rl_t *rl = zgd->zgd_rl; vnode_t *vp = ZTOV(rl->r_zp); objset_t *os = rl->r_zp->z_zfsvfs->z_os; - int vfslocked; - vfslocked = VFS_LOCK_GIANT(vp->v_vfsp); dmu_buf_rele(db, vzgd); zfs_range_unlock(rl); /* @@ -937,7 +935,6 @@ zfs_get_done(dmu_buf_t *db, void *vzgd) VN_RELE_ASYNC(vp, dsl_pool_vnrele_taskq(dmu_objset_pool(os))); zil_add_block(zgd->zgd_zilog, zgd->zgd_bp); kmem_free(zgd, sizeof (zgd_t)); - VFS_UNLOCK_GIANT(vfslocked); } /* @@ -4598,7 +4595,7 @@ vop_getextattr { } flags = FREAD; - NDINIT_ATVP(&nd, LOOKUP, NOFOLLOW | MPSAFE, UIO_SYSSPACE, attrname, + NDINIT_ATVP(&nd, LOOKUP, NOFOLLOW, UIO_SYSSPACE, attrname, xvp, td); error = vn_open_cred(&nd, &flags, 0, 0, ap->a_cred, NULL); vp = nd.ni_vp; @@ -4666,7 +4663,7 @@ vop_deleteextattr { return (error); } - NDINIT_ATVP(&nd, DELETE, NOFOLLOW | LOCKPARENT | LOCKLEAF | MPSAFE, + NDINIT_ATVP(&nd, DELETE, NOFOLLOW | LOCKPARENT | LOCKLEAF, UIO_SYSSPACE, attrname, xvp, td); error = namei(&nd); vp = nd.ni_vp; @@ -4733,7 +4730,7 @@ vop_setextattr { } flags = FFLAGS(O_WRONLY | O_CREAT); - NDINIT_ATVP(&nd, LOOKUP, NOFOLLOW | MPSAFE, UIO_SYSSPACE, attrname, + NDINIT_ATVP(&nd, LOOKUP, NOFOLLOW, UIO_SYSSPACE, attrname, xvp, td); error = vn_open_cred(&nd, &flags, 0600, 0, ap->a_cred, NULL); vp = nd.ni_vp; @@ -4814,7 +4811,7 @@ vop_listextattr { return (error); } - NDINIT_ATVP(&nd, LOOKUP, NOFOLLOW | LOCKLEAF | LOCKSHARED | MPSAFE, + NDINIT_ATVP(&nd, LOOKUP, NOFOLLOW | LOCKLEAF | LOCKSHARED, UIO_SYSSPACE, ".", xvp, td); error = namei(&nd); vp = nd.ni_vp; diff --git a/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_znode.c b/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_znode.c index 900087b..7157930 100644 --- a/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_znode.c +++ b/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_znode.c @@ -1017,7 +1017,6 @@ zfs_zinactive(znode_t *zp) vnode_t *vp = ZTOV(zp); zfsvfs_t *zfsvfs = zp->z_zfsvfs; uint64_t z_id = zp->z_id; - int vfslocked; ASSERT(zp->z_dbuf && zp->z_phys); @@ -1050,9 +1049,7 @@ zfs_zinactive(znode_t *zp) ZFS_OBJ_HOLD_EXIT(zfsvfs, z_id); ASSERT(vp->v_count == 0); vrecycle(vp, curthread); - vfslocked = VFS_LOCK_GIANT(zfsvfs->z_vfs); zfs_rmnode(zp); - VFS_UNLOCK_GIANT(vfslocked); return; } mutex_exit(&zp->z_lock); diff --git a/sys/compat/linprocfs/linprocfs.c b/sys/compat/linprocfs/linprocfs.c index 541db2f..4859a3a 100644 --- a/sys/compat/linprocfs/linprocfs.c +++ b/sys/compat/linprocfs/linprocfs.c @@ -325,7 +325,7 @@ linprocfs_domtab(PFS_FILL_ARGS) int error; /* resolve symlinks etc. in the emulation tree prefix */ - NDINIT(&nd, LOOKUP, FOLLOW | MPSAFE, UIO_SYSSPACE, linux_emul_path, td); + NDINIT(&nd, LOOKUP, FOLLOW, UIO_SYSSPACE, linux_emul_path, td); flep = NULL; error = namei(&nd); lep = linux_emul_path; @@ -333,7 +333,6 @@ linprocfs_domtab(PFS_FILL_ARGS) if (vn_fullpath(td, nd.ni_vp, &dlep, &flep) == 0) lep = dlep; vrele(nd.ni_vp); - VFS_UNLOCK_GIANT(NDHASGIANT(&nd)); } lep_len = strlen(lep); @@ -404,7 +403,7 @@ linprocfs_dopartitions(PFS_FILL_ARGS) int major, minor; /* resolve symlinks etc. in the emulation tree prefix */ - NDINIT(&nd, LOOKUP, FOLLOW | MPSAFE, UIO_SYSSPACE, linux_emul_path, td); + NDINIT(&nd, LOOKUP, FOLLOW, UIO_SYSSPACE, linux_emul_path, td); flep = NULL; error = namei(&nd); lep = linux_emul_path; @@ -412,7 +411,6 @@ linprocfs_dopartitions(PFS_FILL_ARGS) if (vn_fullpath(td, nd.ni_vp, &dlep, &flep) == 0) lep = dlep; vrele(nd.ni_vp); - VFS_UNLOCK_GIANT(NDHASGIANT(&nd)); } lep_len = strlen(lep); @@ -964,7 +962,6 @@ linprocfs_doprocmaps(PFS_FILL_ARGS) int error; struct vnode *vp; struct vattr vat; - int locked; PROC_LOCK(p); error = p_candebug(td, p); @@ -1017,12 +1014,10 @@ linprocfs_doprocmaps(PFS_FILL_ARGS) VM_OBJECT_UNLOCK(obj); if (vp) { vn_fullpath(td, vp, &name, &freename); - locked = VFS_LOCK_GIANT(vp->v_mount); vn_lock(vp, LK_SHARED | LK_RETRY); VOP_GETATTR(vp, &vat, td->td_ucred); ino = vat.va_fileid; vput(vp); - VFS_UNLOCK_GIANT(locked); } } else { flags = 0; diff --git a/sys/compat/linux/linux_file.c b/sys/compat/linux/linux_file.c index 4e33eaa..f2c7975 100644 --- a/sys/compat/linux/linux_file.c +++ b/sys/compat/linux/linux_file.c @@ -337,7 +337,7 @@ getdents_common(struct thread *td, struct linux_getdents64_args *args, struct l_dirent64 *linux_dirent64; int buflen, error, eofflag, nbytes, justone; u_long *cookies = NULL, *cookiep; - int ncookies, vfslocked; + int ncookies; nbytes = args->count; if (nbytes == 1) { @@ -358,9 +358,7 @@ getdents_common(struct thread *td, struct linux_getdents64_args *args, } vp = fp->f_vnode; - vfslocked = VFS_LOCK_GIANT(vp->v_mount); if (vp->v_type != VDIR) { - VFS_UNLOCK_GIANT(vfslocked); fdrop(fp, td); return (EINVAL); } @@ -525,7 +523,6 @@ out: free(cookies, M_TEMP); VOP_UNLOCK(vp, 0); - VFS_UNLOCK_GIANT(vfslocked); fdrop(fp, td); free(buf, M_TEMP); free(lbuf, M_TEMP); diff --git a/sys/compat/linux/linux_misc.c b/sys/compat/linux/linux_misc.c index d2cf6b6..c53f6e7 100644 --- a/sys/compat/linux/linux_misc.c +++ b/sys/compat/linux/linux_misc.c @@ -235,7 +235,7 @@ linux_uselib(struct thread *td, struct linux_uselib_args *args) unsigned long bss_size; char *library; int error; - int locked, vfslocked; + int locked; LCONVPATHEXIST(td, args->library, &library); @@ -245,11 +245,10 @@ linux_uselib(struct thread *td, struct linux_uselib_args *args) #endif a_out = NULL; - vfslocked = 0; locked = 0; vp = NULL; - NDINIT(&ni, LOOKUP, ISOPEN | FOLLOW | LOCKLEAF | MPSAFE | AUDITVNODE1, + NDINIT(&ni, LOOKUP, ISOPEN | FOLLOW | LOCKLEAF | AUDITVNODE1, UIO_SYSSPACE, library, td); error = namei(&ni); LFREEPATH(library); @@ -257,7 +256,6 @@ linux_uselib(struct thread *td, struct linux_uselib_args *args) goto cleanup; vp = ni.ni_vp; - vfslocked = NDHASGIANT(&ni); NDFREE(&ni, NDF_ONLY_PNBUF); /* @@ -379,7 +377,6 @@ linux_uselib(struct thread *td, struct linux_uselib_args *args) */ locked = 0; VOP_UNLOCK(vp, 0); - VFS_UNLOCK_GIANT(vfslocked); /* * Check if file_offset page aligned. Currently we cannot handle @@ -458,10 +455,8 @@ linux_uselib(struct thread *td, struct linux_uselib_args *args) cleanup: /* Unlock vnode if needed */ - if (locked) { + if (locked) VOP_UNLOCK(vp, 0); - VFS_UNLOCK_GIANT(vfslocked); - } /* Release the kernel mapping. */ if (a_out) diff --git a/sys/compat/ndis/subr_ndis.c b/sys/compat/ndis/subr_ndis.c index 558398d..82fd6ae 100644 --- a/sys/compat/ndis/subr_ndis.c +++ b/sys/compat/ndis/subr_ndis.c @@ -2741,7 +2741,7 @@ NdisOpenFile(status, filehandle, filelength, filename, highestaddr) char *afilename = NULL; struct thread *td = curthread; struct nameidata nd; - int flags, error, vfslocked; + int flags, error; struct vattr vat; struct vattr *vap = &vat; ndis_fh *fh; @@ -2821,7 +2821,7 @@ NdisOpenFile(status, filehandle, filelength, filename, highestaddr) if (td->td_proc->p_fd->fd_cdir == NULL) td->td_proc->p_fd->fd_cdir = rootvnode; - NDINIT(&nd, LOOKUP, FOLLOW | MPSAFE, UIO_SYSSPACE, path, td); + NDINIT(&nd, LOOKUP, FOLLOW, UIO_SYSSPACE, path, td); flags = FREAD; error = vn_open(&nd, &flags, 0, NULL); @@ -2833,7 +2833,6 @@ NdisOpenFile(status, filehandle, filelength, filename, highestaddr) free(afilename, M_DEVBUF); return; } - vfslocked = NDHASGIANT(&nd); ExFreePool(path); @@ -2842,7 +2841,6 @@ NdisOpenFile(status, filehandle, filelength, filename, highestaddr) /* Get the file size. */ VOP_GETATTR(nd.ni_vp, vap, td->td_ucred); VOP_UNLOCK(nd.ni_vp, 0); - VFS_UNLOCK_GIANT(vfslocked); fh->nf_vp = nd.ni_vp; fh->nf_map = NULL; @@ -2862,7 +2860,7 @@ NdisMapFile(status, mappedbuffer, filehandle) struct thread *td = curthread; linker_file_t lf; caddr_t kldstart; - int error, resid, vfslocked; + int error, resid; struct vnode *vp; if (filehandle == NULL) { @@ -2902,10 +2900,8 @@ NdisMapFile(status, mappedbuffer, filehandle) } vp = fh->nf_vp; - vfslocked = VFS_LOCK_GIANT(vp->v_mount); error = vn_rdwr(UIO_READ, vp, fh->nf_map, fh->nf_maplen, 0, UIO_SYSSPACE, 0, td->td_ucred, NOCRED, &resid, td); - VFS_UNLOCK_GIANT(vfslocked); if (error) *status = NDIS_STATUS_FAILURE; @@ -2936,7 +2932,6 @@ NdisCloseFile(filehandle) { struct thread *td = curthread; ndis_fh *fh; - int vfslocked; struct vnode *vp; if (filehandle == NULL) @@ -2954,9 +2949,7 @@ NdisCloseFile(filehandle) if (fh->nf_type == NDIS_FH_TYPE_VFS) { vp = fh->nf_vp; - vfslocked = VFS_LOCK_GIANT(vp->v_mount); vn_close(vp, FREAD, td->td_ucred, td); - VFS_UNLOCK_GIANT(vfslocked); } fh->nf_vp = NULL; diff --git a/sys/compat/svr4/svr4_misc.c b/sys/compat/svr4/svr4_misc.c index 6f80fe6..fd48fe8 100644 --- a/sys/compat/svr4/svr4_misc.c +++ b/sys/compat/svr4/svr4_misc.c @@ -240,7 +240,7 @@ svr4_sys_getdents64(td, uap) struct iovec aiov; off_t off; struct svr4_dirent64 svr4_dirent; - int buflen, error, eofflag, nbytes, justone, vfslocked; + int buflen, error, eofflag, nbytes, justone; u_long *cookies = NULL, *cookiep; int ncookies; @@ -256,9 +256,7 @@ svr4_sys_getdents64(td, uap) } vp = fp->f_vnode; - vfslocked = VFS_LOCK_GIANT(vp->v_mount); if (vp->v_type != VDIR) { - VFS_UNLOCK_GIANT(vfslocked); fdrop(fp, td); return (EINVAL); } @@ -395,7 +393,6 @@ eof: td->td_retval[0] = nbytes - resid; out: VOP_UNLOCK(vp, 0); - VFS_UNLOCK_GIANT(vfslocked); fdrop(fp, td); if (cookies) free(cookies, M_TEMP); @@ -420,7 +417,7 @@ svr4_sys_getdents(td, uap) struct iovec aiov; struct svr4_dirent idb; off_t off; /* true file offset */ - int buflen, error, eofflag, vfslocked; + int buflen, error, eofflag; u_long *cookiebuf = NULL, *cookie; int ncookies = 0, *retval = td->td_retval; @@ -436,9 +433,7 @@ svr4_sys_getdents(td, uap) } vp = fp->f_vnode; - vfslocked = VFS_LOCK_GIANT(vp->v_mount); if (vp->v_type != VDIR) { - VFS_UNLOCK_GIANT(vfslocked); fdrop(fp, td); return (EINVAL); } @@ -531,7 +526,6 @@ eof: *retval = uap->nbytes - resid; out: VOP_UNLOCK(vp, 0); - VFS_UNLOCK_GIANT(vfslocked); fdrop(fp, td); if (cookiebuf) free(cookiebuf, M_TEMP); @@ -611,7 +605,7 @@ svr4_sys_fchroot(td, uap) struct filedesc *fdp = td->td_proc->p_fd; struct vnode *vp; struct file *fp; - int error, vfslocked; + int error; if ((error = priv_check(td, PRIV_VFS_FCHROOT)) != 0) return error; @@ -620,7 +614,6 @@ svr4_sys_fchroot(td, uap) vp = fp->f_vnode; VREF(vp); fdrop(fp, td); - vfslocked = VFS_LOCK_GIANT(vp->v_mount); vn_lock(vp, LK_EXCLUSIVE | LK_RETRY); error = change_dir(vp, td); if (error) @@ -633,11 +626,9 @@ svr4_sys_fchroot(td, uap) VOP_UNLOCK(vp, 0); error = change_root(vp, td); vrele(vp); - VFS_UNLOCK_GIANT(vfslocked); return (error); fail: vput(vp); - VFS_UNLOCK_GIANT(vfslocked); return (error); } @@ -1648,13 +1639,12 @@ svr4_sys_resolvepath(td, uap) int error, *retval = td->td_retval; unsigned int ncopy; - NDINIT(&nd, LOOKUP, NOFOLLOW | SAVENAME | MPSAFE, UIO_USERSPACE, + NDINIT(&nd, LOOKUP, NOFOLLOW | SAVENAME, UIO_USERSPACE, uap->path, td); if ((error = namei(&nd)) != 0) return (error); NDFREE(&nd, NDF_NO_FREE_PNBUF); - VFS_UNLOCK_GIANT(NDHASGIANT(&nd)); ncopy = min(uap->bufsiz, strlen(nd.ni_cnd.cn_pnbuf) + 1); if ((error = copyout(nd.ni_cnd.cn_pnbuf, uap->buf, ncopy)) != 0) diff --git a/sys/dev/hwpmc/hwpmc_mod.c b/sys/dev/hwpmc/hwpmc_mod.c index d331a85..79bc04d 100644 --- a/sys/dev/hwpmc/hwpmc_mod.c +++ b/sys/dev/hwpmc/hwpmc_mod.c @@ -1626,7 +1626,6 @@ pmc_log_kernel_mappings(struct pmc *pm) static void pmc_log_process_mappings(struct pmc_owner *po, struct proc *p) { - int locked; vm_map_t map; struct vnode *vp; struct vmspace *vm; @@ -1736,9 +1735,7 @@ pmc_log_process_mappings(struct pmc_owner *po, struct proc *p) pmc_getfilename(vp, &fullpath, &freepath); last_vp = vp; - locked = VFS_LOCK_GIANT(vp->v_mount); vrele(vp); - VFS_UNLOCK_GIANT(locked); vp = NULL; pmclog_process_map_in(po, p->p_pid, start_addr, fullpath); diff --git a/sys/dev/md/md.c b/sys/dev/md/md.c index 2006099..60e80c9 100644 --- a/sys/dev/md/md.c +++ b/sys/dev/md/md.c @@ -506,7 +506,7 @@ mdstart_preload(struct md_s *sc, struct bio *bp) static int mdstart_vnode(struct md_s *sc, struct bio *bp) { - int error, vfslocked; + int error; struct uio auio; struct iovec aiov; struct mount *mp; @@ -534,13 +534,11 @@ mdstart_vnode(struct md_s *sc, struct bio *bp) */ if (bp->bio_cmd == BIO_FLUSH) { - vfslocked = VFS_LOCK_GIANT(vp->v_mount); (void) vn_start_write(vp, &mp, V_WAIT); vn_lock(vp, LK_EXCLUSIVE | LK_RETRY); error = VOP_FSYNC(vp, MNT_WAIT, td); VOP_UNLOCK(vp, 0); vn_finished_write(mp); - VFS_UNLOCK_GIANT(vfslocked); return (error); } @@ -564,7 +562,6 @@ mdstart_vnode(struct md_s *sc, struct bio *bp) * When reading set IO_DIRECT to try to avoid double-caching * the data. When writing IO_DIRECT is not optimal. */ - vfslocked = VFS_LOCK_GIANT(vp->v_mount); if (bp->bio_cmd == BIO_READ) { vn_lock(vp, LK_EXCLUSIVE | LK_RETRY); error = VOP_READ(vp, &auio, IO_DIRECT, sc->cred); @@ -577,7 +574,6 @@ mdstart_vnode(struct md_s *sc, struct bio *bp) VOP_UNLOCK(vp, 0); vn_finished_write(mp); } - VFS_UNLOCK_GIANT(vfslocked); bp->bio_resid = auio.uio_resid; return (error); } @@ -909,7 +905,7 @@ mdcreate_vnode(struct md_s *sc, struct md_ioctl *mdio, struct thread *td) { struct vattr vattr; struct nameidata nd; - int error, flags, vfslocked; + int error, flags; error = copyinstr(mdio->md_file, sc->file, sizeof(sc->file), NULL); if (error != 0) @@ -921,11 +917,10 @@ mdcreate_vnode(struct md_s *sc, struct md_ioctl *mdio, struct thread *td) */ if ((mdio->md_options & MD_READONLY) != 0) flags &= ~FWRITE; - NDINIT(&nd, LOOKUP, FOLLOW | MPSAFE, UIO_SYSSPACE, sc->file, td); + NDINIT(&nd, LOOKUP, FOLLOW, UIO_SYSSPACE, sc->file, td); error = vn_open(&nd, &flags, 0, NULL); if (error != 0) return (error); - vfslocked = NDHASGIANT(&nd); NDFREE(&nd, NDF_ONLY_PNBUF); if (nd.ni_vp->v_type != VREG) { error = EINVAL; @@ -961,19 +956,16 @@ mdcreate_vnode(struct md_s *sc, struct md_ioctl *mdio, struct thread *td) nd.ni_vp->v_vflag &= ~VV_MD; goto bad; } - VFS_UNLOCK_GIANT(vfslocked); return (0); bad: VOP_UNLOCK(nd.ni_vp, 0); (void)vn_close(nd.ni_vp, flags, td->td_ucred, td); - VFS_UNLOCK_GIANT(vfslocked); return (error); } static int mddestroy(struct md_s *sc, struct thread *td) { - int vfslocked; if (sc->gp) { sc->gp->softc = NULL; @@ -995,13 +987,11 @@ mddestroy(struct md_s *sc, struct thread *td) mtx_unlock(&sc->queue_mtx); mtx_destroy(&sc->queue_mtx); if (sc->vnode != NULL) { - vfslocked = VFS_LOCK_GIANT(sc->vnode->v_mount); vn_lock(sc->vnode, LK_EXCLUSIVE | LK_RETRY); sc->vnode->v_vflag &= ~VV_MD; VOP_UNLOCK(sc->vnode, 0); (void)vn_close(sc->vnode, sc->flags & MD_READONLY ? FREAD : (FREAD|FWRITE), sc->cred, td); - VFS_UNLOCK_GIANT(vfslocked); } if (sc->cred != NULL) crfree(sc->cred); diff --git a/sys/fs/msdosfs/msdosfs_denode.c b/sys/fs/msdosfs/msdosfs_denode.c index b689b5d..279ee99 100644 --- a/sys/fs/msdosfs/msdosfs_denode.c +++ b/sys/fs/msdosfs/msdosfs_denode.c @@ -167,9 +167,8 @@ deget(pmp, dirclust, diroffset, depp) ldep->de_dirclust = dirclust; ldep->de_diroffset = diroffset; ldep->de_inode = inode; - fc_purge(ldep, 0); /* init the fat cache for this denode */ - lockmgr(nvp->v_vnlock, LK_EXCLUSIVE, NULL); + fc_purge(ldep, 0); /* init the fat cache for this denode */ error = insmntque(nvp, mntp); if (error != 0) { free(ldep, M_MSDOSFSNODE); @@ -183,9 +182,8 @@ deget(pmp, dirclust, diroffset, depp) return (error); } if (xvp != NULL) { - /* XXX: Not sure this is right */ - nvp = xvp; - ldep->de_vnode = nvp; + *depp = xvp->v_data; + return (0); } ldep->de_pmp = pmp; @@ -594,7 +592,7 @@ msdosfs_inactive(ap) /* * Ignore denodes related to stale file handles. */ - if (dep->de_Name[0] == SLOT_DELETED) + if (dep->de_Name[0] == SLOT_DELETED || dep->de_Name[0] == SLOT_EMPTY) goto out; /* @@ -622,7 +620,7 @@ out: printf("msdosfs_inactive(): v_usecount %d, de_Name[0] %x\n", vrefcnt(vp), dep->de_Name[0]); #endif - if (dep->de_Name[0] == SLOT_DELETED) + if (dep->de_Name[0] == SLOT_DELETED || dep->de_Name[0] == SLOT_EMPTY) vrecycle(vp, td); return (error); } diff --git a/sys/fs/msdosfs/msdosfs_fat.c b/sys/fs/msdosfs/msdosfs_fat.c index 76d1527..80ac1e8 100644 --- a/sys/fs/msdosfs/msdosfs_fat.c +++ b/sys/fs/msdosfs/msdosfs_fat.c @@ -60,19 +60,6 @@ #include #include -/* - * Fat cache stats. - */ -static int fc_fileextends; /* # of file extends */ -static int fc_lfcempty; /* # of time last file cluster cache entry - * was empty */ -static int fc_bmapcalls; /* # of times pcbmap was called */ - -#define LMMAX 20 -static int fc_lmdistance[LMMAX];/* counters for how far off the last - * cluster mapped entry was. */ -static int fc_largedistance; /* off by more than LMMAX */ - static int chainalloc(struct msdosfsmount *pmp, u_long start, u_long count, u_long fillwith, u_long *retcluster, u_long *got); @@ -90,6 +77,9 @@ static __inline void usemap_alloc(struct msdosfsmount *pmp, u_long cn); static __inline void usemap_free(struct msdosfsmount *pmp, u_long cn); +static int clusteralloc1(struct msdosfsmount *pmp, u_long start, + u_long count, u_long fillwith, u_long *retcluster, + u_long *got); static void fatblock(pmp, ofs, bnp, sizep, bop) @@ -152,14 +142,9 @@ pcbmap(dep, findcn, bnp, cnp, sp) struct msdosfsmount *pmp = dep->de_pmp; u_long bsize; - fc_bmapcalls++; - - /* - * If they don't give us someplace to return a value then don't - * bother doing anything. - */ - if (bnp == NULL && cnp == NULL && sp == NULL) - return (0); + KASSERT(bnp != NULL || cnp != NULL || sp != NULL, + ("pcbmap: extra call")); + ASSERT_VOP_ELOCKED(DETOV(dep), "pcbmap"); cn = dep->de_StartCluster; /* @@ -203,10 +188,6 @@ pcbmap(dep, findcn, bnp, cnp, sp) */ i = 0; fc_lookup(dep, findcn, &i, &cn); - if ((bn = findcn - i) >= LMMAX) - fc_largedistance++; - else - fc_lmdistance[bn]++; /* * Handle all other files or directories the normal way. @@ -289,6 +270,8 @@ fc_lookup(dep, findcn, frcnp, fsrcnp) u_long cn; struct fatcache *closest = 0; + ASSERT_VOP_LOCKED(DETOV(dep), "fc_lookup"); + for (i = 0; i < FC_SIZE; i++) { cn = dep->de_fc[i].fc_frcn; if (cn != FCE_EMPTY && cn <= findcn) { @@ -314,6 +297,8 @@ fc_purge(dep, frcn) int i; struct fatcache *fcp; + ASSERT_VOP_ELOCKED(DETOV(dep), "fc_purge"); + fcp = dep->de_fc; for (i = 0; i < FC_SIZE; i++, fcp++) { if (fcp->fc_frcn >= frcn) @@ -427,6 +412,7 @@ usemap_alloc(pmp, cn) u_long cn; { + MSDOSFS_ASSERT_MP_LOCKED(pmp); pmp->pm_inusemap[cn / N_INUSEBITS] |= 1 << (cn % N_INUSEBITS); pmp->pm_freeclustercount--; } @@ -437,6 +423,7 @@ usemap_free(pmp, cn) u_long cn; { + MSDOSFS_ASSERT_MP_LOCKED(pmp); pmp->pm_freeclustercount++; pmp->pm_inusemap[cn / N_INUSEBITS] &= ~(1 << (cn % N_INUSEBITS)); } @@ -450,17 +437,17 @@ clusterfree(pmp, cluster, oldcnp) int error; u_long oldcn; - usemap_free(pmp, cluster); error = fatentry(FAT_GET_AND_SET, pmp, cluster, &oldcn, MSDOSFSFREE); - if (error) { - usemap_alloc(pmp, cluster); + if (error) return (error); - } /* * If the cluster was successfully marked free, then update * the count of free clusters, and turn off the "allocated" * bit in the "in use" cluster bit map. */ + MSDOSFS_LOCK_MP(pmp); + usemap_free(pmp, cluster); + MSDOSFS_UNLOCK_MP(pmp); if (oldcnp) *oldcnp = oldcn; return (0); @@ -678,6 +665,8 @@ chainlength(pmp, start, count) u_int map; u_long len; + MSDOSFS_ASSERT_MP_LOCKED(pmp); + max_idx = pmp->pm_maxcluster / N_INUSEBITS; idx = start / N_INUSEBITS; start %= N_INUSEBITS; @@ -726,6 +715,8 @@ chainalloc(pmp, start, count, fillwith, retcluster, got) int error; u_long cl, n; + MSDOSFS_ASSERT_MP_LOCKED(pmp); + for (cl = start, n = count; n-- > 0;) usemap_alloc(pmp, cl++); @@ -758,19 +749,28 @@ chainalloc(pmp, start, count, fillwith, retcluster, got) * got - how many clusters were actually allocated. */ int -clusteralloc(pmp, start, count, fillwith, retcluster, got) - struct msdosfsmount *pmp; - u_long start; - u_long count; - u_long fillwith; - u_long *retcluster; - u_long *got; +clusteralloc(struct msdosfsmount *pmp, u_long start, u_long count, + u_long fillwith, u_long *retcluster, u_long *got) +{ + int error; + + MSDOSFS_LOCK_MP(pmp); + error = clusteralloc1(pmp, start, count, fillwith, retcluster, got); + MSDOSFS_UNLOCK_MP(pmp); + return (error); +} + +static int +clusteralloc1(struct msdosfsmount *pmp, u_long start, u_long count, + u_long fillwith, u_long *retcluster, u_long *got) { u_long idx; u_long len, newst, foundl, cn, l; u_long foundcn = 0; /* XXX: foundcn could be used unititialized */ u_int map; + MSDOSFS_ASSERT_MP_LOCKED(pmp); + #ifdef MSDOSFS_DEBUG printf("clusteralloc(): find %lu clusters\n", count); #endif @@ -906,6 +906,8 @@ fillinusemap(pmp) int error; u_long bn, bo, bsize, byteoffset; + MSDOSFS_ASSERT_MP_LOCKED(pmp); + /* * Mark all clusters in use, we mark the free ones in the fat scan * loop further down. @@ -992,10 +994,8 @@ extendfile(dep, count, bpp, ncp, flags) * If the "file's last cluster" cache entry is empty, and the file * is not empty, then fill the cache entry by calling pcbmap(). */ - fc_fileextends++; if (dep->de_fc[FC_LASTFC].fc_frcn == FCE_EMPTY && dep->de_StartCluster != 0) { - fc_lfcempty++; error = pcbmap(dep, 0xffff, 0, &cn, 0); /* we expect it to return E2BIG */ if (error != E2BIG) diff --git a/sys/fs/msdosfs/msdosfs_fileno.c b/sys/fs/msdosfs/msdosfs_fileno.c index ff1f2b7..b56fb43 100644 --- a/sys/fs/msdosfs/msdosfs_fileno.c +++ b/sys/fs/msdosfs/msdosfs_fileno.c @@ -51,7 +51,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include @@ -59,9 +58,6 @@ __FBSDID("$FreeBSD$"); static MALLOC_DEFINE(M_MSDOSFSFILENO, "msdosfs_fileno", "MSDOSFS fileno mapping node"); -static struct mtx fileno_mtx; -MTX_SYSINIT(fileno, &fileno_mtx, "MSDOSFS fileno", MTX_DEF); - RB_PROTOTYPE(msdosfs_filenotree, msdosfs_fileno, mf_tree, msdosfs_fileno_compare) @@ -117,30 +113,30 @@ msdosfs_fileno_map(mp, fileno) } if (fileno < FILENO_FIRST_DYN) return ((uint32_t)fileno); - mtx_lock(&fileno_mtx); + MSDOSFS_LOCK_MP(pmp); key.mf_fileno64 = fileno; mf = RB_FIND(msdosfs_filenotree, &pmp->pm_filenos, &key); if (mf != NULL) { mapped = mf->mf_fileno32; - mtx_unlock(&fileno_mtx); + MSDOSFS_UNLOCK_MP(pmp); return (mapped); } if (pmp->pm_nfileno < FILENO_FIRST_DYN) panic("msdosfs_fileno_map: wraparound"); - mtx_unlock(&fileno_mtx); + MSDOSFS_UNLOCK_MP(pmp); mf = malloc(sizeof(*mf), M_MSDOSFSFILENO, M_WAITOK); - mtx_lock(&fileno_mtx); + MSDOSFS_LOCK_MP(pmp); tmf = RB_FIND(msdosfs_filenotree, &pmp->pm_filenos, &key); if (tmf != NULL) { mapped = tmf->mf_fileno32; - mtx_unlock(&fileno_mtx); + MSDOSFS_UNLOCK_MP(pmp); free(mf, M_MSDOSFSFILENO); return (mapped); } mf->mf_fileno64 = fileno; mapped = mf->mf_fileno32 = pmp->pm_nfileno++; RB_INSERT(msdosfs_filenotree, &pmp->pm_filenos, mf); - mtx_unlock(&fileno_mtx); + MSDOSFS_UNLOCK_MP(pmp); return (mapped); } diff --git a/sys/fs/msdosfs/msdosfs_lookup.c b/sys/fs/msdosfs/msdosfs_lookup.c index 8e0c3d5..ce5048a 100644 --- a/sys/fs/msdosfs/msdosfs_lookup.c +++ b/sys/fs/msdosfs/msdosfs_lookup.c @@ -61,6 +61,18 @@ #include #include +static int msdosfs_lookup_(struct vnode *vdp, struct vnode **vpp, + struct componentname *cnp, u_int64_t *inum); +static int msdosfs_deget_dotdot(struct vnode *vp, u_long cluster, int blkoff, + struct vnode **rvp); + +int +msdosfs_lookup(struct vop_cachedlookup_args *ap) +{ + + return (msdosfs_lookup_(ap->a_dvp, ap->a_vpp, ap->a_cnp, NULL)); +} + /* * When we search a directory the blocks containing directory entries are * read and examined. The directory entries contain information that would @@ -76,18 +88,11 @@ * out to disk. This way disk blocks containing directory entries and in * memory denode's will be in synch. */ -int -msdosfs_lookup(ap) - struct vop_cachedlookup_args /* { - struct vnode *a_dvp; - struct vnode **a_vpp; - struct componentname *a_cnp; - } */ *ap; +static int +msdosfs_lookup_(struct vnode *vdp, struct vnode **vpp, + struct componentname *cnp, u_int64_t *dd_inum) { struct mbnambuf nb; - struct vnode *vdp = ap->a_dvp; - struct vnode **vpp = ap->a_vpp; - struct componentname *cnp = ap->a_cnp; daddr_t bn; int error; int slotcount; @@ -109,6 +114,7 @@ msdosfs_lookup(ap) int flags = cnp->cn_flags; int nameiop = cnp->cn_nameiop; int unlen; + u_int64_t inode1; int wincnt = 1; int chksum = -1, chksum_ok; @@ -119,12 +125,14 @@ msdosfs_lookup(ap) #endif dp = VTODE(vdp); pmp = dp->de_pmp; - *vpp = NULL; + if (vpp != NULL) + *vpp = NULL; #ifdef MSDOSFS_DEBUG printf("msdosfs_lookup(): vdp %p, dp %p, Attr %02x\n", vdp, dp, dp->de_Attributes); #endif + restart: /* * If they are going after the . or .. entry in the root directory, * they won't find it. DOS filesystems don't have them in the root @@ -436,6 +444,11 @@ foundroot: if (FAT32(pmp) && scn == MSDOSFSROOT) scn = pmp->pm_rootdirblk; + if (dd_inum != NULL) { + *dd_inum = (uint64_t)pmp->pm_bpcluster * scn + blkoff; + return (0); + } + /* * If deleting, and at end of pathname, return * parameters which can be used to remove file. @@ -508,23 +521,25 @@ foundroot: * inodes from the root, moving down the directory tree. Thus * when following backward pointers ".." we must unlock the * parent directory before getting the requested directory. - * There is a potential race condition here if both the current - * and parent directories are removed before the VFS_VGET for the - * inode associated with ".." returns. We hope that this occurs - * infrequently since we cannot avoid this race condition without - * implementing a sophisticated deadlock detection algorithm. - * Note also that this simple deadlock detection scheme will not - * work if the filesystem has any hard links other than ".." - * that point backwards in the directory structure. */ pdp = vdp; if (flags & ISDOTDOT) { - VOP_UNLOCK(pdp, 0); - error = deget(pmp, cluster, blkoff, &tdp); - vn_lock(pdp, LK_EXCLUSIVE | LK_RETRY); + error = msdosfs_deget_dotdot(pdp, cluster, blkoff, vpp); if (error) return (error); - *vpp = DETOV(tdp); + /* + * Recheck that ".." still points to the inode we + * looked up before pdp lock was dropped. + */ + error = msdosfs_lookup_(pdp, NULL, cnp, &inode1); + if (error) { + vput(*vpp); + return (error); + } + if (VTODE(*vpp)->de_inode != inode1) { + vput(*vpp); + goto restart; + } } else if (dp->de_StartCluster == scn && isadir) { VREF(vdp); /* we want ourself, ie "." */ *vpp = vdp; @@ -542,6 +557,49 @@ foundroot: return (0); } +static int +msdosfs_deget_dotdot(struct vnode *vp, u_long cluster, int blkoff, + struct vnode **rvp) +{ + struct mount *mp; + struct msdosfsmount *pmp; + struct denode *rdp; + int ltype, error; + + mp = vp->v_mount; + pmp = VFSTOMSDOSFS(mp); + ltype = VOP_ISLOCKED(vp); + KASSERT(ltype == LK_EXCLUSIVE || ltype == LK_SHARED, + ("msdosfs_deget_dotdot: vp not locked")); + + error = vfs_busy(mp, MBF_NOWAIT); + if (error != 0) { + vfs_ref(mp); + VOP_UNLOCK(vp, 0); + error = vfs_busy(mp, 0); + vn_lock(vp, ltype | LK_RETRY); + vfs_rel(mp); + if (error != 0) + return (ENOENT); + if (vp->v_iflag & VI_DOOMED) { + vfs_unbusy(mp); + return (ENOENT); + } + } + VOP_UNLOCK(vp, 0); + error = deget(pmp, cluster, blkoff, &rdp); + vfs_unbusy(mp); + if (error == 0) + *rvp = DETOV(rdp); + vn_lock(vp, ltype | LK_RETRY); + if (vp->v_iflag & VI_DOOMED) { + if (error == 0) + vput(*rvp); + error = ENOENT; + } + return (error); +} + /* * dep - directory entry to copy into the directory * ddep - directory to add to diff --git a/sys/fs/msdosfs/msdosfs_vfsops.c b/sys/fs/msdosfs/msdosfs_vfsops.c index 8186763..3cecd73 100644 --- a/sys/fs/msdosfs/msdosfs_vfsops.c +++ b/sys/fs/msdosfs/msdosfs_vfsops.c @@ -75,6 +75,8 @@ #include #include +static const char msdosfs_lock_msg[] = "fatlk"; + /* Mount options that we support. */ static const char *msdosfs_opts[] = { "async", "noatime", "noclusterr", "noclusterw", @@ -466,6 +468,8 @@ mountmsdosfs(struct vnode *devvp, struct mount *mp) pmp->pm_cp = cp; pmp->pm_bo = bo; + lockinit(&pmp->pm_fatlock, 0, msdosfs_lock_msg, 0, 0); + /* * Initialize ownerships and permissions, since nothing else will * initialize them iff we are mounting root. @@ -716,7 +720,10 @@ mountmsdosfs(struct vnode *devvp, struct mount *mp) /* * Have the inuse map filled in. */ - if ((error = fillinusemap(pmp)) != 0) + MSDOSFS_LOCK_MP(pmp); + error = fillinusemap(pmp); + MSDOSFS_UNLOCK_MP(pmp); + if (error != 0) goto error_exit; /* @@ -745,6 +752,7 @@ mountmsdosfs(struct vnode *devvp, struct mount *mp) mp->mnt_stat.f_fsid.val[1] = mp->mnt_vfc->vfc_typenum; MNT_ILOCK(mp); mp->mnt_flag |= MNT_LOCAL; + mp->mnt_kern_flag |= MNTK_MPSAFE; MNT_IUNLOCK(mp); if (pmp->pm_flags & MSDOSFS_LARGEFS) @@ -762,6 +770,7 @@ error_exit: g_topology_unlock(); PICKUP_GIANT(); } + lockdestroy(&pmp->pm_fatlock); if (pmp) { if (pmp->pm_inusemap) free(pmp->pm_inusemap, M_MSDOSFSFAT); @@ -837,6 +846,7 @@ msdosfs_unmount(struct mount *mp, int mntflags) free(pmp->pm_inusemap, M_MSDOSFSFAT); if (pmp->pm_flags & MSDOSFS_LARGEFS) msdosfs_fileno_free(mp); + lockdestroy(&pmp->pm_fatlock); free(pmp, M_MSDOSFSMNT); mp->mnt_data = NULL; MNT_ILOCK(mp); diff --git a/sys/fs/msdosfs/msdosfsmount.h b/sys/fs/msdosfs/msdosfsmount.h index bfe3ec3..2951b2c 100644 --- a/sys/fs/msdosfs/msdosfsmount.h +++ b/sys/fs/msdosfs/msdosfsmount.h @@ -53,6 +53,9 @@ #ifdef _KERNEL +#include +#include +#include #include #ifdef MALLOC_DECLARE @@ -106,7 +109,9 @@ struct msdosfsmount { void *pm_u2d; /* Unicode->DOS iconv handle */ void *pm_d2u; /* DOS->Local iconv handle */ u_int32_t pm_nfileno; /* next 32-bit fileno */ - RB_HEAD(msdosfs_filenotree, msdosfs_fileno) pm_filenos; /* 64<->32-bit fileno mapping */ + RB_HEAD(msdosfs_filenotree, msdosfs_fileno) + pm_filenos; /* 64<->32-bit fileno mapping */ + struct lock pm_fatlock; /* lockmgr protecting allocations and rb tree */ }; /* @@ -215,6 +220,13 @@ void msdosfs_fileno_init(struct mount *); void msdosfs_fileno_free(struct mount *); uint32_t msdosfs_fileno_map(struct mount *, uint64_t); +#define MSDOSFS_LOCK_MP(pmp) \ + lockmgr(&(pmp)->pm_fatlock, LK_EXCLUSIVE, NULL) +#define MSDOSFS_UNLOCK_MP(pmp) \ + lockmgr(&(pmp)->pm_fatlock, LK_RELEASE, NULL) +#define MSDOSFS_ASSERT_MP_LOCKED(pmp) \ + lockmgr_assert(&(pmp)->pm_fatlock, KA_XLOCKED) + #endif /* _KERNEL */ /* diff --git a/sys/fs/nfs/nfs_var.h b/sys/fs/nfs/nfs_var.h index 17714d7..592be4a 100644 --- a/sys/fs/nfs/nfs_var.h +++ b/sys/fs/nfs/nfs_var.h @@ -570,8 +570,6 @@ vnode_t nfsvno_getvp(fhandle_t *); int nfsvno_localconflict(vnode_t, int, u_int64_t, u_int64_t, struct nfslockconflict *, NFSPROC_T *); int nfsvno_advlock(vnode_t, int, u_int64_t, u_int64_t, NFSPROC_T *); -void nfsvno_unlockvfs(mount_t); -int nfsvno_lockvfs(mount_t); int nfsrv_v4rootexport(void *, struct ucred *, NFSPROC_T *); int nfsvno_testexp(struct nfsrv_descript *, struct nfsexstuff *); diff --git a/sys/fs/nfs/nfsdport.h b/sys/fs/nfs/nfsdport.h index 42dbe08..8f79a53 100644 --- a/sys/fs/nfs/nfsdport.h +++ b/sys/fs/nfs/nfsdport.h @@ -52,7 +52,6 @@ * needs to be returned by nfsd_fhtovp(). */ struct nfsexstuff { - int nes_vfslocked; /* required for all ports */ int nes_exflag; /* export flags */ int nes_numsecflavor; /* # of security flavors */ int nes_secflavors[MAXSECFLAVORS]; /* and the flavors */ diff --git a/sys/fs/nfsserver/nfs_nfsdport.c b/sys/fs/nfsserver/nfs_nfsdport.c index 3b7f8d0..7e2b955 100644 --- a/sys/fs/nfsserver/nfs_nfsdport.c +++ b/sys/fs/nfsserver/nfs_nfsdport.c @@ -319,18 +319,7 @@ nfsvno_namei(struct nfsrv_descript *nd, struct nameidata *ndp, * In either case ni_startdir will be dereferenced and NULLed * out. */ - if (exp->nes_vfslocked) - ndp->ni_cnd.cn_flags |= GIANTHELD; error = lookup(ndp); - /* - * The Giant lock should only change when - * crossing mount points. - */ - if (crossmnt) { - exp->nes_vfslocked = - (ndp->ni_cnd.cn_flags & GIANTHELD) != 0; - ndp->ni_cnd.cn_flags &= ~GIANTHELD; - } if (error) break; @@ -1922,8 +1911,7 @@ again: cn.cn_nameptr = dp->d_name; cn.cn_namelen = nlen; cn.cn_flags = ISLASTCN | - NOFOLLOW | LOCKLEAF | - MPSAFE; + NOFOLLOW | LOCKLEAF; if (nlen == 2 && dp->d_name[0] == '.' && dp->d_name[1] == '.') @@ -2482,19 +2470,6 @@ nfsvno_pathconf(struct vnode *vp, int flag, register_t *retf, * - get vp and export rights by calling nfsvno_fhtovp() * - if cred->cr_uid == 0 or MNT_EXPORTANON set it to credanon * for AUTH_SYS - * Also handle getting the Giant lock for the file system, - * as required: - * - if same mount point as *mpp - * do nothing - * else if *mpp == NULL - * if already locked - * leave it locked - * else - * call VFS_LOCK_GIANT() - * else - * if already locked - * unlock Giant - * call VFS_LOCK_GIANT() */ void nfsd_fhtovp(struct nfsrv_descript *nd, struct nfsrvfh *nfp, @@ -2513,23 +2488,10 @@ nfsd_fhtovp(struct nfsrv_descript *nd, struct nfsrvfh *nfp, if (!mp) { *vpp = NULL; nd->nd_repstat = ESTALE; - if (*mpp && exp->nes_vfslocked) - VFS_UNLOCK_GIANT(*mpp); *mpp = NULL; - exp->nes_vfslocked = 0; return; } - /* - * Now, handle Giant for the file system. - */ - if (*mpp != NULL && *mpp != mp && exp->nes_vfslocked) { - VFS_UNLOCK_GIANT(*mpp); - exp->nes_vfslocked = 0; - } - if (!exp->nes_vfslocked && *mpp != mp) - exp->nes_vfslocked = VFS_LOCK_GIANT(mp); - *mpp = mp; if (startwrite) vn_start_write(NULL, mpp, V_WAIT); @@ -2593,10 +2555,6 @@ nfsd_fhtovp(struct nfsrv_descript *nd, struct nfsrvfh *nfp, if (nd->nd_repstat) { if (startwrite) vn_finished_write(mp); - if (exp->nes_vfslocked) { - VFS_UNLOCK_GIANT(mp); - exp->nes_vfslocked = 0; - } vfs_rel(mp); *vpp = NULL; *mpp = NULL; @@ -2645,7 +2603,7 @@ nfsrv_v4rootexport(void *argp, struct ucred *cred, struct thread *p) /* * If fspec != NULL, this is the v4root path. */ - NDINIT(&nd, LOOKUP, FOLLOW | MPSAFE, UIO_USERSPACE, + NDINIT(&nd, LOOKUP, FOLLOW, UIO_USERSPACE, nfsexargp->fspec, p); if ((error = namei(&nd)) != 0) return (error); @@ -2855,29 +2813,6 @@ nfsvno_advlock(struct vnode *vp, int ftype, u_int64_t first, } /* - * Unlock an underlying local file system. - */ -void -nfsvno_unlockvfs(struct mount *mp) -{ - - VFS_UNLOCK_GIANT(mp); -} - -/* - * Lock an underlying file system, as required, and return - * whether or not it is locked. - */ -int -nfsvno_lockvfs(struct mount *mp) -{ - int ret; - - ret = VFS_LOCK_GIANT(mp); - return (ret); -} - -/* * Check the nfsv4 root exports. */ int diff --git a/sys/fs/nfsserver/nfs_nfsdserv.c b/sys/fs/nfsserver/nfs_nfsdserv.c index e56610b..9d2ffcf 100644 --- a/sys/fs/nfsserver/nfs_nfsdserv.c +++ b/sys/fs/nfsserver/nfs_nfsdserv.c @@ -1390,8 +1390,6 @@ nfsrvd_rename(struct nfsrv_descript *nd, int isdgram, return (error); } nd->nd_cred->cr_uid = nd->nd_saveduid; - /* Won't lock vfs if already locked, mp == NULL */ - tnes.nes_vfslocked = exp->nes_vfslocked; nfsd_fhtovp(nd, &tfh, &tdp, &tnes, &mp, 0, p); if (tdp) { tdirfor_ret = nfsvno_getattr(tdp, &tdirfor, nd->nd_cred, @@ -1404,12 +1402,8 @@ nfsrvd_rename(struct nfsrv_descript *nd, int isdgram, if (!nd->nd_repstat) { error = nfsrv_parsename(nd, tbufp, hashp, &tond.ni_pathlen); if (error) { - if (tdp) { - if (tnes.nes_vfslocked && !exp->nes_vfslocked && - !(nd->nd_flag & ND_NFSV4)) - nfsvno_unlockvfs(mp); + if (tdp) vrele(tdp); - } vput(dp); nfsvno_relpathbuf(&fromnd); nfsvno_relpathbuf(&tond); @@ -1423,12 +1417,8 @@ nfsrvd_rename(struct nfsrv_descript *nd, int isdgram, nfsrv_wcc(nd, tdirfor_ret, &tdirfor, tdiraft_ret, &tdiraft); } - if (tdp) { - if (tnes.nes_vfslocked && !exp->nes_vfslocked && - !(nd->nd_flag & ND_NFSV4)) - nfsvno_unlockvfs(mp); + if (tdp) vrele(tdp); - } vput(dp); nfsvno_relpathbuf(&fromnd); nfsvno_relpathbuf(&tond); @@ -1448,12 +1438,8 @@ nfsrvd_rename(struct nfsrv_descript *nd, int isdgram, } if (fdirp) vrele(fdirp); - if (tdp) { - if (tnes.nes_vfslocked && !exp->nes_vfslocked && - !(nd->nd_flag & ND_NFSV4)) - nfsvno_unlockvfs(mp); + if (tdp) vrele(tdp); - } nfsvno_relpathbuf(&tond); return (0); } @@ -1466,9 +1452,6 @@ nfsrvd_rename(struct nfsrv_descript *nd, int isdgram, fdiraft_ret = nfsvno_getattr(fdirp, &fdiraft, nd->nd_cred, p); if (tdirp) tdiraft_ret = nfsvno_getattr(tdirp, &tdiraft, nd->nd_cred, p); - if (tnes.nes_vfslocked && !exp->nes_vfslocked && - !(nd->nd_flag & ND_NFSV4)) - nfsvno_unlockvfs(mp); if (fdirp) vrele(fdirp); if (tdirp) @@ -1543,7 +1526,6 @@ nfsrvd_link(struct nfsrv_descript *nd, int isdgram, return (error); } /* Won't lock vfs if already locked, mp == NULL */ - tnes.nes_vfslocked = exp->nes_vfslocked; nfsd_fhtovp(nd, &dfh, &dp, &tnes, &mp, 0, p); if (dp) NFSVOPUNLOCK(dp, 0, p); @@ -1555,12 +1537,8 @@ nfsrvd_link(struct nfsrv_descript *nd, int isdgram, error = nfsrv_parsename(nd, bufp, hashp, &named.ni_pathlen); if (error) { vrele(vp); - if (dp) { - if (tnes.nes_vfslocked && !exp->nes_vfslocked && - !(nd->nd_flag & ND_NFSV4)) - nfsvno_unlockvfs(mp); + if (dp) vrele(dp); - } nfsvno_relpathbuf(&named); return (error); } @@ -1590,9 +1568,6 @@ nfsrvd_link(struct nfsrv_descript *nd, int isdgram, diraft_ret = nfsvno_getattr(dirp, &diraft, nd->nd_cred, p); vrele(dirp); } - if (tnes.nes_vfslocked && !exp->nes_vfslocked && - !(nd->nd_flag & ND_NFSV4)) - nfsvno_unlockvfs(mp); vrele(vp); if (nd->nd_flag & ND_NFSV3) { nfsrv_postopattr(nd, getret, &at); @@ -3114,7 +3089,6 @@ nfsrvd_secinfo(struct nfsrv_descript *nd, int isdgram, vp = named.ni_vp; nd->nd_repstat = nfsvno_getfh(vp, (fhandle_t *)fh.nfsrvfh_data, p); mp = vnode_mount(vp); /* so it won't try to re-lock filesys */ - retnes.nes_vfslocked = exp->nes_vfslocked; vput(vp); savflag = nd->nd_flag; if (!nd->nd_repstat) { diff --git a/sys/fs/nfsserver/nfs_nfsdsocket.c b/sys/fs/nfsserver/nfs_nfsdsocket.c index fc6e39e..32f1b92 100644 --- a/sys/fs/nfsserver/nfs_nfsdsocket.c +++ b/sys/fs/nfsserver/nfs_nfsdsocket.c @@ -383,7 +383,6 @@ nfsrvd_dorpc(struct nfsrv_descript *nd, int isdgram, nd->nd_repstat = NFSERR_GARBAGE; return; } - nes.nes_vfslocked = 0; if (nd->nd_flag & ND_PUBLOOKUP) nfsd_fhtovp(nd, &nfs_pubfh, &vp, &nes, &mp, nfs_writerpc[nd->nd_procnum], p); @@ -415,8 +414,6 @@ nfsrvd_dorpc(struct nfsrv_descript *nd, int isdgram, if (mp != NULL) { if (nfs_writerpc[nd->nd_procnum]) NFS_ENDWRITE(mp); - if (nes.nes_vfslocked) - nfsvno_unlockvfs(mp); } return; } @@ -445,8 +442,6 @@ nfsrvd_dorpc(struct nfsrv_descript *nd, int isdgram, if (mp) { if (nfs_writerpc[nd->nd_procnum]) NFS_ENDWRITE(mp); - if (nes.nes_vfslocked) - nfsvno_unlockvfs(mp); } NFSINCRGLOBAL(newnfsstats.srvrpccnt[nfsv3to4op[nd->nd_procnum]]); } @@ -596,7 +591,6 @@ nfsrvd_compound(struct nfsrv_descript *nd, int isdgram, } savevp = vp = NULL; - savevpnes.nes_vfslocked = vpnes.nes_vfslocked = 0; savemp = mp = NULL; NFSM_DISSECT(tl, u_int32_t *, NFSX_UNSIGNED); taglen = fxdr_unsigned(int, *tl); @@ -704,7 +698,6 @@ nfsrvd_compound(struct nfsrv_descript *nd, int isdgram, if (error) goto nfsmout; if (!nd->nd_repstat) { - nes.nes_vfslocked = vpnes.nes_vfslocked; nfsd_fhtovp(nd, &fh, &nvp, &nes, &mp, 0, p); } @@ -719,7 +712,6 @@ nfsrvd_compound(struct nfsrv_descript *nd, int isdgram, break; case NFSV4OP_PUTPUBFH: if (nfs_pubfhset) { - nes.nes_vfslocked = vpnes.nes_vfslocked; nfsd_fhtovp(nd, &nfs_pubfh, &nvp, &nes, &mp, 0, p); } else { @@ -735,7 +727,6 @@ nfsrvd_compound(struct nfsrv_descript *nd, int isdgram, break; case NFSV4OP_PUTROOTFH: if (nfs_rootfhset) { - nes.nes_vfslocked = vpnes.nes_vfslocked; nfsd_fhtovp(nd, &nfs_rootfh, &nvp, &nes, &mp, 0, p); if (!nd->nd_repstat) { @@ -746,15 +737,11 @@ nfsrvd_compound(struct nfsrv_descript *nd, int isdgram, vpnes = nes; } } else if (nfsv4root_vp && nfsv4root_set) { - if (vp) { - if (vpnes.nes_vfslocked) - nfsvno_unlockvfs(mp); + if (vp) vrele(vp); - } vp = nfsv4root_vp; VREF(vp); NFSVNO_SETEXRDONLY(&vpnes); - vpnes.nes_vfslocked = 0; mp = vnode_mount(vp); } else { nd->nd_repstat = NFSERR_NOFILEHANDLE; @@ -782,19 +769,6 @@ nfsrvd_compound(struct nfsrv_descript *nd, int isdgram, /* If vp == savevp, a no-op */ if (vp != savevp) { VREF(savevp); - if (mp == NULL || savemp == NULL) - panic("nfscmpmp"); - if (!savevpnes.nes_vfslocked && - vpnes.nes_vfslocked) { - if (mp == savemp) - panic("nfscmp2"); - nfsvno_unlockvfs(mp); - } else if (savevpnes.nes_vfslocked && - !vpnes.nes_vfslocked) { - if (mp == savemp) - panic("nfscmp3"); - savevpnes.nes_vfslocked = nfsvno_lockvfs(savemp); - } vrele(vp); vp = savevp; vpnes = savevpnes; @@ -860,10 +834,6 @@ nfsrvd_compound(struct nfsrv_descript *nd, int isdgram, NFSV4ROOT_FSID0 && vfs_statfs(vnode_mount(nvp))->f_fsid.val[1] == NFSV4ROOT_FSID1) { - if (vpnes.nes_vfslocked) { - nfsvno_unlockvfs(mp); - vpnes.nes_vfslocked = 0; - } NFSVNO_SETEXRDONLY(&vpnes); mp = vnode_mount(nvp); } else { @@ -875,12 +845,8 @@ nfsrvd_compound(struct nfsrv_descript *nd, int isdgram, if (credanon != NULL) crfree(credanon); if (!nd->nd_repstat) { - if (vpnes.nes_vfslocked) - nfsvno_unlockvfs(mp); mp = vnode_mount(nvp); vpnes = nes; - vpnes.nes_vfslocked = - nfsvno_lockvfs(mp); } } } @@ -971,8 +937,6 @@ nfsmout: } else { *retopsp = txdr_unsigned(retops); } - if (mp && vpnes.nes_vfslocked) - nfsvno_unlockvfs(mp); if (vp) vrele(vp); if (savevp) diff --git a/sys/fs/procfs/procfs_map.c b/sys/fs/procfs/procfs_map.c index 878e2d5..77bf7e4 100644 --- a/sys/fs/procfs/procfs_map.c +++ b/sys/fs/procfs/procfs_map.c @@ -84,7 +84,7 @@ procfs_doprocmap(PFS_FILL_ARGS) struct vnode *vp; char *fullpath, *freepath; struct uidinfo *uip; - int error, vfslocked; + int error; unsigned int last_timestamp; #ifdef COMPAT_IA32 int wrap32 = 0; @@ -189,9 +189,7 @@ procfs_doprocmap(PFS_FILL_ARGS) VM_OBJECT_UNLOCK(obj); if (vp != NULL) { vn_fullpath(td, vp, &fullpath, &freepath); - vfslocked = VFS_LOCK_GIANT(vp->v_mount); vrele(vp); - VFS_UNLOCK_GIANT(vfslocked); } } else { type = "none"; diff --git a/sys/fs/unionfs/union_subr.c b/sys/fs/unionfs/union_subr.c index 0791d2e..a9f1a2d 100644 --- a/sys/fs/unionfs/union_subr.c +++ b/sys/fs/unionfs/union_subr.c @@ -331,7 +331,6 @@ unionfs_nodeget_out: void unionfs_noderem(struct vnode *vp, struct thread *td) { - int vfslocked; int count; struct unionfs_node *unp, *unp_t1, *unp_t2; struct unionfs_node_hashhead *hd; @@ -363,20 +362,12 @@ unionfs_noderem(struct vnode *vp, struct thread *td) if (dvp != NULLVP && unp->un_hash.le_prev != NULL) unionfs_rem_cached_vnode(unp, dvp); - if (lvp != NULLVP) { - vfslocked = VFS_LOCK_GIANT(lvp->v_mount); + if (lvp != NULLVP) vrele(lvp); - VFS_UNLOCK_GIANT(vfslocked); - } - if (uvp != NULLVP) { - vfslocked = VFS_LOCK_GIANT(uvp->v_mount); + if (uvp != NULLVP) vrele(uvp); - VFS_UNLOCK_GIANT(vfslocked); - } if (dvp != NULLVP) { - vfslocked = VFS_LOCK_GIANT(dvp->v_mount); vrele(dvp); - VFS_UNLOCK_GIANT(vfslocked); unp->un_dvp = NULLVP; } if (unp->un_path != NULL) { diff --git a/sys/geom/geom_vfs.c b/sys/geom/geom_vfs.c index 9d01f40..5fe6b56 100644 --- a/sys/geom/geom_vfs.c +++ b/sys/geom/geom_vfs.c @@ -33,7 +33,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include /* XXX Temporary for VFS_LOCK_GIANT */ #include #include @@ -69,7 +68,6 @@ static void g_vfs_done(struct bio *bip) { struct buf *bp; - int vfslocked; /* * Provider ('bio_to') could have withered away sometime @@ -93,9 +91,7 @@ g_vfs_done(struct bio *bip) bp->b_ioflags |= BIO_ERROR; bp->b_resid = bp->b_bcount - bip->bio_completed; g_destroy_bio(bip); - vfslocked = VFS_LOCK_GIANT(((struct mount *)NULL)); bufdone(bp); - VFS_UNLOCK_GIANT(vfslocked); } void @@ -103,7 +99,6 @@ g_vfs_strategy(struct bufobj *bo, struct buf *bp) { struct g_consumer *cp; struct bio *bip; - int vfslocked; cp = bo->bo_private; /* G_VALID_CONSUMER(cp); We likely lack topology lock */ @@ -114,9 +109,7 @@ g_vfs_strategy(struct bufobj *bo, struct buf *bp) if (cp->provider == NULL) { bp->b_error = ENXIO; bp->b_ioflags |= BIO_ERROR; - vfslocked = VFS_LOCK_GIANT(((struct mount *)NULL)); bufdone(bp); - VFS_UNLOCK_GIANT(vfslocked); return; } @@ -155,7 +148,6 @@ g_vfs_open(struct vnode *vp, struct g_consumer **cpp, const char *fsname, int wr struct g_provider *pp; struct g_consumer *cp; struct bufobj *bo; - int vfslocked; int error; g_topology_assert(); @@ -172,9 +164,7 @@ g_vfs_open(struct vnode *vp, struct g_consumer **cpp, const char *fsname, int wr g_wither_geom(gp, ENXIO); return (error); } - vfslocked = VFS_LOCK_GIANT(vp->v_mount); vnode_create_vobject(vp, pp->mediasize, curthread); - VFS_UNLOCK_GIANT(vfslocked); *cpp = cp; bo = &vp->v_bufobj; bo->bo_ops = g_vfs_bufops; diff --git a/sys/geom/journal/g_journal.c b/sys/geom/journal/g_journal.c index 16a26f1..ecb1862 100644 --- a/sys/geom/journal/g_journal.c +++ b/sys/geom/journal/g_journal.c @@ -2868,7 +2868,7 @@ g_journal_do_switch(struct g_class *classp) struct mount *mp; struct bintime bt; char *mountpoint; - int error, vfslocked; + int error; DROP_GIANT(); g_topology_lock(); @@ -2920,11 +2920,8 @@ g_journal_do_switch(struct g_class *classp) mountpoint = mp->mnt_stat.f_mntonname; - vfslocked = VFS_LOCK_GIANT(mp); - error = vn_start_write(NULL, &mp, V_WAIT); if (error != 0) { - VFS_UNLOCK_GIANT(vfslocked); GJ_DEBUG(0, "vn_start_write(%s) failed (error=%d).", mountpoint, error); goto next; @@ -2956,10 +2953,8 @@ g_journal_do_switch(struct g_class *classp) vn_finished_write(mp); - if (error != 0) { - VFS_UNLOCK_GIANT(vfslocked); + if (error != 0) goto next; - } /* * Send BIO_FLUSH before freezing the file system, so it can be @@ -2971,7 +2966,6 @@ g_journal_do_switch(struct g_class *classp) GJ_TIMER_START(1, &bt); error = vfs_write_suspend(mp); - VFS_UNLOCK_GIANT(vfslocked); GJ_TIMER_STOP(1, &bt, "Suspend time of %s", mountpoint); if (error != 0) { GJ_DEBUG(0, "Cannot suspend file system %s (error=%d).", diff --git a/sys/i386/ibcs2/ibcs2_misc.c b/sys/i386/ibcs2/ibcs2_misc.c index c537100..d845717 100644 --- a/sys/i386/ibcs2/ibcs2_misc.c +++ b/sys/i386/ibcs2/ibcs2_misc.c @@ -330,7 +330,7 @@ ibcs2_getdents(td, uap) struct iovec aiov; struct ibcs2_dirent idb; off_t off; /* true file offset */ - int buflen, error, eofflag, vfslocked; + int buflen, error, eofflag; u_long *cookies = NULL, *cookiep; int ncookies; #define BSD_DIRENT(cp) ((struct dirent *)(cp)) @@ -343,9 +343,7 @@ ibcs2_getdents(td, uap) return (EBADF); } vp = fp->f_vnode; - vfslocked = VFS_LOCK_GIANT(vp->v_mount); if (vp->v_type != VDIR) { /* XXX vnode readdir op should do this */ - VFS_UNLOCK_GIANT(vfslocked); fdrop(fp, td); return (EINVAL); } @@ -462,7 +460,6 @@ eof: td->td_retval[0] = uap->nbytes - resid; out: VOP_UNLOCK(vp, 0); - VFS_UNLOCK_GIANT(vfslocked); fdrop(fp, td); if (cookies) free(cookies, M_TEMP); @@ -488,7 +485,7 @@ ibcs2_read(td, uap) char name[14]; } idb; off_t off; /* true file offset */ - int buflen, error, eofflag, size, vfslocked; + int buflen, error, eofflag, size; u_long *cookies = NULL, *cookiep; int ncookies; @@ -503,9 +500,7 @@ ibcs2_read(td, uap) return (EBADF); } vp = fp->f_vnode; - vfslocked = VFS_LOCK_GIANT(vp->v_mount); if (vp->v_type != VDIR) { - VFS_UNLOCK_GIANT(vfslocked); fdrop(fp, td); return read(td, (struct read_args *)uap); } @@ -628,7 +623,6 @@ eof: td->td_retval[0] = uap->nbytes - resid; out: VOP_UNLOCK(vp, 0); - VFS_UNLOCK_GIANT(vfslocked); fdrop(fp, td); if (cookies) free(cookies, M_TEMP); diff --git a/sys/kern/imgact_elf.c b/sys/kern/imgact_elf.c index 56cd66f..42c0670 100644 --- a/sys/kern/imgact_elf.c +++ b/sys/kern/imgact_elf.c @@ -561,7 +561,7 @@ __elfN(load_file)(struct proc *p, const char *file, u_long *addr, vm_prot_t prot; u_long rbase; u_long base_addr = 0; - int vfslocked, error, i, numsegs; + int error, i, numsegs; tempdata = malloc(sizeof(*tempdata), M_TEMP, M_WAITOK); nd = &tempdata->nd; @@ -578,14 +578,11 @@ __elfN(load_file)(struct proc *p, const char *file, u_long *addr, imgp->object = NULL; imgp->execlabel = NULL; - NDINIT(nd, LOOKUP, MPSAFE|LOCKLEAF|FOLLOW, UIO_SYSSPACE, file, - curthread); - vfslocked = 0; + NDINIT(nd, LOOKUP, LOCKLEAF | FOLLOW, UIO_SYSSPACE, file, curthread); if ((error = namei(nd)) != 0) { nd->ni_vp = NULL; goto fail; } - vfslocked = NDHASGIANT(nd); NDFREE(nd, NDF_ONLY_PNBUF); imgp->vp = nd->ni_vp; @@ -671,7 +668,6 @@ fail: if (nd->ni_vp) vput(nd->ni_vp); - VFS_UNLOCK_GIANT(vfslocked); free(tempdata, M_TEMP); return (error); diff --git a/sys/kern/kern_acct.c b/sys/kern/kern_acct.c index 049600a..344d70d 100644 --- a/sys/kern/kern_acct.c +++ b/sys/kern/kern_acct.c @@ -196,7 +196,7 @@ int acct(struct thread *td, struct acct_args *uap) { struct nameidata nd; - int error, flags, vfslocked; + int error, flags; error = priv_check(td, PRIV_ACCT); if (error) @@ -207,30 +207,26 @@ acct(struct thread *td, struct acct_args *uap) * appending and make sure it's a 'normal'. */ if (uap->path != NULL) { - NDINIT(&nd, LOOKUP, NOFOLLOW | MPSAFE | AUDITVNODE1, + NDINIT(&nd, LOOKUP, NOFOLLOW | AUDITVNODE1, UIO_USERSPACE, uap->path, td); flags = FWRITE | O_APPEND; error = vn_open(&nd, &flags, 0, NULL); if (error) return (error); - vfslocked = NDHASGIANT(&nd); NDFREE(&nd, NDF_ONLY_PNBUF); #ifdef MAC error = mac_system_check_acct(td->td_ucred, nd.ni_vp); if (error) { VOP_UNLOCK(nd.ni_vp, 0); vn_close(nd.ni_vp, flags, td->td_ucred, td); - VFS_UNLOCK_GIANT(vfslocked); return (error); } #endif VOP_UNLOCK(nd.ni_vp, 0); if (nd.ni_vp->v_type != VREG) { vn_close(nd.ni_vp, flags, td->td_ucred, td); - VFS_UNLOCK_GIANT(vfslocked); return (EACCES); } - VFS_UNLOCK_GIANT(vfslocked); #ifdef MAC } else { error = mac_system_check_acct(td->td_ucred, NULL); @@ -252,11 +248,8 @@ acct(struct thread *td, struct acct_args *uap) * enabled. */ acct_suspended = 0; - if (acct_vp != NULL) { - vfslocked = VFS_LOCK_GIANT(acct_vp->v_mount); + if (acct_vp != NULL) error = acct_disable(td); - VFS_UNLOCK_GIANT(vfslocked); - } if (uap->path == NULL) { if (acct_state & ACCT_RUNNING) { acct_state |= ACCT_EXITREQ; @@ -284,9 +277,7 @@ acct(struct thread *td, struct acct_args *uap) error = kproc_create(acct_thread, NULL, NULL, 0, 0, "accounting"); if (error) { - vfslocked = VFS_LOCK_GIANT(acct_vp->v_mount); (void) vn_close(acct_vp, acct_flags, acct_cred, td); - VFS_UNLOCK_GIANT(vfslocked); crfree(acct_cred); acct_configured = 0; acct_vp = NULL; @@ -337,7 +328,7 @@ acct_process(struct thread *td) struct plimit *newlim, *oldlim; struct proc *p; struct rusage ru; - int t, ret, vfslocked; + int t, ret; /* * Lockless check of accounting condition before doing the hard @@ -433,11 +424,9 @@ acct_process(struct thread *td) /* * Write the accounting information to the file. */ - vfslocked = VFS_LOCK_GIANT(acct_vp->v_mount); ret = vn_rdwr(UIO_WRITE, acct_vp, (caddr_t)&acct, sizeof (acct), (off_t)0, UIO_SYSSPACE, IO_APPEND|IO_UNIT, acct_cred, NOCRED, NULL, td); - VFS_UNLOCK_GIANT(vfslocked); sx_sunlock(&acct_sx); return (ret); } @@ -554,7 +543,6 @@ static void acctwatch(void) { struct statfs sb; - int vfslocked; sx_assert(&acct_sx, SX_XLOCKED); @@ -572,10 +560,8 @@ acctwatch(void) * If our vnode is no longer valid, tear it down and signal the * accounting thread to die. */ - vfslocked = VFS_LOCK_GIANT(acct_vp->v_mount); if (acct_vp->v_type == VBAD) { (void) acct_disable(NULL); - VFS_UNLOCK_GIANT(vfslocked); acct_state |= ACCT_EXITREQ; return; } @@ -584,11 +570,8 @@ acctwatch(void) * Stopping here is better than continuing, maybe it will be VBAD * next time around. */ - if (VFS_STATFS(acct_vp->v_mount, &sb) < 0) { - VFS_UNLOCK_GIANT(vfslocked); + if (VFS_STATFS(acct_vp->v_mount, &sb) < 0) return; - } - VFS_UNLOCK_GIANT(vfslocked); if (acct_suspended) { if (sb.f_bavail > (int64_t)(acctresume * sb.f_blocks / 100)) { diff --git a/sys/kern/kern_alq.c b/sys/kern/kern_alq.c index a4ece79..1d3ef53 100644 --- a/sys/kern/kern_alq.c +++ b/sys/kern/kern_alq.c @@ -246,7 +246,6 @@ alq_doio(struct alq *alq) struct ale *alstart; int totlen; int iov; - int vfslocked; vp = alq->aq_vp; td = curthread; @@ -288,7 +287,6 @@ alq_doio(struct alq *alq) /* * Do all of the junk required to write now. */ - vfslocked = VFS_LOCK_GIANT(vp->v_mount); vn_start_write(vp, &mp, V_WAIT); vn_lock(vp, LK_EXCLUSIVE | LK_RETRY); /* @@ -300,7 +298,6 @@ alq_doio(struct alq *alq) VOP_WRITE(vp, &auio, IO_UNIT | IO_APPEND, alq->aq_cred); VOP_UNLOCK(vp, 0); vn_finished_write(mp); - VFS_UNLOCK_GIANT(vfslocked); ALQ_LOCK(alq); alq->aq_flags &= ~AQ_FLUSHING; @@ -343,23 +340,21 @@ alq_open(struct alq **alqp, const char *file, struct ucred *cred, int cmode, char *bufp; int flags; int error; - int i, vfslocked; + int i; *alqp = NULL; td = curthread; - NDINIT(&nd, LOOKUP, NOFOLLOW | MPSAFE, UIO_SYSSPACE, file, td); + NDINIT(&nd, LOOKUP, NOFOLLOW, UIO_SYSSPACE, file, td); flags = FWRITE | O_NOFOLLOW | O_CREAT; error = vn_open_cred(&nd, &flags, cmode, 0, cred, NULL); if (error) return (error); - vfslocked = NDHASGIANT(&nd); NDFREE(&nd, NDF_ONLY_PNBUF); /* We just unlock so we hold a reference */ VOP_UNLOCK(nd.ni_vp, 0); - VFS_UNLOCK_GIANT(vfslocked); alq = malloc(sizeof(*alq), M_ALD, M_WAITOK|M_ZERO); alq->aq_entbuf = malloc(count * size, M_ALD, M_WAITOK|M_ZERO); diff --git a/sys/kern/kern_ctf.c b/sys/kern/kern_ctf.c index 758ad81..f01fb24 100644 --- a/sys/kern/kern_ctf.c +++ b/sys/kern/kern_ctf.c @@ -69,7 +69,6 @@ link_elf_ctf_get(linker_file_t lf, linker_ctf_t *lc) int i; int nbytes; int resid; - int vfslocked; size_t sz; struct nameidata nd; struct thread *td = curthread; @@ -114,12 +113,11 @@ link_elf_ctf_get(linker_file_t lf, linker_ctf_t *lc) */ ef->ctfcnt = -1; - NDINIT(&nd, LOOKUP, FOLLOW | MPSAFE, UIO_SYSSPACE, lf->pathname, td); + NDINIT(&nd, LOOKUP, FOLLOW, UIO_SYSSPACE, lf->pathname, td); flags = FREAD; error = vn_open(&nd, &flags, 0, NULL); if (error) return (error); - vfslocked = NDHASGIANT(&nd); NDFREE(&nd, NDF_ONLY_PNBUF); /* Allocate memory for the FLF header. */ @@ -305,7 +303,6 @@ link_elf_ctf_get(linker_file_t lf, linker_ctf_t *lc) out: VOP_UNLOCK(nd.ni_vp, 0); vn_close(nd.ni_vp, FREAD, td->td_ucred, td); - VFS_UNLOCK_GIANT(vfslocked); if (hdr != NULL) free(hdr, M_LINKER); diff --git a/sys/kern/kern_descrip.c b/sys/kern/kern_descrip.c index 676de65..f1839f5 100644 --- a/sys/kern/kern_descrip.c +++ b/sys/kern/kern_descrip.c @@ -420,11 +420,9 @@ kern_fcntl(struct thread *td, int fd, int cmd, intptr_t arg) char *pop; struct vnode *vp; int error, flg, tmp; - int vfslocked; u_int old, new; uint64_t bsize; - vfslocked = 0; error = 0; flg = F_POSIX; p = td->td_proc; @@ -580,7 +578,6 @@ kern_fcntl(struct thread *td, int fd, int cmd, intptr_t arg) fhold(fp); FILEDESC_SUNLOCK(fdp); vp = fp->f_vnode; - vfslocked = VFS_LOCK_GIANT(vp->v_mount); switch (flp->l_type) { case F_RDLCK: if ((fp->f_flag & FREAD) == 0) { @@ -624,8 +621,6 @@ kern_fcntl(struct thread *td, int fd, int cmd, intptr_t arg) error = EINVAL; break; } - VFS_UNLOCK_GIANT(vfslocked); - vfslocked = 0; /* Check for race with close */ FILEDESC_SLOCK(fdp); if ((unsigned) fd >= fdp->fd_nfiles || @@ -635,11 +630,8 @@ kern_fcntl(struct thread *td, int fd, int cmd, intptr_t arg) flp->l_start = 0; flp->l_len = 0; flp->l_type = F_UNLCK; - vfslocked = VFS_LOCK_GIANT(vp->v_mount); (void) VOP_ADVLOCK(vp, (caddr_t)p->p_leader, F_UNLCK, flp, F_POSIX); - VFS_UNLOCK_GIANT(vfslocked); - vfslocked = 0; } else FILEDESC_SUNLOCK(fdp); fdrop(fp, td); @@ -681,11 +673,8 @@ kern_fcntl(struct thread *td, int fd, int cmd, intptr_t arg) fhold(fp); FILEDESC_SUNLOCK(fdp); vp = fp->f_vnode; - vfslocked = VFS_LOCK_GIANT(vp->v_mount); error = VOP_ADVLOCK(vp, (caddr_t)p->p_leader, F_GETLK, flp, F_POSIX); - VFS_UNLOCK_GIANT(vfslocked); - vfslocked = 0; fdrop(fp, td); break; @@ -708,7 +697,6 @@ kern_fcntl(struct thread *td, int fd, int cmd, intptr_t arg) FILEDESC_SUNLOCK(fdp); if (arg != 0) { vp = fp->f_vnode; - vfslocked = VFS_LOCK_GIANT(vp->v_mount); error = vn_lock(vp, LK_SHARED); if (error != 0) goto readahead_vnlock_fail; @@ -719,9 +707,7 @@ kern_fcntl(struct thread *td, int fd, int cmd, intptr_t arg) new = old = fp->f_flag; new |= FRDAHEAD; } while (!atomic_cmpset_rel_int(&fp->f_flag, old, new)); -readahead_vnlock_fail: - VFS_UNLOCK_GIANT(vfslocked); - vfslocked = 0; + readahead_vnlock_fail:; } else { do { new = old = fp->f_flag; @@ -735,7 +721,6 @@ readahead_vnlock_fail: error = EINVAL; break; } - VFS_UNLOCK_GIANT(vfslocked); return (error); } @@ -1332,12 +1317,9 @@ fpathconf(struct thread *td, struct fpathconf_args *uap) } vp = fp->f_vnode; if (vp != NULL) { - int vfslocked; - vfslocked = VFS_LOCK_GIANT(vp->v_mount); vn_lock(vp, LK_SHARED | LK_RETRY); error = VOP_PATHCONF(vp, uap->name, td->td_retval); VOP_UNLOCK(vp, 0); - VFS_UNLOCK_GIANT(vfslocked); } else if (fp->f_type == DTYPE_PIPE || fp->f_type == DTYPE_SOCKET) { if (uap->name != _PC_PIPE_BUF) { error = EINVAL; @@ -1727,7 +1709,7 @@ fdfree(struct thread *td) { struct filedesc *fdp; struct file **fpp; - int i, locked; + int i; struct filedesc_to_leader *fdtol; struct file *fp; struct vnode *cdir, *jdir, *rdir, *vp; @@ -1761,14 +1743,12 @@ fdfree(struct thread *td) lf.l_len = 0; lf.l_type = F_UNLCK; vp = fp->f_vnode; - locked = VFS_LOCK_GIANT(vp->v_mount); (void) VOP_ADVLOCK(vp, (caddr_t)td->td_proc-> p_leader, F_UNLCK, &lf, F_POSIX); - VFS_UNLOCK_GIANT(locked); FILEDESC_XLOCK(fdp); fdrop(fp, td); fpp = fdp->fd_ofiles + i; @@ -1848,21 +1828,12 @@ fdfree(struct thread *td) fdp->fd_jdir = NULL; FILEDESC_XUNLOCK(fdp); - if (cdir) { - locked = VFS_LOCK_GIANT(cdir->v_mount); + if (cdir) vrele(cdir); - VFS_UNLOCK_GIANT(locked); - } - if (rdir) { - locked = VFS_LOCK_GIANT(rdir->v_mount); + if (rdir) vrele(rdir); - VFS_UNLOCK_GIANT(locked); - } - if (jdir) { - locked = VFS_LOCK_GIANT(jdir->v_mount); + if (jdir) vrele(jdir); - VFS_UNLOCK_GIANT(locked); - } fddrop(fdp); } @@ -2066,10 +2037,7 @@ closef(struct file *fp, struct thread *td) * leaked. */ if (fp->f_type == DTYPE_VNODE && td != NULL) { - int vfslocked; - vp = fp->f_vnode; - vfslocked = VFS_LOCK_GIANT(vp->v_mount); if ((td->td_proc->p_leader->p_flag & P_ADVLOCK) != 0) { lf.l_whence = SEEK_SET; lf.l_start = 0; @@ -2112,7 +2080,6 @@ closef(struct file *fp, struct thread *td) } FILEDESC_XUNLOCK(fdp); } - VFS_UNLOCK_GIANT(vfslocked); } return (fdrop(fp, td)); } @@ -2378,7 +2345,6 @@ flock(struct thread *td, struct flock_args *uap) struct file *fp; struct vnode *vp; struct flock lf; - int vfslocked; int error; if ((error = fget(td, uap->fd, &fp)) != 0) @@ -2389,7 +2355,6 @@ flock(struct thread *td, struct flock_args *uap) } vp = fp->f_vnode; - vfslocked = VFS_LOCK_GIANT(vp->v_mount); lf.l_whence = SEEK_SET; lf.l_start = 0; lf.l_len = 0; @@ -2412,7 +2377,6 @@ flock(struct thread *td, struct flock_args *uap) (uap->how & LOCK_NB) ? F_FLOCK : F_FLOCK | F_WAIT); done2: fdrop(fp, td); - VFS_UNLOCK_GIANT(vfslocked); return (error); } /* @@ -2683,7 +2647,6 @@ export_vnode_for_osysctl(struct vnode *vp, int type, { int error; char *fullpath, *freepath; - int vfslocked; bzero(kif, sizeof(*kif)); kif->kf_structsize = sizeof(*kif); @@ -2709,9 +2672,7 @@ export_vnode_for_osysctl(struct vnode *vp, int type, fullpath = "-"; FILEDESC_SUNLOCK(fdp); vn_fullpath(curthread, vp, &fullpath, &freepath); - vfslocked = VFS_LOCK_GIANT(vp->v_mount); vrele(vp); - VFS_UNLOCK_GIANT(vfslocked); strlcpy(kif->kf_path, fullpath, sizeof(kif->kf_path)); if (freepath != NULL) free(freepath, M_TEMP); @@ -2735,7 +2696,6 @@ sysctl_kern_proc_ofiledesc(SYSCTL_HANDLER_ARGS) struct file *fp; struct proc *p; struct tty *tp; - int vfslocked; name = (int *)arg1; if ((p = pfind((pid_t)name[0])) == NULL) @@ -2878,9 +2838,7 @@ sysctl_kern_proc_ofiledesc(SYSCTL_HANDLER_ARGS) fullpath = "-"; FILEDESC_SUNLOCK(fdp); vn_fullpath(curthread, vp, &fullpath, &freepath); - vfslocked = VFS_LOCK_GIANT(vp->v_mount); vrele(vp); - VFS_UNLOCK_GIANT(vfslocked); strlcpy(kif->kf_path, fullpath, sizeof(kif->kf_path)); if (freepath != NULL) @@ -2933,7 +2891,6 @@ export_vnode_for_sysctl(struct vnode *vp, int type, { int error; char *fullpath, *freepath; - int vfslocked; bzero(kif, sizeof(*kif)); @@ -2958,9 +2915,7 @@ export_vnode_for_sysctl(struct vnode *vp, int type, fullpath = "-"; FILEDESC_SUNLOCK(fdp); vn_fullpath(curthread, vp, &fullpath, &freepath); - vfslocked = VFS_LOCK_GIANT(vp->v_mount); vrele(vp); - VFS_UNLOCK_GIANT(vfslocked); strlcpy(kif->kf_path, fullpath, sizeof(kif->kf_path)); if (freepath != NULL) free(freepath, M_TEMP); @@ -2988,7 +2943,6 @@ sysctl_kern_proc_filedesc(SYSCTL_HANDLER_ARGS) struct file *fp; struct proc *p; struct tty *tp; - int vfslocked; size_t oldidx; name = (int *)arg1; @@ -3131,9 +3085,7 @@ sysctl_kern_proc_filedesc(SYSCTL_HANDLER_ARGS) fullpath = "-"; FILEDESC_SUNLOCK(fdp); vn_fullpath(curthread, vp, &fullpath, &freepath); - vfslocked = VFS_LOCK_GIANT(vp->v_mount); vrele(vp); - VFS_UNLOCK_GIANT(vfslocked); strlcpy(kif->kf_path, fullpath, sizeof(kif->kf_path)); if (freepath != NULL) diff --git a/sys/kern/kern_exec.c b/sys/kern/kern_exec.c index dce624d..746fbc1 100644 --- a/sys/kern/kern_exec.c +++ b/sys/kern/kern_exec.c @@ -338,7 +338,6 @@ do_execve(td, args, mac_p) #endif struct vnode *textvp = NULL, *binvp = NULL; int credential_changing; - int vfslocked; int textset; #ifdef MAC struct label *interpvplabel = NULL; @@ -349,7 +348,6 @@ do_execve(td, args, mac_p) #endif static const char fexecv_proc_title[] = "(fexecv)"; - vfslocked = 0; imgp = &image_params; /* @@ -403,7 +401,7 @@ do_execve(td, args, mac_p) */ if (args->fname != NULL) { NDINIT(&nd, LOOKUP, ISOPEN | LOCKLEAF | FOLLOW | SAVENAME - | MPSAFE | AUDITVNODE1, UIO_SYSSPACE, args->fname, td); + | AUDITVNODE1, UIO_SYSSPACE, args->fname, td); } SDT_PROBE(proc, kernel, , exec, args->fname, 0, 0, 0, 0 ); @@ -414,7 +412,6 @@ interpret: if (error) goto exec_fail; - vfslocked = NDHASGIANT(&nd); binvp = nd.ni_vp; imgp->vp = binvp; } else { @@ -422,7 +419,6 @@ interpret: error = fgetvp(td, args->fd, &binvp); if (error) goto exec_fail; - vfslocked = VFS_LOCK_GIANT(binvp->v_mount); vn_lock(binvp, LK_EXCLUSIVE | LK_RETRY); AUDIT_ARG_VNODE1(binvp); imgp->vp = binvp; @@ -511,10 +507,8 @@ interpret: vput(binvp); vm_object_deallocate(imgp->object); imgp->object = NULL; - VFS_UNLOCK_GIANT(vfslocked); - vfslocked = 0; /* set new name to that of the interpreter */ - NDINIT(&nd, LOOKUP, LOCKLEAF | FOLLOW | SAVENAME | MPSAFE, + NDINIT(&nd, LOOKUP, LOCKLEAF | FOLLOW | SAVENAME, UIO_SYSSPACE, imgp->interpreter_name, td); args->fname = imgp->interpreter_name; goto interpret; @@ -823,23 +817,13 @@ done1: /* * Handle deferred decrement of ref counts. */ - if (textvp != NULL) { - int tvfslocked; - - tvfslocked = VFS_LOCK_GIANT(textvp->v_mount); + if (textvp != NULL) vrele(textvp); - VFS_UNLOCK_GIANT(tvfslocked); - } if (binvp && error != 0) vrele(binvp); #ifdef KTRACE - if (tracevp != NULL) { - int tvfslocked; - - tvfslocked = VFS_LOCK_GIANT(tracevp->v_mount); + if (tracevp != NULL) vrele(tracevp); - VFS_UNLOCK_GIANT(tvfslocked); - } if (tracecred != NULL) crfree(tracecred); #endif @@ -892,7 +876,6 @@ done2: mac_execve_exit(imgp); mac_execve_interpreter_exit(interpvplabel); #endif - VFS_UNLOCK_GIANT(vfslocked); exec_free_args(args); if (error && imgp->vmspace_destroyed) { diff --git a/sys/kern/kern_exit.c b/sys/kern/kern_exit.c index af00f42..fa809fd 100644 --- a/sys/kern/kern_exit.c +++ b/sys/kern/kern_exit.c @@ -126,7 +126,6 @@ exit1(struct thread *td, int rv) struct ucred *tracecred; #endif struct plimit *plim; - int locked; mtx_assert(&Giant, MA_NOTOWNED); @@ -375,11 +374,8 @@ exit1(struct thread *td, int rv) p->p_tracecred = NULL; mtx_unlock(&ktrace_mtx); PROC_UNLOCK(p); - if (tracevp != NULL) { - locked = VFS_LOCK_GIANT(tracevp->v_mount); + if (tracevp != NULL) vrele(tracevp); - VFS_UNLOCK_GIANT(locked); - } if (tracecred != NULL) crfree(tracecred); } @@ -389,9 +385,7 @@ exit1(struct thread *td, int rv) */ if ((vtmp = p->p_textvp) != NULL) { p->p_textvp = NULL; - locked = VFS_LOCK_GIANT(vtmp->v_mount); vrele(vtmp); - VFS_UNLOCK_GIANT(locked); } /* diff --git a/sys/kern/kern_jail.c b/sys/kern/kern_jail.c index 93fdfa9..5428486 100644 --- a/sys/kern/kern_jail.c +++ b/sys/kern/kern_jail.c @@ -515,7 +515,7 @@ kern_jail_set(struct thread *td, struct uio *optuio, int flags) int created, cuflags, descend, enforce, error, errmsg_len, errmsg_pos; int gotchildmax, gotenforce, gothid, gotslevel; int fi, jid, jsys, len, level; - int childmax, slevel, vfslocked; + int childmax, slevel; #if defined(INET) || defined(INET6) int ii, ij; #endif @@ -888,21 +888,17 @@ kern_jail_set(struct thread *td, struct uio *optuio, int flags) error = ENAMETOOLONG; goto done_free; } - NDINIT(&nd, LOOKUP, MPSAFE | FOLLOW, UIO_SYSSPACE, - path, td); + NDINIT(&nd, LOOKUP, FOLLOW, UIO_SYSSPACE, path, td); error = namei(&nd); if (error) goto done_free; - vfslocked = NDHASGIANT(&nd); root = nd.ni_vp; NDFREE(&nd, NDF_ONLY_PNBUF); if (root->v_type != VDIR) { error = ENOTDIR; vrele(root); - VFS_UNLOCK_GIANT(vfslocked); goto done_free; } - VFS_UNLOCK_GIANT(vfslocked); } } @@ -1754,11 +1750,8 @@ kern_jail_set(struct thread *td, struct uio *optuio, int flags) done_unlock_list: sx_xunlock(&allprison_lock); done_releroot: - if (root != NULL) { - vfslocked = VFS_LOCK_GIANT(root->v_mount); + if (root != NULL) vrele(root); - VFS_UNLOCK_GIANT(vfslocked); - } done_errmsg: if (error) { vfs_getopt(opts, "errmsg", (void **)&errmsg, &errmsg_len); @@ -2233,7 +2226,7 @@ do_jail_attach(struct thread *td, struct prison *pr) struct prison *ppr; struct proc *p; struct ucred *newcred, *oldcred; - int vfslocked, error; + int error; /* * XXX: Note that there is a slight race here if two threads @@ -2264,7 +2257,6 @@ do_jail_attach(struct thread *td, struct prison *pr) if (error) goto e_revert_osd; - vfslocked = VFS_LOCK_GIANT(pr->pr_root->v_mount); vn_lock(pr->pr_root, LK_EXCLUSIVE | LK_RETRY); if ((error = change_dir(pr->pr_root, td)) != 0) goto e_unlock; @@ -2274,8 +2266,7 @@ do_jail_attach(struct thread *td, struct prison *pr) #endif VOP_UNLOCK(pr->pr_root, 0); if ((error = change_root(pr->pr_root, td))) - goto e_unlock_giant; - VFS_UNLOCK_GIANT(vfslocked); + goto e_revert_osd; newcred = crget(); PROC_LOCK(p); @@ -2290,8 +2281,6 @@ do_jail_attach(struct thread *td, struct prison *pr) return (0); e_unlock: VOP_UNLOCK(pr->pr_root, 0); - e_unlock_giant: - VFS_UNLOCK_GIANT(vfslocked); e_revert_osd: /* Tell modules this thread is still in its old jail after all. */ (void)osd_jail_call(ppr, PR_METHOD_ATTACH, td); @@ -2440,7 +2429,6 @@ static void prison_deref(struct prison *pr, int flags) { struct prison *ppr, *tpr; - int vfslocked; if (!(flags & PD_LOCKED)) mtx_lock(&pr->pr_mtx); @@ -2502,11 +2490,8 @@ prison_deref(struct prison *pr, int flags) if (pr->pr_vnet != ppr->pr_vnet) vnet_destroy(pr->pr_vnet); #endif - if (pr->pr_root != NULL) { - vfslocked = VFS_LOCK_GIANT(pr->pr_root->v_mount); + if (pr->pr_root != NULL) vrele(pr->pr_root); - VFS_UNLOCK_GIANT(vfslocked); - } mtx_destroy(&pr->pr_mtx); #ifdef INET free(pr->pr_ip4, M_PRISON); diff --git a/sys/kern/kern_ktrace.c b/sys/kern/kern_ktrace.c index 2182ff7..a09ce45 100644 --- a/sys/kern/kern_ktrace.c +++ b/sys/kern/kern_ktrace.c @@ -647,7 +647,7 @@ ktrace(td, uap) int ops = KTROP(uap->ops); int descend = uap->ops & KTRFLAG_DESCEND; int nfound, ret = 0; - int flags, error = 0, vfslocked; + int flags, error = 0; struct nameidata nd; struct ucred *cred; @@ -662,25 +662,21 @@ ktrace(td, uap) /* * an operation which requires a file argument. */ - NDINIT(&nd, LOOKUP, NOFOLLOW | MPSAFE, UIO_USERSPACE, - uap->fname, td); + NDINIT(&nd, LOOKUP, NOFOLLOW, UIO_USERSPACE, uap->fname, td); flags = FREAD | FWRITE | O_NOFOLLOW; error = vn_open(&nd, &flags, 0, NULL); if (error) { ktrace_exit(td); return (error); } - vfslocked = NDHASGIANT(&nd); NDFREE(&nd, NDF_ONLY_PNBUF); vp = nd.ni_vp; VOP_UNLOCK(vp, 0); if (vp->v_type != VREG) { (void) vn_close(vp, FREAD|FWRITE, td->td_ucred, td); - VFS_UNLOCK_GIANT(vfslocked); ktrace_exit(td); return (EACCES); } - VFS_UNLOCK_GIANT(vfslocked); } /* * Clear all uses of the tracefile. @@ -709,10 +705,8 @@ ktrace(td, uap) } sx_sunlock(&allproc_lock); if (vrele_count > 0) { - vfslocked = VFS_LOCK_GIANT(vp->v_mount); while (vrele_count-- > 0) vrele(vp); - VFS_UNLOCK_GIANT(vfslocked); } goto done; } @@ -783,11 +777,8 @@ ktrace(td, uap) if (!ret) error = EPERM; done: - if (vp != NULL) { - vfslocked = VFS_LOCK_GIANT(vp->v_mount); + if (vp != NULL) (void) vn_close(vp, FWRITE, td->td_ucred, td); - VFS_UNLOCK_GIANT(vfslocked); - } ktrace_exit(td); return (error); #else /* !KTRACE */ @@ -877,13 +868,8 @@ ktrops(td, p, ops, facs, vp) } mtx_unlock(&ktrace_mtx); PROC_UNLOCK(p); - if (tracevp != NULL) { - int vfslocked; - - vfslocked = VFS_LOCK_GIANT(tracevp->v_mount); + if (tracevp != NULL) vrele(tracevp); - VFS_UNLOCK_GIANT(vfslocked); - } if (tracecred != NULL) crfree(tracecred); @@ -935,7 +921,7 @@ ktr_writerequest(struct thread *td, struct ktr_request *req) struct iovec aiov[3]; struct mount *mp; int datalen, buflen, vrele_count; - int error, vfslocked; + int error; /* * We hold the vnode and credential for use in I/O in case ktrace is @@ -993,7 +979,6 @@ ktr_writerequest(struct thread *td, struct ktr_request *req) auio.uio_iovcnt++; } - vfslocked = VFS_LOCK_GIANT(vp->v_mount); vn_start_write(vp, &mp, V_WAIT); vn_lock(vp, LK_EXCLUSIVE | LK_RETRY); #ifdef MAC @@ -1006,10 +991,8 @@ ktr_writerequest(struct thread *td, struct ktr_request *req) crfree(cred); if (!error) { vrele(vp); - VFS_UNLOCK_GIANT(vfslocked); return; } - VFS_UNLOCK_GIANT(vfslocked); /* * If error encountered, give up tracing on this vnode. We defer @@ -1056,10 +1039,8 @@ ktr_writerequest(struct thread *td, struct ktr_request *req) * them but not yet committed them, as those are per-thread. The * thread will have to clear it itself on system call return. */ - vfslocked = VFS_LOCK_GIANT(vp->v_mount); while (vrele_count-- > 0) vrele(vp); - VFS_UNLOCK_GIANT(vfslocked); } /* diff --git a/sys/kern/kern_linker.c b/sys/kern/kern_linker.c index dd29302..463452b 100644 --- a/sys/kern/kern_linker.c +++ b/sys/kern/kern_linker.c @@ -1659,7 +1659,7 @@ linker_lookup_file(const char *path, int pathlen, const char *name, struct nameidata nd; struct thread *td = curthread; /* XXX */ char *result, **cpp, *sep; - int error, len, extlen, reclen, flags, vfslocked; + int error, len, extlen, reclen, flags; enum vtype type; extlen = 0; @@ -1680,18 +1680,16 @@ linker_lookup_file(const char *path, int pathlen, const char *name, * Attempt to open the file, and return the path if * we succeed and it's a regular file. */ - NDINIT(&nd, LOOKUP, FOLLOW | MPSAFE, UIO_SYSSPACE, result, td); + NDINIT(&nd, LOOKUP, FOLLOW, UIO_SYSSPACE, result, td); flags = FREAD; error = vn_open(&nd, &flags, 0, NULL); if (error == 0) { - vfslocked = NDHASGIANT(&nd); NDFREE(&nd, NDF_ONLY_PNBUF); type = nd.ni_vp->v_type; if (vap) VOP_GETATTR(nd.ni_vp, vap, td->td_ucred); VOP_UNLOCK(nd.ni_vp, 0); vn_close(nd.ni_vp, FREAD, td->td_ucred, td); - VFS_UNLOCK_GIANT(vfslocked); if (type == VREG) return (result); } @@ -1719,7 +1717,6 @@ linker_hints_lookup(const char *path, int pathlen, const char *modname, u_char *hints = NULL; u_char *cp, *recptr, *bufend, *result, *best, *pathbuf, *sep; int error, ival, bestver, *intp, reclen, found, flags, clen, blen; - int vfslocked = 0; result = NULL; bestver = found = 0; @@ -1731,12 +1728,11 @@ linker_hints_lookup(const char *path, int pathlen, const char *modname, snprintf(pathbuf, reclen, "%.*s%s%s", pathlen, path, sep, linker_hintfile); - NDINIT(&nd, LOOKUP, NOFOLLOW | MPSAFE, UIO_SYSSPACE, pathbuf, td); + NDINIT(&nd, LOOKUP, NOFOLLOW, UIO_SYSSPACE, pathbuf, td); flags = FREAD; error = vn_open(&nd, &flags, 0, NULL); if (error) goto bad; - vfslocked = NDHASGIANT(&nd); NDFREE(&nd, NDF_ONLY_PNBUF); if (nd.ni_vp->v_type != VREG) goto bad; @@ -1760,7 +1756,6 @@ linker_hints_lookup(const char *path, int pathlen, const char *modname, goto bad; VOP_UNLOCK(nd.ni_vp, 0); vn_close(nd.ni_vp, FREAD, cred, td); - VFS_UNLOCK_GIANT(vfslocked); nd.ni_vp = NULL; if (reclen != 0) { printf("can't read %d\n", reclen); @@ -1829,7 +1824,6 @@ bad: if (nd.ni_vp != NULL) { VOP_UNLOCK(nd.ni_vp, 0); vn_close(nd.ni_vp, FREAD, cred, td); - VFS_UNLOCK_GIANT(vfslocked); } /* * If nothing found or hints is absent - fallback to the old diff --git a/sys/kern/kern_proc.c b/sys/kern/kern_proc.c index eaf13f2..252c8d1 100644 --- a/sys/kern/kern_proc.c +++ b/sys/kern/kern_proc.c @@ -1296,7 +1296,7 @@ sysctl_kern_proc_pathname(SYSCTL_HANDLER_ARGS) struct proc *p; struct vnode *vp; char *retbuf, *freebuf; - int error, vfslocked; + int error; if (arglen != 1) return (EINVAL); @@ -1322,9 +1322,7 @@ sysctl_kern_proc_pathname(SYSCTL_HANDLER_ARGS) if (*pidp != -1) PROC_UNLOCK(p); error = vn_fullpath(req->td, vp, &retbuf, &freebuf); - vfslocked = VFS_LOCK_GIANT(vp->v_mount); vrele(vp); - VFS_UNLOCK_GIANT(vfslocked); if (error) return (error); error = SYSCTL_OUT(req, retbuf, strlen(retbuf) + 1); @@ -1403,7 +1401,6 @@ sysctl_kern_proc_ovmmap(SYSCTL_HANDLER_ARGS) entry = entry->next) { vm_object_t obj, tobj, lobj; vm_offset_t addr; - int vfslocked; if (entry->eflags & MAP_ENTRY_IS_SUB_MAP) continue; @@ -1498,14 +1495,12 @@ sysctl_kern_proc_ovmmap(SYSCTL_HANDLER_ARGS) vn_fullpath(curthread, vp, &fullpath, &freepath); cred = curthread->td_ucred; - vfslocked = VFS_LOCK_GIANT(vp->v_mount); vn_lock(vp, LK_SHARED | LK_RETRY); if (VOP_GETATTR(vp, &va, cred) == 0) { kve->kve_fileid = va.va_fileid; kve->kve_fsid = va.va_fsid; } vput(vp); - VFS_UNLOCK_GIANT(vfslocked); } } else { kve->kve_type = KVME_TYPE_NONE; @@ -1579,7 +1574,6 @@ sysctl_kern_proc_vmmap(SYSCTL_HANDLER_ARGS) entry = entry->next) { vm_object_t obj, tobj, lobj; vm_offset_t addr; - int vfslocked; if (entry->eflags & MAP_ENTRY_IS_SUB_MAP) continue; @@ -1673,14 +1667,12 @@ sysctl_kern_proc_vmmap(SYSCTL_HANDLER_ARGS) vn_fullpath(curthread, vp, &fullpath, &freepath); cred = curthread->td_ucred; - vfslocked = VFS_LOCK_GIANT(vp->v_mount); vn_lock(vp, LK_SHARED | LK_RETRY); if (VOP_GETATTR(vp, &va, cred) == 0) { kve->kve_fileid = va.va_fileid; kve->kve_fsid = va.va_fsid; } vput(vp); - VFS_UNLOCK_GIANT(vfslocked); } } else { kve->kve_type = KVME_TYPE_NONE; diff --git a/sys/kern/kern_sig.c b/sys/kern/kern_sig.c index c0ec56f..1207494 100644 --- a/sys/kern/kern_sig.c +++ b/sys/kern/kern_sig.c @@ -3027,7 +3027,6 @@ coredump(struct thread *td) struct mount *mp; char *name; /* name of corefile */ off_t limit; - int vfslocked; PROC_LOCK_ASSERT(p, MA_OWNED); MPASS((p->p_flag & P_HADTHREADS) == 0 || p->p_singlethread == td); @@ -3069,7 +3068,7 @@ coredump(struct thread *td) } restart: - NDINIT(&nd, LOOKUP, NOFOLLOW | MPSAFE, UIO_SYSSPACE, name, td); + NDINIT(&nd, LOOKUP, NOFOLLOW, UIO_SYSSPACE, name, td); flags = O_CREAT | FWRITE | O_NOFOLLOW; error = vn_open_cred(&nd, &flags, S_IRUSR | S_IWUSR, VN_OPEN_NOAUDIT, cred, NULL); @@ -3080,7 +3079,6 @@ restart: free(name, M_TEMP); return (error); } - vfslocked = NDHASGIANT(&nd); NDFREE(&nd, NDF_ONLY_PNBUF); vp = nd.ni_vp; @@ -3107,7 +3105,6 @@ restart: goto out; if ((error = vn_start_write(NULL, &mp, V_XSLEEP | PCATCH)) != 0) goto out; - VFS_UNLOCK_GIANT(vfslocked); goto restart; } @@ -3140,7 +3137,6 @@ out: audit_proc_coredump(td, name, error); #endif free(name, M_TEMP); - VFS_UNLOCK_GIANT(vfslocked); return (error); } diff --git a/sys/kern/link_elf.c b/sys/kern/link_elf.c index b389ace..6e3c5b8 100644 --- a/sys/kern/link_elf.c +++ b/sys/kern/link_elf.c @@ -657,17 +657,15 @@ link_elf_load_file(linker_class_t cls, const char* filename, int symstrindex; int symcnt; int strcnt; - int vfslocked; shdr = NULL; lf = NULL; - NDINIT(&nd, LOOKUP, FOLLOW | MPSAFE, UIO_SYSSPACE, filename, td); + NDINIT(&nd, LOOKUP, FOLLOW, UIO_SYSSPACE, filename, td); flags = FREAD; error = vn_open(&nd, &flags, 0, NULL); if (error) return error; - vfslocked = NDHASGIANT(&nd); NDFREE(&nd, NDF_ONLY_PNBUF); if (nd.ni_vp->v_type != VREG) { error = ENOEXEC; @@ -975,7 +973,6 @@ out: free(firstpage, M_LINKER); VOP_UNLOCK(nd.ni_vp, 0); vn_close(nd.ni_vp, FREAD, td->td_ucred, td); - VFS_UNLOCK_GIANT(vfslocked); return error; } diff --git a/sys/kern/link_elf_obj.c b/sys/kern/link_elf_obj.c index 68c60d8..0097525 100644 --- a/sys/kern/link_elf_obj.c +++ b/sys/kern/link_elf_obj.c @@ -449,19 +449,17 @@ link_elf_load_file(linker_class_t cls, const char *filename, int nsym; int pb, rl, ra; int alignmask; - int vfslocked; shdr = NULL; lf = NULL; mapsize = 0; hdr = NULL; - NDINIT(&nd, LOOKUP, FOLLOW | MPSAFE, UIO_SYSSPACE, filename, td); + NDINIT(&nd, LOOKUP, FOLLOW, UIO_SYSSPACE, filename, td); flags = FREAD; error = vn_open(&nd, &flags, 0, NULL); if (error) return error; - vfslocked = NDHASGIANT(&nd); NDFREE(&nd, NDF_ONLY_PNBUF); if (nd.ni_vp->v_type != VREG) { error = ENOEXEC; @@ -885,7 +883,6 @@ out: free(hdr, M_LINKER); VOP_UNLOCK(nd.ni_vp, 0); vn_close(nd.ni_vp, FREAD, td->td_ucred, td); - VFS_UNLOCK_GIANT(vfslocked); return error; } diff --git a/sys/kern/sys_process.c b/sys/kern/sys_process.c index d4b5d4d..f42d076 100644 --- a/sys/kern/sys_process.c +++ b/sys/kern/sys_process.c @@ -371,7 +371,7 @@ ptrace_vm_entry(struct thread *td, struct proc *p, struct ptrace_vm_entry *pve) struct vnode *vp; char *freepath, *fullpath; u_int pathlen; - int error, index, vfslocked; + int error, index; error = 0; obj = NULL; @@ -448,14 +448,12 @@ ptrace_vm_entry(struct thread *td, struct proc *p, struct ptrace_vm_entry *pve) freepath = NULL; fullpath = NULL; vn_fullpath(td, vp, &fullpath, &freepath); - vfslocked = VFS_LOCK_GIANT(vp->v_mount); vn_lock(vp, LK_SHARED | LK_RETRY); if (VOP_GETATTR(vp, &vattr, td->td_ucred) == 0) { pve->pve_fileid = vattr.va_fileid; pve->pve_fsid = vattr.va_fsid; } vput(vp); - VFS_UNLOCK_GIANT(vfslocked); if (fullpath != NULL) { pve->pve_pathlen = strlen(fullpath) + 1; diff --git a/sys/kern/uipc_syscalls.c b/sys/kern/uipc_syscalls.c index a9001d9..1a4d811 100644 --- a/sys/kern/uipc_syscalls.c +++ b/sys/kern/uipc_syscalls.c @@ -1815,7 +1815,6 @@ kern_sendfile(struct thread *td, struct sendfile_args *uap, struct vm_page *pg; off_t off, xfsize, fsbytes = 0, sbytes = 0, rem = 0; int error, hdrlen = 0, mnw = 0; - int vfslocked; struct sendfile_sync *sfs = NULL; /* @@ -1827,7 +1826,6 @@ kern_sendfile(struct thread *td, struct sendfile_args *uap, AUDIT_ARG_FD(uap->fd); if ((error = fgetvp_read(td, uap->fd, &vp)) != 0) goto out; - vfslocked = VFS_LOCK_GIANT(vp->v_mount); vn_lock(vp, LK_SHARED | LK_RETRY); if (vp->v_type == VREG) { obj = vp->v_object; @@ -1849,7 +1847,6 @@ kern_sendfile(struct thread *td, struct sendfile_args *uap, } } VOP_UNLOCK(vp, 0); - VFS_UNLOCK_GIANT(vfslocked); if (obj == NULL) { error = EINVAL; goto out; @@ -2078,7 +2075,6 @@ retry_space: /* * Get the page from backing store. */ - vfslocked = VFS_LOCK_GIANT(vp->v_mount); error = vn_lock(vp, LK_SHARED); if (error != 0) goto after_read; @@ -2096,7 +2092,6 @@ retry_space: td->td_ucred, NOCRED, &resid, td); VOP_UNLOCK(vp, 0); after_read: - VFS_UNLOCK_GIANT(vfslocked); VM_OBJECT_LOCK(obj); vm_page_io_finish(pg); if (!error) @@ -2245,11 +2240,8 @@ out: } if (obj != NULL) vm_object_deallocate(obj); - if (vp != NULL) { - vfslocked = VFS_LOCK_GIANT(vp->v_mount); + if (vp != NULL) vrele(vp); - VFS_UNLOCK_GIANT(vfslocked); - } if (so) fdrop(sock_fp, td); if (m) diff --git a/sys/kern/uipc_usrreq.c b/sys/kern/uipc_usrreq.c index fdf3d90..4e172c6 100644 --- a/sys/kern/uipc_usrreq.c +++ b/sys/kern/uipc_usrreq.c @@ -427,7 +427,7 @@ uipc_bind(struct socket *so, struct sockaddr *nam, struct thread *td) { struct sockaddr_un *soun = (struct sockaddr_un *)nam; struct vattr vattr; - int error, namelen, vfslocked; + int error, namelen; struct nameidata nd; struct unpcb *unp; struct vnode *vp; @@ -467,15 +467,13 @@ uipc_bind(struct socket *so, struct sockaddr *nam, struct thread *td) buf[namelen] = 0; restart: - vfslocked = 0; - NDINIT(&nd, CREATE, MPSAFE | NOFOLLOW | LOCKPARENT | SAVENAME, + NDINIT(&nd, CREATE, NOFOLLOW | LOCKPARENT | SAVENAME, UIO_SYSSPACE, buf, td); /* SHOULD BE ABLE TO ADOPT EXISTING AND wakeup() ALA FIFO's */ error = namei(&nd); if (error) goto error; vp = nd.ni_vp; - vfslocked = NDHASGIANT(&nd); if (vp != NULL || vn_start_write(nd.ni_dvp, &mp, V_NOWAIT) != 0) { NDFREE(&nd, NDF_ONLY_PNBUF); if (nd.ni_dvp == vp) @@ -490,7 +488,6 @@ restart: error = vn_start_write(NULL, &mp, V_XSLEEP | PCATCH); if (error) goto error; - VFS_UNLOCK_GIANT(vfslocked); goto restart; } VATTR_NULL(&vattr); @@ -522,12 +519,10 @@ restart: UNP_LINK_WUNLOCK(); VOP_UNLOCK(vp, 0); vn_finished_write(mp); - VFS_UNLOCK_GIANT(vfslocked); free(buf, M_TEMP); return (0); error: - VFS_UNLOCK_GIANT(vfslocked); UNP_PCB_LOCK(unp); unp->unp_flags &= ~UNP_BINDING; UNP_PCB_UNLOCK(unp); @@ -645,13 +640,8 @@ uipc_detach(struct socket *so) uma_zfree(unp_zone, unp); } else UNP_PCB_UNLOCK(unp); - if (vp) { - int vfslocked; - - vfslocked = VFS_LOCK_GIANT(vp->v_mount); + if (vp) vrele(vp); - VFS_UNLOCK_GIANT(vfslocked); - } if (local_unp_rights) taskqueue_enqueue(taskqueue_thread, &unp_gc_task); } @@ -1214,7 +1204,7 @@ unp_connect(struct socket *so, struct sockaddr *nam, struct thread *td) struct vnode *vp; struct socket *so2, *so3; struct unpcb *unp, *unp2, *unp3; - int error, len, vfslocked; + int error, len; struct nameidata nd; char buf[SOCK_MAXADDRLEN]; struct sockaddr *sa; @@ -1240,7 +1230,7 @@ unp_connect(struct socket *so, struct sockaddr *nam, struct thread *td) UNP_PCB_UNLOCK(unp); sa = malloc(sizeof(struct sockaddr_un), M_SONAME, M_WAITOK); - NDINIT(&nd, LOOKUP, MPSAFE | FOLLOW | LOCKLEAF, UIO_SYSSPACE, buf, + NDINIT(&nd, LOOKUP, FOLLOW | LOCKLEAF, UIO_SYSSPACE, buf, td); error = namei(&nd); if (error) @@ -1248,7 +1238,6 @@ unp_connect(struct socket *so, struct sockaddr *nam, struct thread *td) else vp = nd.ni_vp; ASSERT_VOP_LOCKED(vp, "unp_connect"); - vfslocked = NDHASGIANT(&nd); NDFREE(&nd, NDF_ONLY_PNBUF); if (error) goto bad; @@ -1265,7 +1254,6 @@ unp_connect(struct socket *so, struct sockaddr *nam, struct thread *td) error = VOP_ACCESS(vp, VWRITE, td->td_ucred, td); if (error) goto bad; - VFS_UNLOCK_GIANT(vfslocked); unp = sotounpcb(so); KASSERT(unp != NULL, ("unp_connect: unp == NULL")); @@ -1346,16 +1334,9 @@ unp_connect(struct socket *so, struct sockaddr *nam, struct thread *td) UNP_PCB_UNLOCK(unp); bad2: UNP_LINK_WUNLOCK(); - if (vfslocked) - /* - * Giant has been previously acquired. This means filesystem - * isn't MPSAFE. Do it once again. - */ - mtx_lock(&Giant); bad: if (vp != NULL) vput(vp); - VFS_UNLOCK_GIANT(vfslocked); free(sa, M_SONAME); UNP_LINK_WLOCK(); UNP_PCB_LOCK(unp); diff --git a/sys/kern/vfs_acl.c b/sys/kern/vfs_acl.c index c44bb25..6455227 100644 --- a/sys/kern/vfs_acl.c +++ b/sys/kern/vfs_acl.c @@ -326,16 +326,14 @@ int __acl_get_file(struct thread *td, struct __acl_get_file_args *uap) { struct nameidata nd; - int vfslocked, error; + int error; - NDINIT(&nd, LOOKUP, MPSAFE|FOLLOW, UIO_USERSPACE, uap->path, td); + NDINIT(&nd, LOOKUP, FOLLOW, UIO_USERSPACE, uap->path, td); error = namei(&nd); - vfslocked = NDHASGIANT(&nd); if (error == 0) { error = vacl_get_acl(td, nd.ni_vp, uap->type, uap->aclp); NDFREE(&nd, 0); } - VFS_UNLOCK_GIANT(vfslocked); return (error); } @@ -346,16 +344,14 @@ int __acl_get_link(struct thread *td, struct __acl_get_link_args *uap) { struct nameidata nd; - int vfslocked, error; + int error; - NDINIT(&nd, LOOKUP, MPSAFE|NOFOLLOW, UIO_USERSPACE, uap->path, td); + NDINIT(&nd, LOOKUP, NOFOLLOW, UIO_USERSPACE, uap->path, td); error = namei(&nd); - vfslocked = NDHASGIANT(&nd); if (error == 0) { error = vacl_get_acl(td, nd.ni_vp, uap->type, uap->aclp); NDFREE(&nd, 0); } - VFS_UNLOCK_GIANT(vfslocked); return (error); } @@ -366,16 +362,14 @@ int __acl_set_file(struct thread *td, struct __acl_set_file_args *uap) { struct nameidata nd; - int vfslocked, error; + int error; - NDINIT(&nd, LOOKUP, MPSAFE|FOLLOW, UIO_USERSPACE, uap->path, td); + NDINIT(&nd, LOOKUP, FOLLOW, UIO_USERSPACE, uap->path, td); error = namei(&nd); - vfslocked = NDHASGIANT(&nd); if (error == 0) { error = vacl_set_acl(td, nd.ni_vp, uap->type, uap->aclp); NDFREE(&nd, 0); } - VFS_UNLOCK_GIANT(vfslocked); return (error); } @@ -386,16 +380,14 @@ int __acl_set_link(struct thread *td, struct __acl_set_link_args *uap) { struct nameidata nd; - int vfslocked, error; + int error; - NDINIT(&nd, LOOKUP, MPSAFE|NOFOLLOW, UIO_USERSPACE, uap->path, td); + NDINIT(&nd, LOOKUP, NOFOLLOW, UIO_USERSPACE, uap->path, td); error = namei(&nd); - vfslocked = NDHASGIANT(&nd); if (error == 0) { error = vacl_set_acl(td, nd.ni_vp, uap->type, uap->aclp); NDFREE(&nd, 0); } - VFS_UNLOCK_GIANT(vfslocked); return (error); } @@ -406,14 +398,12 @@ int __acl_get_fd(struct thread *td, struct __acl_get_fd_args *uap) { struct file *fp; - int vfslocked, error; + int error; error = getvnode(td->td_proc->p_fd, uap->filedes, &fp); if (error == 0) { - vfslocked = VFS_LOCK_GIANT(fp->f_vnode->v_mount); error = vacl_get_acl(td, fp->f_vnode, uap->type, uap->aclp); fdrop(fp, td); - VFS_UNLOCK_GIANT(vfslocked); } return (error); } @@ -425,14 +415,12 @@ int __acl_set_fd(struct thread *td, struct __acl_set_fd_args *uap) { struct file *fp; - int vfslocked, error; + int error; error = getvnode(td->td_proc->p_fd, uap->filedes, &fp); if (error == 0) { - vfslocked = VFS_LOCK_GIANT(fp->f_vnode->v_mount); error = vacl_set_acl(td, fp->f_vnode, uap->type, uap->aclp); fdrop(fp, td); - VFS_UNLOCK_GIANT(vfslocked); } return (error); } @@ -444,16 +432,14 @@ int __acl_delete_file(struct thread *td, struct __acl_delete_file_args *uap) { struct nameidata nd; - int vfslocked, error; + int error; - NDINIT(&nd, LOOKUP, MPSAFE|FOLLOW, UIO_USERSPACE, uap->path, td); + NDINIT(&nd, LOOKUP, FOLLOW, UIO_USERSPACE, uap->path, td); error = namei(&nd); - vfslocked = NDHASGIANT(&nd); if (error == 0) { error = vacl_delete(td, nd.ni_vp, uap->type); NDFREE(&nd, 0); } - VFS_UNLOCK_GIANT(vfslocked); return (error); } @@ -464,16 +450,14 @@ int __acl_delete_link(struct thread *td, struct __acl_delete_link_args *uap) { struct nameidata nd; - int vfslocked, error; + int error; - NDINIT(&nd, LOOKUP, MPSAFE|NOFOLLOW, UIO_USERSPACE, uap->path, td); + NDINIT(&nd, LOOKUP, NOFOLLOW, UIO_USERSPACE, uap->path, td); error = namei(&nd); - vfslocked = NDHASGIANT(&nd); if (error == 0) { error = vacl_delete(td, nd.ni_vp, uap->type); NDFREE(&nd, 0); } - VFS_UNLOCK_GIANT(vfslocked); return (error); } @@ -484,14 +468,12 @@ int __acl_delete_fd(struct thread *td, struct __acl_delete_fd_args *uap) { struct file *fp; - int vfslocked, error; + int error; error = getvnode(td->td_proc->p_fd, uap->filedes, &fp); if (error == 0) { - vfslocked = VFS_LOCK_GIANT(fp->f_vnode->v_mount); error = vacl_delete(td, fp->f_vnode, uap->type); fdrop(fp, td); - VFS_UNLOCK_GIANT(vfslocked); } return (error); } @@ -503,16 +485,14 @@ int __acl_aclcheck_file(struct thread *td, struct __acl_aclcheck_file_args *uap) { struct nameidata nd; - int vfslocked, error; + int error; - NDINIT(&nd, LOOKUP, MPSAFE|FOLLOW, UIO_USERSPACE, uap->path, td); + NDINIT(&nd, LOOKUP, FOLLOW, UIO_USERSPACE, uap->path, td); error = namei(&nd); - vfslocked = NDHASGIANT(&nd); if (error == 0) { error = vacl_aclcheck(td, nd.ni_vp, uap->type, uap->aclp); NDFREE(&nd, 0); } - VFS_UNLOCK_GIANT(vfslocked); return (error); } @@ -523,16 +503,14 @@ int __acl_aclcheck_link(struct thread *td, struct __acl_aclcheck_link_args *uap) { struct nameidata nd; - int vfslocked, error; + int error; - NDINIT(&nd, LOOKUP, MPSAFE|NOFOLLOW, UIO_USERSPACE, uap->path, td); + NDINIT(&nd, LOOKUP, NOFOLLOW, UIO_USERSPACE, uap->path, td); error = namei(&nd); - vfslocked = NDHASGIANT(&nd); if (error == 0) { error = vacl_aclcheck(td, nd.ni_vp, uap->type, uap->aclp); NDFREE(&nd, 0); } - VFS_UNLOCK_GIANT(vfslocked); return (error); } @@ -543,14 +521,12 @@ int __acl_aclcheck_fd(struct thread *td, struct __acl_aclcheck_fd_args *uap) { struct file *fp; - int vfslocked, error; + int error; error = getvnode(td->td_proc->p_fd, uap->filedes, &fp); if (error == 0) { - vfslocked = VFS_LOCK_GIANT(fp->f_vnode->v_mount); error = vacl_aclcheck(td, fp->f_vnode, uap->type, uap->aclp); fdrop(fp, td); - VFS_UNLOCK_GIANT(vfslocked); } return (error); } diff --git a/sys/kern/vfs_aio.c b/sys/kern/vfs_aio.c index 088e4f6..5957a8d 100644 --- a/sys/kern/vfs_aio.c +++ b/sys/kern/vfs_aio.c @@ -785,10 +785,8 @@ static int aio_fsync_vnode(struct thread *td, struct vnode *vp) { struct mount *mp; - int vfslocked; int error; - vfslocked = VFS_LOCK_GIANT(vp->v_mount); if ((error = vn_start_write(vp, &mp, V_WAIT | PCATCH)) != 0) goto drop; vn_lock(vp, LK_EXCLUSIVE | LK_RETRY); @@ -802,7 +800,6 @@ aio_fsync_vnode(struct thread *td, struct vnode *vp) VOP_UNLOCK(vp, 0); vn_finished_write(mp); drop: - VFS_UNLOCK_GIANT(vfslocked); return (error); } diff --git a/sys/kern/vfs_bio.c b/sys/kern/vfs_bio.c index df9a257..feb8837 100644 --- a/sys/kern/vfs_bio.c +++ b/sys/kern/vfs_bio.c @@ -259,14 +259,13 @@ static struct mtx nblock; /* * Definitions for the buffer free lists. */ -#define BUFFER_QUEUES 6 /* number of free buffer queues */ +#define BUFFER_QUEUES 5 /* number of free buffer queues */ #define QUEUE_NONE 0 /* on no queue */ #define QUEUE_CLEAN 1 /* non-B_DELWRI buffers */ #define QUEUE_DIRTY 2 /* B_DELWRI buffers */ -#define QUEUE_DIRTY_GIANT 3 /* B_DELWRI buffers that need giant */ -#define QUEUE_EMPTYKVA 4 /* empty buffer headers w/KVA assignment */ -#define QUEUE_EMPTY 5 /* empty buffer headers */ +#define QUEUE_EMPTYKVA 3 /* empty buffer headers w/KVA assignment */ +#define QUEUE_EMPTY 4 /* empty buffer headers */ #define QUEUE_SENTINEL 1024 /* not an queue index, but mark for sentinel */ /* Queues for free buffers with various properties */ @@ -1413,10 +1412,7 @@ brelse(struct buf *bp) TAILQ_INSERT_HEAD(&bufqueues[QUEUE_CLEAN], bp, b_freelist); /* remaining buffers */ } else { - if ((bp->b_flags & (B_DELWRI|B_NEEDSGIANT)) == - (B_DELWRI|B_NEEDSGIANT)) - bp->b_qindex = QUEUE_DIRTY_GIANT; - else if (bp->b_flags & B_DELWRI) + if (bp->b_flags & B_DELWRI) bp->b_qindex = QUEUE_DIRTY; else bp->b_qindex = QUEUE_CLEAN; @@ -1493,10 +1489,7 @@ bqrelse(struct buf *bp) panic("bqrelse: free buffer onto another queue???"); /* buffers with stale but valid contents */ if (bp->b_flags & B_DELWRI) { - if (bp->b_flags & B_NEEDSGIANT) - bp->b_qindex = QUEUE_DIRTY_GIANT; - else - bp->b_qindex = QUEUE_DIRTY; + bp->b_qindex = QUEUE_DIRTY; TAILQ_INSERT_TAIL(&bufqueues[bp->b_qindex], bp, b_freelist); } else { /* @@ -2094,12 +2087,6 @@ buf_do_flush(struct vnode *vp) int flushed; flushed = flushbufqueues(vp, QUEUE_DIRTY, 0); - /* The list empty check here is slightly racy */ - if (!TAILQ_EMPTY(&bufqueues[QUEUE_DIRTY_GIANT])) { - mtx_lock(&Giant); - flushed += flushbufqueues(vp, QUEUE_DIRTY_GIANT, 0); - mtx_unlock(&Giant); - } if (flushed == 0) { /* * Could not find any buffers without rollback @@ -2107,12 +2094,6 @@ buf_do_flush(struct vnode *vp) * in the hopes of eventually making progress. */ flushbufqueues(vp, QUEUE_DIRTY, 1); - if (!TAILQ_EMPTY( - &bufqueues[QUEUE_DIRTY_GIANT])) { - mtx_lock(&Giant); - flushbufqueues(vp, QUEUE_DIRTY_GIANT, 1); - mtx_unlock(&Giant); - } } return (flushed); } diff --git a/sys/kern/vfs_cache.c b/sys/kern/vfs_cache.c index 7854803..a327aef 100644 --- a/sys/kern/vfs_cache.c +++ b/sys/kern/vfs_cache.c @@ -918,7 +918,7 @@ kern___getcwd(struct thread *td, u_char *buf, enum uio_seg bufseg, u_int buflen) char *bp, *tmpbuf; struct filedesc *fdp; struct vnode *cdir, *rdir; - int error, vfslocked; + int error; if (disablecwd) return (ENODEV); @@ -936,12 +936,8 @@ kern___getcwd(struct thread *td, u_char *buf, enum uio_seg bufseg, u_int buflen) VREF(rdir); FILEDESC_SUNLOCK(fdp); error = vn_fullpath1(td, cdir, rdir, tmpbuf, &bp, buflen); - vfslocked = VFS_LOCK_GIANT(rdir->v_mount); vrele(rdir); - VFS_UNLOCK_GIANT(vfslocked); - vfslocked = VFS_LOCK_GIANT(cdir->v_mount); vrele(cdir); - VFS_UNLOCK_GIANT(vfslocked); if (!error) { if (bufseg == UIO_SYSSPACE) @@ -987,7 +983,7 @@ vn_fullpath(struct thread *td, struct vnode *vn, char **retbuf, char **freebuf) char *buf; struct filedesc *fdp; struct vnode *rdir; - int error, vfslocked; + int error; if (disablefullpath) return (ENODEV); @@ -1001,9 +997,7 @@ vn_fullpath(struct thread *td, struct vnode *vn, char **retbuf, char **freebuf) VREF(rdir); FILEDESC_SUNLOCK(fdp); error = vn_fullpath1(td, vn, rdir, buf, retbuf, MAXPATHLEN); - vfslocked = VFS_LOCK_GIANT(rdir->v_mount); vrele(rdir); - VFS_UNLOCK_GIANT(vfslocked); if (!error) *freebuf = buf; @@ -1064,7 +1058,7 @@ vn_vptocnp_locked(struct vnode **vp, struct ucred *cred, char *buf, { struct vnode *dvp; struct namecache *ncp; - int error, vfslocked; + int error; TAILQ_FOREACH(ncp, &((*vp)->v_cache_dst), nc_dst) { if ((ncp->nc_flag & NCF_ISDOTDOT) == 0) @@ -1090,12 +1084,10 @@ vn_vptocnp_locked(struct vnode **vp, struct ucred *cred, char *buf, vhold(*vp); CACHE_RUNLOCK(); - vfslocked = VFS_LOCK_GIANT((*vp)->v_mount); vn_lock(*vp, LK_SHARED | LK_RETRY); error = VOP_VPTOCNP(*vp, &dvp, cred, buf, buflen); VOP_UNLOCK(*vp, 0); vdrop(*vp); - VFS_UNLOCK_GIANT(vfslocked); if (error) { numfullpathfail2++; SDT_PROBE(vfs, namecache, fullpath, return, error, vp, diff --git a/sys/kern/vfs_extattr.c b/sys/kern/vfs_extattr.c index e7bf2d1..2e5fe78 100644 --- a/sys/kern/vfs_extattr.c +++ b/sys/kern/vfs_extattr.c @@ -68,7 +68,7 @@ extattrctl(td, uap) struct nameidata nd; struct mount *mp, *mp_writable; char attrname[EXTATTR_MAXNAMELEN]; - int vfslocked, fnvfslocked, error; + int error; AUDIT_ARG_CMD(uap->cmd); AUDIT_ARG_VALUE(uap->attrnamespace); @@ -84,27 +84,24 @@ extattrctl(td, uap) } AUDIT_ARG_TEXT(attrname); - vfslocked = fnvfslocked = 0; mp = NULL; filename_vp = NULL; if (uap->filename != NULL) { - NDINIT(&nd, LOOKUP, MPSAFE | FOLLOW | AUDITVNODE2, + NDINIT(&nd, LOOKUP, FOLLOW | AUDITVNODE2, UIO_USERSPACE, uap->filename, td); error = namei(&nd); if (error) return (error); - fnvfslocked = NDHASGIANT(&nd); filename_vp = nd.ni_vp; NDFREE(&nd, NDF_NO_VP_RELE); } /* uap->path is always defined. */ - NDINIT(&nd, LOOKUP, MPSAFE | FOLLOW | LOCKLEAF | AUDITVNODE1, + NDINIT(&nd, LOOKUP, FOLLOW | LOCKLEAF | AUDITVNODE1, UIO_USERSPACE, uap->path, td); error = namei(&nd); if (error) goto out; - vfslocked = NDHASGIANT(&nd); mp = nd.ni_vp->v_mount; error = vfs_busy(mp, 0); if (error) { @@ -144,8 +141,6 @@ out: */ if (filename_vp != NULL) vrele(filename_vp); - VFS_UNLOCK_GIANT(fnvfslocked); - VFS_UNLOCK_GIANT(vfslocked); return (error); } @@ -169,7 +164,6 @@ extattr_set_vp(struct vnode *vp, int attrnamespace, const char *attrname, ssize_t cnt; int error; - VFS_ASSERT_GIANT(vp->v_mount); error = vn_start_write(vp, &mp, V_WAIT | PCATCH); if (error) return (error); @@ -221,7 +215,7 @@ extattr_set_fd(td, uap) { struct file *fp; char attrname[EXTATTR_MAXNAMELEN]; - int vfslocked, error; + int error; AUDIT_ARG_FD(uap->fd); AUDIT_ARG_VALUE(uap->attrnamespace); @@ -234,11 +228,9 @@ extattr_set_fd(td, uap) if (error) return (error); - vfslocked = VFS_LOCK_GIANT(fp->f_vnode->v_mount); error = extattr_set_vp(fp->f_vnode, uap->attrnamespace, attrname, uap->data, uap->nbytes, td); fdrop(fp, td); - VFS_UNLOCK_GIANT(vfslocked); return (error); } @@ -256,7 +248,7 @@ extattr_set_file(td, uap) { struct nameidata nd; char attrname[EXTATTR_MAXNAMELEN]; - int vfslocked, error; + int error; AUDIT_ARG_VALUE(uap->attrnamespace); error = copyinstr(uap->attrname, attrname, EXTATTR_MAXNAMELEN, NULL); @@ -264,19 +256,17 @@ extattr_set_file(td, uap) return (error); AUDIT_ARG_TEXT(attrname); - NDINIT(&nd, LOOKUP, MPSAFE | FOLLOW | AUDITVNODE1, UIO_USERSPACE, + NDINIT(&nd, LOOKUP, FOLLOW | AUDITVNODE1, UIO_USERSPACE, uap->path, td); error = namei(&nd); if (error) return (error); NDFREE(&nd, NDF_ONLY_PNBUF); - vfslocked = NDHASGIANT(&nd); error = extattr_set_vp(nd.ni_vp, uap->attrnamespace, attrname, uap->data, uap->nbytes, td); vrele(nd.ni_vp); - VFS_UNLOCK_GIANT(vfslocked); return (error); } @@ -293,7 +283,7 @@ extattr_set_link(td, uap) { struct nameidata nd; char attrname[EXTATTR_MAXNAMELEN]; - int vfslocked, error; + int error; AUDIT_ARG_VALUE(uap->attrnamespace); error = copyinstr(uap->attrname, attrname, EXTATTR_MAXNAMELEN, NULL); @@ -301,19 +291,17 @@ extattr_set_link(td, uap) return (error); AUDIT_ARG_TEXT(attrname); - NDINIT(&nd, LOOKUP, MPSAFE | NOFOLLOW | AUDITVNODE1, UIO_USERSPACE, + NDINIT(&nd, LOOKUP, NOFOLLOW | AUDITVNODE1, UIO_USERSPACE, uap->path, td); error = namei(&nd); if (error) return (error); NDFREE(&nd, NDF_ONLY_PNBUF); - vfslocked = NDHASGIANT(&nd); error = extattr_set_vp(nd.ni_vp, uap->attrnamespace, attrname, uap->data, uap->nbytes, td); vrele(nd.ni_vp); - VFS_UNLOCK_GIANT(vfslocked); return (error); } @@ -337,7 +325,6 @@ extattr_get_vp(struct vnode *vp, int attrnamespace, const char *attrname, size_t size, *sizep; int error; - VFS_ASSERT_GIANT(vp->v_mount); vn_lock(vp, LK_EXCLUSIVE | LK_RETRY); /* @@ -401,7 +388,7 @@ extattr_get_fd(td, uap) { struct file *fp; char attrname[EXTATTR_MAXNAMELEN]; - int vfslocked, error; + int error; AUDIT_ARG_FD(uap->fd); AUDIT_ARG_VALUE(uap->attrnamespace); @@ -414,12 +401,10 @@ extattr_get_fd(td, uap) if (error) return (error); - vfslocked = VFS_LOCK_GIANT(fp->f_vnode->v_mount); error = extattr_get_vp(fp->f_vnode, uap->attrnamespace, attrname, uap->data, uap->nbytes, td); fdrop(fp, td); - VFS_UNLOCK_GIANT(vfslocked); return (error); } @@ -436,7 +421,7 @@ extattr_get_file(td, uap) { struct nameidata nd; char attrname[EXTATTR_MAXNAMELEN]; - int vfslocked, error; + int error; AUDIT_ARG_VALUE(uap->attrnamespace); error = copyinstr(uap->attrname, attrname, EXTATTR_MAXNAMELEN, NULL); @@ -444,19 +429,16 @@ extattr_get_file(td, uap) return (error); AUDIT_ARG_TEXT(attrname); - NDINIT(&nd, LOOKUP, MPSAFE | FOLLOW | AUDITVNODE1, UIO_USERSPACE, - uap->path, td); + NDINIT(&nd, LOOKUP, FOLLOW | AUDITVNODE1, UIO_USERSPACE, uap->path, td); error = namei(&nd); if (error) return (error); NDFREE(&nd, NDF_ONLY_PNBUF); - vfslocked = NDHASGIANT(&nd); error = extattr_get_vp(nd.ni_vp, uap->attrnamespace, attrname, uap->data, uap->nbytes, td); vrele(nd.ni_vp); - VFS_UNLOCK_GIANT(vfslocked); return (error); } @@ -473,7 +455,7 @@ extattr_get_link(td, uap) { struct nameidata nd; char attrname[EXTATTR_MAXNAMELEN]; - int vfslocked, error; + int error; AUDIT_ARG_VALUE(uap->attrnamespace); error = copyinstr(uap->attrname, attrname, EXTATTR_MAXNAMELEN, NULL); @@ -481,19 +463,17 @@ extattr_get_link(td, uap) return (error); AUDIT_ARG_TEXT(attrname); - NDINIT(&nd, LOOKUP, MPSAFE | NOFOLLOW | AUDITVNODE1, UIO_USERSPACE, - uap->path, td); + NDINIT(&nd, LOOKUP, NOFOLLOW | AUDITVNODE1, UIO_USERSPACE, uap->path, + td); error = namei(&nd); if (error) return (error); NDFREE(&nd, NDF_ONLY_PNBUF); - vfslocked = NDHASGIANT(&nd); error = extattr_get_vp(nd.ni_vp, uap->attrnamespace, attrname, uap->data, uap->nbytes, td); vrele(nd.ni_vp); - VFS_UNLOCK_GIANT(vfslocked); return (error); } @@ -514,7 +494,6 @@ extattr_delete_vp(struct vnode *vp, int attrnamespace, const char *attrname, struct mount *mp; int error; - VFS_ASSERT_GIANT(vp->v_mount); error = vn_start_write(vp, &mp, V_WAIT | PCATCH); if (error) return (error); @@ -551,7 +530,7 @@ extattr_delete_fd(td, uap) { struct file *fp; char attrname[EXTATTR_MAXNAMELEN]; - int vfslocked, error; + int error; AUDIT_ARG_FD(uap->fd); AUDIT_ARG_VALUE(uap->attrnamespace); @@ -564,11 +543,9 @@ extattr_delete_fd(td, uap) if (error) return (error); - vfslocked = VFS_LOCK_GIANT(fp->f_vnode->v_mount); error = extattr_delete_vp(fp->f_vnode, uap->attrnamespace, attrname, td); fdrop(fp, td); - VFS_UNLOCK_GIANT(vfslocked); return (error); } @@ -583,7 +560,7 @@ extattr_delete_file(td, uap) { struct nameidata nd; char attrname[EXTATTR_MAXNAMELEN]; - int vfslocked, error; + int error; AUDIT_ARG_VALUE(uap->attrnamespace); error = copyinstr(uap->attrname, attrname, EXTATTR_MAXNAMELEN, NULL); @@ -591,17 +568,14 @@ extattr_delete_file(td, uap) return(error); AUDIT_ARG_TEXT(attrname); - NDINIT(&nd, LOOKUP, MPSAFE | FOLLOW | AUDITVNODE1, UIO_USERSPACE, - uap->path, td); + NDINIT(&nd, LOOKUP, FOLLOW | AUDITVNODE1, UIO_USERSPACE, uap->path, td); error = namei(&nd); if (error) return(error); NDFREE(&nd, NDF_ONLY_PNBUF); - vfslocked = NDHASGIANT(&nd); error = extattr_delete_vp(nd.ni_vp, uap->attrnamespace, attrname, td); vrele(nd.ni_vp); - VFS_UNLOCK_GIANT(vfslocked); return(error); } @@ -616,7 +590,7 @@ extattr_delete_link(td, uap) { struct nameidata nd; char attrname[EXTATTR_MAXNAMELEN]; - int vfslocked, error; + int error; AUDIT_ARG_VALUE(uap->attrnamespace); error = copyinstr(uap->attrname, attrname, EXTATTR_MAXNAMELEN, NULL); @@ -624,17 +598,14 @@ extattr_delete_link(td, uap) return(error); AUDIT_ARG_TEXT(attrname); - NDINIT(&nd, LOOKUP, MPSAFE | NOFOLLOW | AUDITVNODE1, UIO_USERSPACE, - uap->path, td); + NDINIT(&nd, LOOKUP, NOFOLLOW | AUDITVNODE1, UIO_USERSPACE, uap->path, td); error = namei(&nd); if (error) return(error); NDFREE(&nd, NDF_ONLY_PNBUF); - vfslocked = NDHASGIANT(&nd); error = extattr_delete_vp(nd.ni_vp, uap->attrnamespace, attrname, td); vrele(nd.ni_vp); - VFS_UNLOCK_GIANT(vfslocked); return(error); } @@ -658,7 +629,6 @@ extattr_list_vp(struct vnode *vp, int attrnamespace, void *data, ssize_t cnt; int error; - VFS_ASSERT_GIANT(vp->v_mount); vn_lock(vp, LK_EXCLUSIVE | LK_RETRY); auiop = NULL; @@ -715,7 +685,7 @@ extattr_list_fd(td, uap) } */ *uap; { struct file *fp; - int vfslocked, error; + int error; AUDIT_ARG_FD(uap->fd); AUDIT_ARG_VALUE(uap->attrnamespace); @@ -723,12 +693,10 @@ extattr_list_fd(td, uap) if (error) return (error); - vfslocked = VFS_LOCK_GIANT(fp->f_vnode->v_mount); error = extattr_list_vp(fp->f_vnode, uap->attrnamespace, uap->data, uap->nbytes, td); fdrop(fp, td); - VFS_UNLOCK_GIANT(vfslocked); return (error); } @@ -743,22 +711,19 @@ extattr_list_file(td, uap) } */ *uap; { struct nameidata nd; - int vfslocked, error; + int error; AUDIT_ARG_VALUE(uap->attrnamespace); - NDINIT(&nd, LOOKUP, MPSAFE | FOLLOW | AUDITVNODE1, UIO_USERSPACE, - uap->path, td); + NDINIT(&nd, LOOKUP, FOLLOW | AUDITVNODE1, UIO_USERSPACE, uap->path, td); error = namei(&nd); if (error) return (error); NDFREE(&nd, NDF_ONLY_PNBUF); - vfslocked = NDHASGIANT(&nd); error = extattr_list_vp(nd.ni_vp, uap->attrnamespace, uap->data, uap->nbytes, td); vrele(nd.ni_vp); - VFS_UNLOCK_GIANT(vfslocked); return (error); } @@ -773,21 +738,19 @@ extattr_list_link(td, uap) } */ *uap; { struct nameidata nd; - int vfslocked, error; + int error; AUDIT_ARG_VALUE(uap->attrnamespace); - NDINIT(&nd, LOOKUP, MPSAFE | NOFOLLOW | AUDITVNODE1, UIO_USERSPACE, - uap->path, td); + NDINIT(&nd, LOOKUP, NOFOLLOW | AUDITVNODE1, UIO_USERSPACE, uap->path, + td); error = namei(&nd); if (error) return (error); NDFREE(&nd, NDF_ONLY_PNBUF); - vfslocked = NDHASGIANT(&nd); error = extattr_list_vp(nd.ni_vp, uap->attrnamespace, uap->data, uap->nbytes, td); vrele(nd.ni_vp); - VFS_UNLOCK_GIANT(vfslocked); return (error); } diff --git a/sys/kern/vfs_init.c b/sys/kern/vfs_init.c index 4367b8c..3be109a 100644 --- a/sys/kern/vfs_init.c +++ b/sys/kern/vfs_init.c @@ -150,7 +150,7 @@ vfs_register(struct vfsconf *vfc) return (EINVAL); } if (vfs_byname(vfc->vfc_name) != NULL) - return EEXIST; + return (EEXIST); vfc->vfc_typenum = maxvfsconf++; TAILQ_INSERT_TAIL(&vfsconf, vfc, vfc_list); diff --git a/sys/kern/vfs_lookup.c b/sys/kern/vfs_lookup.c index 6f10b49..e6c7cb9 100644 --- a/sys/kern/vfs_lookup.c +++ b/sys/kern/vfs_lookup.c @@ -132,10 +132,7 @@ namei(struct nameidata *ndp) struct componentname *cnp = &ndp->ni_cnd; struct thread *td = cnp->cn_thread; struct proc *p = td->td_proc; - int vfslocked; - KASSERT((cnp->cn_flags & MPSAFE) != 0 || mtx_owned(&Giant) != 0, - ("NOT MPSAFE and Giant not held")); ndp->ni_cnd.cn_cred = ndp->ni_cnd.cn_thread->td_ucred; KASSERT(cnp->cn_cred && p, ("namei: bad cred/proc")); KASSERT((cnp->cn_nameiop & (~OPMASK)) == 0, @@ -218,9 +215,7 @@ namei(struct nameidata *ndp) if (error != 0 || dp != NULL) { FILEDESC_SUNLOCK(fdp); if (error == 0 && dp->v_type != VDIR) { - vfslocked = VFS_LOCK_GIANT(dp->v_mount); vrele(dp); - VFS_UNLOCK_GIANT(vfslocked); error = ENOTDIR; } } @@ -237,15 +232,11 @@ namei(struct nameidata *ndp) dp = fdp->fd_cdir; VREF(dp); FILEDESC_SUNLOCK(fdp); - if (ndp->ni_startdir != NULL) { - vfslocked = VFS_LOCK_GIANT(ndp->ni_startdir->v_mount); + if (ndp->ni_startdir != NULL) vrele(ndp->ni_startdir); - VFS_UNLOCK_GIANT(vfslocked); - } } SDT_PROBE(vfs, namei, lookup, entry, dp, cnp->cn_pnbuf, cnp->cn_flags, 0, 0); - vfslocked = VFS_LOCK_GIANT(dp->v_mount); for (;;) { /* * Check if root directory should replace current directory. @@ -254,17 +245,13 @@ namei(struct nameidata *ndp) cnp->cn_nameptr = cnp->cn_pnbuf; if (*(cnp->cn_nameptr) == '/') { vrele(dp); - VFS_UNLOCK_GIANT(vfslocked); while (*(cnp->cn_nameptr) == '/') { cnp->cn_nameptr++; ndp->ni_pathlen--; } dp = ndp->ni_rootdir; - vfslocked = VFS_LOCK_GIANT(dp->v_mount); VREF(dp); } - if (vfslocked) - ndp->ni_cnd.cn_flags |= GIANTHELD; ndp->ni_startdir = dp; error = lookup(ndp); if (error) { @@ -277,8 +264,6 @@ namei(struct nameidata *ndp) 0, 0); return (error); } - vfslocked = (ndp->ni_cnd.cn_flags & GIANTHELD) != 0; - ndp->ni_cnd.cn_flags &= ~GIANTHELD; /* * If not a symbolic link, we're done. */ @@ -292,10 +277,6 @@ namei(struct nameidata *ndp) } else cnp->cn_flags |= HASBUF; - if ((cnp->cn_flags & MPSAFE) == 0) { - VFS_UNLOCK_GIANT(vfslocked); - } else if (vfslocked) - ndp->ni_cnd.cn_flags |= GIANTHELD; SDT_PROBE(vfs, namei, lookup, return, 0, ndp->ni_vp, 0, 0, 0); return (0); @@ -362,7 +343,6 @@ namei(struct nameidata *ndp) vput(ndp->ni_vp); ndp->ni_vp = NULL; vrele(ndp->ni_dvp); - VFS_UNLOCK_GIANT(vfslocked); SDT_PROBE(vfs, namei, lookup, return, error, NULL, 0, 0, 0); return (error); } @@ -466,17 +446,11 @@ lookup(struct nameidata *ndp) int error = 0; int dpunlocked = 0; /* dp has already been unlocked */ struct componentname *cnp = &ndp->ni_cnd; - int vfslocked; /* VFS Giant state for child */ - int dvfslocked; /* VFS Giant state for parent */ - int tvfslocked; int lkflags_save; /* * Setup: break out flag bits into variables. */ - dvfslocked = (ndp->ni_cnd.cn_flags & GIANTHELD) != 0; - vfslocked = 0; - ndp->ni_cnd.cn_flags &= ~GIANTHELD; wantparent = cnp->cn_flags & (LOCKPARENT | WANTPARENT); KASSERT(cnp->cn_nameiop == LOOKUP || wantparent, ("CREATE, DELETE, RENAME require LOCKPARENT or WANTPARENT.")); @@ -630,7 +604,6 @@ dirloop: (cnp->cn_flags & NOCROSSMOUNT) != 0)) { ndp->ni_dvp = dp; ndp->ni_vp = dp; - vfslocked = VFS_LOCK_GIANT(dp->v_mount); VREF(dp); goto nextname; } @@ -642,11 +615,8 @@ dirloop: } tdp = dp; dp = dp->v_mount->mnt_vnodecovered; - tvfslocked = dvfslocked; - dvfslocked = VFS_LOCK_GIANT(dp->v_mount); VREF(dp); vput(tdp); - VFS_UNLOCK_GIANT(tvfslocked); vn_lock(dp, compute_cn_lkflags(dp->v_mount, cnp->cn_lkflags | LK_RETRY)); @@ -668,7 +638,6 @@ unionlookup: ndp->ni_dvp = dp; ndp->ni_vp = NULL; ASSERT_VOP_LOCKED(dp, "lookup"); - VNASSERT(vfslocked == 0, dp, ("lookup: vfslocked %d", vfslocked)); /* * If we have a shared lock we may need to upgrade the lock for the * last operation. @@ -699,11 +668,8 @@ unionlookup: (dp->v_mount->mnt_flag & MNT_UNION)) { tdp = dp; dp = dp->v_mount->mnt_vnodecovered; - tvfslocked = dvfslocked; - dvfslocked = VFS_LOCK_GIANT(dp->v_mount); VREF(dp); vput(tdp); - VFS_UNLOCK_GIANT(tvfslocked); vn_lock(dp, compute_cn_lkflags(dp->v_mount, cnp->cn_lkflags | LK_RETRY)); @@ -757,7 +723,6 @@ unionlookup: } dp = ndp->ni_vp; - vfslocked = VFS_LOCK_GIANT(dp->v_mount); /* * Check to see if the vnode has been mounted on; @@ -768,14 +733,10 @@ unionlookup: if (vfs_busy(mp, 0)) continue; vput(dp); - VFS_UNLOCK_GIANT(vfslocked); - vfslocked = VFS_LOCK_GIANT(mp); if (dp != ndp->ni_dvp) vput(ndp->ni_dvp); else vrele(ndp->ni_dvp); - VFS_UNLOCK_GIANT(dvfslocked); - dvfslocked = 0; vref(vp_crossmp); ndp->ni_dvp = vp_crossmp; error = VFS_ROOT(mp, compute_cn_lkflags(mp, cnp->cn_lkflags), @@ -834,9 +795,6 @@ nextname: vput(ndp->ni_dvp); else vrele(ndp->ni_dvp); - VFS_UNLOCK_GIANT(dvfslocked); - dvfslocked = vfslocked; /* dp becomes dvp in dirloop */ - vfslocked = 0; goto dirloop; } /* @@ -864,8 +822,6 @@ nextname: vput(ndp->ni_dvp); else vrele(ndp->ni_dvp); - VFS_UNLOCK_GIANT(dvfslocked); - dvfslocked = 0; } else if ((cnp->cn_flags & LOCKPARENT) == 0 && ndp->ni_dvp != dp) VOP_UNLOCK(ndp->ni_dvp, 0); @@ -889,10 +845,6 @@ success: goto bad2; } } - if (vfslocked && dvfslocked) - VFS_UNLOCK_GIANT(dvfslocked); /* Only need one */ - if (vfslocked || dvfslocked) - ndp->ni_cnd.cn_flags |= GIANTHELD; return (0); bad2: @@ -903,9 +855,6 @@ bad2: bad: if (!dpunlocked) vput(dp); - VFS_UNLOCK_GIANT(vfslocked); - VFS_UNLOCK_GIANT(dvfslocked); - ndp->ni_cnd.cn_flags &= ~GIANTHELD; ndp->ni_vp = NULL; return (error); } @@ -1170,13 +1119,13 @@ kern_alternate_path(struct thread *td, const char *prefix, const char *path, for (cp = &ptr[len] - 1; *cp != '/'; cp--); *cp = '\0'; - NDINIT(&nd, LOOKUP, FOLLOW | MPSAFE, UIO_SYSSPACE, buf, td); + NDINIT(&nd, LOOKUP, FOLLOW, UIO_SYSSPACE, buf, td); error = namei(&nd); *cp = '/'; if (error != 0) goto keeporig; } else { - NDINIT(&nd, LOOKUP, FOLLOW | MPSAFE, UIO_SYSSPACE, buf, td); + NDINIT(&nd, LOOKUP, FOLLOW, UIO_SYSSPACE, buf, td); error = namei(&nd); if (error != 0) @@ -1190,7 +1139,7 @@ kern_alternate_path(struct thread *td, const char *prefix, const char *path, * root directory and never finding it, because "/" resolves * to the emulation root directory. This is expensive :-( */ - NDINIT(&ndroot, LOOKUP, FOLLOW | MPSAFE, UIO_SYSSPACE, prefix, + NDINIT(&ndroot, LOOKUP, FOLLOW, UIO_SYSSPACE, prefix, td); /* We shouldn't ever get an error from this namei(). */ @@ -1201,13 +1150,11 @@ kern_alternate_path(struct thread *td, const char *prefix, const char *path, NDFREE(&ndroot, NDF_ONLY_PNBUF); vrele(ndroot.ni_vp); - VFS_UNLOCK_GIANT(NDHASGIANT(&ndroot)); } } NDFREE(&nd, NDF_ONLY_PNBUF); vrele(nd.ni_vp); - VFS_UNLOCK_GIANT(NDHASGIANT(&nd)); keeporig: /* If there was an error, use the original path name. */ diff --git a/sys/kern/vfs_subr.c b/sys/kern/vfs_subr.c index daaa5b1..0a0f919 100644 --- a/sys/kern/vfs_subr.c +++ b/sys/kern/vfs_subr.c @@ -89,9 +89,6 @@ __FBSDID("$FreeBSD$"); #include #endif -#define WI_MPSAFEQ 0 -#define WI_GIANTQ 1 - static MALLOC_DEFINE(M_NETADDR, "subr_export_host", "Export host address structure"); static void delmntque(struct vnode *vp); @@ -219,7 +216,7 @@ int prtactive; static int syncer_delayno; static long syncer_mask; LIST_HEAD(synclist, bufobj); -static struct synclist *syncer_workitem_pending[2]; +static struct synclist *syncer_workitem_pending; /* * The sync_mtx protects: * bo->bo_synclist @@ -316,9 +313,7 @@ vntblinit(void *dummy __unused) /* * Initialize the filesystem syncer. */ - syncer_workitem_pending[WI_MPSAFEQ] = hashinit(syncer_maxdelay, M_VNODE, - &syncer_mask); - syncer_workitem_pending[WI_GIANTQ] = hashinit(syncer_maxdelay, M_VNODE, + syncer_workitem_pending = hashinit(syncer_maxdelay, M_VNODE, &syncer_mask); syncer_maxdelay = syncer_mask + 1; mtx_init(&sync_mtx, "Syncer mtx", NULL, MTX_DEF); @@ -713,7 +708,6 @@ static void vnlru_free(int count) { struct vnode *vp; - int vfslocked; mtx_assert(&vnode_free_list_mtx, MA_OWNED); for (; count > 0; count--) { @@ -741,9 +735,7 @@ vnlru_free(int count) vholdl(vp); mtx_unlock(&vnode_free_list_mtx); VI_UNLOCK(vp); - vfslocked = VFS_LOCK_GIANT(vp->v_mount); vtryrecycle(vp); - VFS_UNLOCK_GIANT(vfslocked); /* * If the recycled succeeded this vdrop will actually free * the vnode. If not it will simply place it back on @@ -765,7 +757,7 @@ static void vnlru_proc(void) { struct mount *mp, *nmp; - int done, vfslocked; + int done; struct proc *p = vnlruproc; EVENTHANDLER_REGISTER(shutdown_pre_sync, kproc_shutdown, p, @@ -791,9 +783,7 @@ vnlru_proc(void) nmp = TAILQ_NEXT(mp, mnt_list); continue; } - vfslocked = VFS_LOCK_GIANT(mp); done += vlrureclaim(mp); - VFS_UNLOCK_GIANT(vfslocked); mtx_lock(&mountlist_mtx); nmp = TAILQ_NEXT(mp, mnt_list); vfs_unbusy(mp); @@ -1067,11 +1057,8 @@ insmntque1(struct vnode *vp, struct mount *mp, KASSERT(vp->v_mount == NULL, ("insmntque: vnode already on per mount vnode list")); VNASSERT(mp != NULL, vp, ("Don't call insmntque(foo, NULL)")); -#ifdef DEBUG_VFS_LOCKS - if (!VFS_NEEDSGIANT(mp)) - ASSERT_VOP_ELOCKED(vp, - "insmntque: mp-safe fs and non-locked vp"); -#endif + ASSERT_VOP_ELOCKED(vp, + "insmntque: mp-safe fs and non-locked vp"); MNT_ILOCK(mp); if ((mp->mnt_kern_flag & MNTK_NOINSMNTQ) != 0 && ((mp->mnt_kern_flag & MNTK_UNMOUNTF) != 0 || @@ -1573,8 +1560,6 @@ bgetvp(struct vnode *vp, struct buf *bp) ("bgetvp: bp already attached! %p", bp)); vhold(vp); - if (VFS_NEEDSGIANT(vp->v_mount) || bo->bo_flag & BO_NEEDSGIANT) - bp->b_flags |= B_NEEDSGIANT; bp->b_vp = vp; bp->b_bufobj = bo; /* @@ -1625,7 +1610,7 @@ brelvp(struct buf *bp) static void vn_syncer_add_to_worklist(struct bufobj *bo, int delay) { - int queue, slot; + int slot; ASSERT_BO_LOCKED(bo); @@ -1641,10 +1626,7 @@ vn_syncer_add_to_worklist(struct bufobj *bo, int delay) delay = syncer_maxdelay - 2; slot = (syncer_delayno + delay) & syncer_mask; - queue = VFS_NEEDSGIANT(bo->__bo_vnode->v_mount) ? WI_GIANTQ : - WI_MPSAFEQ; - LIST_INSERT_HEAD(&syncer_workitem_pending[queue][slot], bo, - bo_synclist); + LIST_INSERT_HEAD(&syncer_workitem_pending[slot], bo, bo_synclist); mtx_unlock(&sync_mtx); } @@ -1724,8 +1706,7 @@ sync_vnode(struct synclist *slp, struct bufobj **bo, struct thread *td) static void sched_sync(void) { - struct synclist *gnext, *next; - struct synclist *gslp, *slp; + struct synclist *next, *slp; struct bufobj *bo; long starttime; struct thread *td = curthread; @@ -1771,13 +1752,11 @@ sched_sync(void) * Skip over empty worklist slots when shutting down. */ do { - slp = &syncer_workitem_pending[WI_MPSAFEQ][syncer_delayno]; - gslp = &syncer_workitem_pending[WI_GIANTQ][syncer_delayno]; + slp = &syncer_workitem_pending[syncer_delayno]; syncer_delayno += 1; if (syncer_delayno == syncer_maxdelay) syncer_delayno = 0; - next = &syncer_workitem_pending[WI_MPSAFEQ][syncer_delayno]; - gnext = &syncer_workitem_pending[WI_GIANTQ][syncer_delayno]; + next = &syncer_workitem_pending[syncer_delayno]; /* * If the worklist has wrapped since the * it was emptied of all but syncer vnodes, @@ -1791,7 +1770,7 @@ sched_sync(void) syncer_final_iter = SYNCER_SHUTDOWN_SPEEDUP; } } while (syncer_state != SYNCER_RUNNING && LIST_EMPTY(slp) && - LIST_EMPTY(gslp) && syncer_worklist_len > 0); + syncer_worklist_len > 0); /* * Keep track of the last time there was anything @@ -1811,21 +1790,6 @@ sched_sync(void) continue; } } - if (!LIST_EMPTY(gslp)) { - mtx_unlock(&sync_mtx); - mtx_lock(&Giant); - mtx_lock(&sync_mtx); - while (!LIST_EMPTY(gslp)) { - error = sync_vnode(gslp, &bo, td); - if (error == 1) { - LIST_REMOVE(bo, bo_synclist); - LIST_INSERT_HEAD(gnext, bo, - bo_synclist); - continue; - } - } - mtx_unlock(&Giant); - } if (syncer_state == SYNCER_FINAL_DELAY && syncer_final_iter > 0) syncer_final_iter--; /* @@ -2080,7 +2044,6 @@ vget(struct vnode *vp, int flags, struct thread *td) int error; error = 0; - VFS_ASSERT_GIANT(vp->v_mount); VNASSERT((flags & LK_TYPE_MASK) != 0, vp, ("vget: invalid lock operation")); CTR3(KTR_VFS, "%s: vp %p with flags %d", __func__, vp, flags); @@ -2165,7 +2128,6 @@ vputx(struct vnode *vp, int func) ASSERT_VOP_LOCKED(vp, "vput"); else KASSERT(func == VPUTX_VRELE, ("vputx: wrong func")); - VFS_ASSERT_GIANT(vp->v_mount); CTR2(KTR_VFS, "%s: vp %p", __func__, vp); VI_LOCK(vp); @@ -4293,7 +4255,6 @@ vfs_mark_atime(struct vnode *vp, struct ucred *cred) struct mount *mp; mp = vp->v_mount; - VFS_ASSERT_GIANT(mp); ASSERT_VOP_LOCKED(vp, "vfs_mark_atime"); if (mp != NULL && (mp->mnt_flag & (MNT_NOATIME | MNT_RDONLY)) == 0) (void)VOP_MARKATIME(vp); diff --git a/sys/kern/vfs_syscalls.c b/sys/kern/vfs_syscalls.c index aa072ff..3d2b25f 100644 --- a/sys/kern/vfs_syscalls.c +++ b/sys/kern/vfs_syscalls.c @@ -129,7 +129,6 @@ sync(td, uap) struct sync_args *uap; { struct mount *mp, *nmp; - int vfslocked; mtx_lock(&mountlist_mtx); for (mp = TAILQ_FIRST(&mountlist); mp != NULL; mp = nmp) { @@ -137,7 +136,6 @@ sync(td, uap) nmp = TAILQ_NEXT(mp, mnt_list); continue; } - vfslocked = VFS_LOCK_GIANT(mp); if ((mp->mnt_flag & MNT_RDONLY) == 0 && vn_start_write(NULL, &mp, V_NOWAIT) == 0) { MNT_ILOCK(mp); @@ -154,7 +152,6 @@ sync(td, uap) MNT_IUNLOCK(mp); vn_finished_write(mp); } - VFS_UNLOCK_GIANT(vfslocked); mtx_lock(&mountlist_mtx); nmp = TAILQ_NEXT(mp, mnt_list); vfs_unbusy(mp); @@ -185,7 +182,6 @@ quotactl(td, uap) } */ *uap; { struct mount *mp; - int vfslocked; int error; struct nameidata nd; @@ -193,24 +189,20 @@ quotactl(td, uap) AUDIT_ARG_UID(uap->uid); if (!prison_allow(td->td_ucred, PR_ALLOW_QUOTAS)) return (EPERM); - NDINIT(&nd, LOOKUP, FOLLOW | LOCKLEAF | MPSAFE | AUDITVNODE1, + NDINIT(&nd, LOOKUP, FOLLOW | LOCKLEAF | AUDITVNODE1, UIO_USERSPACE, uap->path, td); if ((error = namei(&nd)) != 0) return (error); - vfslocked = NDHASGIANT(&nd); NDFREE(&nd, NDF_ONLY_PNBUF); mp = nd.ni_vp->v_mount; vfs_ref(mp); vput(nd.ni_vp); error = vfs_busy(mp, 0); vfs_rel(mp); - if (error) { - VFS_UNLOCK_GIANT(vfslocked); + if (error) return (error); - } error = VFS_QUOTACTL(mp, uap->cmd, uap->uid, uap->arg); vfs_unbusy(mp); - VFS_UNLOCK_GIANT(vfslocked); return (error); } @@ -287,26 +279,22 @@ kern_statfs(struct thread *td, char *path, enum uio_seg pathseg, { struct mount *mp; struct statfs *sp, sb; - int vfslocked; int error; struct nameidata nd; - NDINIT(&nd, LOOKUP, FOLLOW | LOCKSHARED | LOCKLEAF | MPSAFE | + NDINIT(&nd, LOOKUP, FOLLOW | LOCKSHARED | LOCKLEAF | AUDITVNODE1, pathseg, path, td); error = namei(&nd); if (error) return (error); - vfslocked = NDHASGIANT(&nd); mp = nd.ni_vp->v_mount; vfs_ref(mp); NDFREE(&nd, NDF_ONLY_PNBUF); vput(nd.ni_vp); error = vfs_busy(mp, 0); vfs_rel(mp); - if (error) { - VFS_UNLOCK_GIANT(vfslocked); + if (error) return (error); - } #ifdef MAC error = mac_mount_check_stat(td->td_ucred, mp); if (error) @@ -331,7 +319,6 @@ kern_statfs(struct thread *td, char *path, enum uio_seg pathseg, *buf = *sp; out: vfs_unbusy(mp); - VFS_UNLOCK_GIANT(vfslocked); return (error); } @@ -367,7 +354,6 @@ kern_fstatfs(struct thread *td, int fd, struct statfs *buf) struct file *fp; struct mount *mp; struct statfs *sp, sb; - int vfslocked; struct vnode *vp; int error; @@ -376,7 +362,6 @@ kern_fstatfs(struct thread *td, int fd, struct statfs *buf) if (error) return (error); vp = fp->f_vnode; - vfslocked = VFS_LOCK_GIANT(vp->v_mount); vn_lock(vp, LK_SHARED | LK_RETRY); #ifdef AUDIT AUDIT_ARG_VNODE1(vp); @@ -392,10 +377,8 @@ kern_fstatfs(struct thread *td, int fd, struct statfs *buf) } error = vfs_busy(mp, 0); vfs_rel(mp); - if (error) { - VFS_UNLOCK_GIANT(vfslocked); + if (error) return (error); - } #ifdef MAC error = mac_mount_check_stat(td->td_ucred, mp); if (error) @@ -421,7 +404,6 @@ kern_fstatfs(struct thread *td, int fd, struct statfs *buf) out: if (mp) vfs_unbusy(mp); - VFS_UNLOCK_GIANT(vfslocked); return (error); } @@ -461,7 +443,6 @@ kern_getfsstat(struct thread *td, struct statfs **buf, size_t bufsize, struct mount *mp, *nmp; struct statfs *sfsp, *sp, sb; size_t count, maxcount; - int vfslocked; int error; maxcount = bufsize / sizeof(struct statfs); @@ -498,7 +479,6 @@ kern_getfsstat(struct thread *td, struct statfs **buf, size_t bufsize, nmp = TAILQ_NEXT(mp, mnt_list); continue; } - vfslocked = VFS_LOCK_GIANT(mp); if (sfsp && count < maxcount) { sp = &mp->mnt_stat; /* @@ -516,7 +496,6 @@ kern_getfsstat(struct thread *td, struct statfs **buf, size_t bufsize, if (((flags & (MNT_LAZY|MNT_NOWAIT)) == 0 || (flags & MNT_WAIT)) && (error = VFS_STATFS(mp, sp))) { - VFS_UNLOCK_GIANT(vfslocked); mtx_lock(&mountlist_mtx); nmp = TAILQ_NEXT(mp, mnt_list); vfs_unbusy(mp); @@ -534,13 +513,11 @@ kern_getfsstat(struct thread *td, struct statfs **buf, size_t bufsize, error = copyout(sp, sfsp, sizeof(*sp)); if (error) { vfs_unbusy(mp); - VFS_UNLOCK_GIANT(vfslocked); return (error); } } sfsp++; } - VFS_UNLOCK_GIANT(vfslocked); count++; mtx_lock(&mountlist_mtx); nmp = TAILQ_NEXT(mp, mnt_list); @@ -741,7 +718,6 @@ fchdir(td, uap) struct vnode *vp, *tdp, *vpold; struct mount *mp; struct file *fp; - int vfslocked; int error; AUDIT_ARG_FD(uap->fd); @@ -750,40 +726,29 @@ fchdir(td, uap) vp = fp->f_vnode; VREF(vp); fdrop(fp, td); - vfslocked = VFS_LOCK_GIANT(vp->v_mount); vn_lock(vp, LK_SHARED | LK_RETRY); AUDIT_ARG_VNODE1(vp); error = change_dir(vp, td); while (!error && (mp = vp->v_mountedhere) != NULL) { - int tvfslocked; if (vfs_busy(mp, 0)) continue; - tvfslocked = VFS_LOCK_GIANT(mp); error = VFS_ROOT(mp, LK_SHARED, &tdp); vfs_unbusy(mp); - if (error) { - VFS_UNLOCK_GIANT(tvfslocked); + if (error) break; - } vput(vp); - VFS_UNLOCK_GIANT(vfslocked); vp = tdp; - vfslocked = tvfslocked; } if (error) { vput(vp); - VFS_UNLOCK_GIANT(vfslocked); return (error); } VOP_UNLOCK(vp, 0); - VFS_UNLOCK_GIANT(vfslocked); FILEDESC_XLOCK(fdp); vpold = fdp->fd_cdir; fdp->fd_cdir = vp; FILEDESC_XUNLOCK(fdp); - vfslocked = VFS_LOCK_GIANT(vpold->v_mount); vrele(vpold); - VFS_UNLOCK_GIANT(vfslocked); return (0); } @@ -813,29 +778,23 @@ kern_chdir(struct thread *td, char *path, enum uio_seg pathseg) int error; struct nameidata nd; struct vnode *vp; - int vfslocked; - NDINIT(&nd, LOOKUP, FOLLOW | LOCKSHARED | LOCKLEAF | AUDITVNODE1 | - MPSAFE, pathseg, path, td); + NDINIT(&nd, LOOKUP, FOLLOW | LOCKSHARED | LOCKLEAF | AUDITVNODE1, + pathseg, path, td); if ((error = namei(&nd)) != 0) return (error); - vfslocked = NDHASGIANT(&nd); if ((error = change_dir(nd.ni_vp, td)) != 0) { vput(nd.ni_vp); - VFS_UNLOCK_GIANT(vfslocked); NDFREE(&nd, NDF_ONLY_PNBUF); return (error); } VOP_UNLOCK(nd.ni_vp, 0); - VFS_UNLOCK_GIANT(vfslocked); NDFREE(&nd, NDF_ONLY_PNBUF); FILEDESC_XLOCK(fdp); vp = fdp->fd_cdir; fdp->fd_cdir = nd.ni_vp; FILEDESC_XUNLOCK(fdp); - vfslocked = VFS_LOCK_GIANT(vp->v_mount); vrele(vp); - VFS_UNLOCK_GIANT(vfslocked); return (0); } @@ -896,17 +855,15 @@ chroot(td, uap) { int error; struct nameidata nd; - int vfslocked; error = priv_check(td, PRIV_VFS_CHROOT); if (error) return (error); - NDINIT(&nd, LOOKUP, FOLLOW | LOCKSHARED | LOCKLEAF | MPSAFE | + NDINIT(&nd, LOOKUP, FOLLOW | LOCKSHARED | LOCKLEAF | AUDITVNODE1, UIO_USERSPACE, uap->path, td); error = namei(&nd); if (error) goto error; - vfslocked = NDHASGIANT(&nd); if ((error = change_dir(nd.ni_vp, td)) != 0) goto e_vunlock; #ifdef MAC @@ -916,12 +873,10 @@ chroot(td, uap) VOP_UNLOCK(nd.ni_vp, 0); error = change_root(nd.ni_vp, td); vrele(nd.ni_vp); - VFS_UNLOCK_GIANT(vfslocked); NDFREE(&nd, NDF_ONLY_PNBUF); return (error); e_vunlock: vput(nd.ni_vp); - VFS_UNLOCK_GIANT(vfslocked); error: NDFREE(&nd, NDF_ONLY_PNBUF); return (error); @@ -962,10 +917,8 @@ change_root(vp, td) { struct filedesc *fdp; struct vnode *oldvp; - int vfslocked; int error; - VFS_ASSERT_GIANT(vp->v_mount); fdp = td->td_proc->p_fd; FILEDESC_XLOCK(fdp); if (chroot_allow_open_directories == 0 || @@ -984,9 +937,7 @@ change_root(vp, td) VREF(fdp->fd_jdir); } FILEDESC_XUNLOCK(fdp); - vfslocked = VFS_LOCK_GIANT(oldvp->v_mount); vrele(oldvp); - VFS_UNLOCK_GIANT(vfslocked); return (0); } @@ -1053,7 +1004,6 @@ kern_openat(struct thread *td, int fd, char *path, enum uio_seg pathseg, int type, indx, error; struct flock lf; struct nameidata nd; - int vfslocked; AUDIT_ARG_FFLAGS(flags); AUDIT_ARG_MODE(mode); @@ -1078,7 +1028,7 @@ kern_openat(struct thread *td, int fd, char *path, enum uio_seg pathseg, /* Set the flags early so the finit in devfs can pick them up. */ fp->f_flag = flags & FMASK; cmode = ((mode &~ fdp->fd_cmask) & ALLPERMS) &~ S_ISTXT; - NDINIT_AT(&nd, LOOKUP, FOLLOW | AUDITVNODE1 | MPSAFE, pathseg, path, fd, + NDINIT_AT(&nd, LOOKUP, FOLLOW | AUDITVNODE1, pathseg, path, fd, td); td->td_dupfd = -1; /* XXX check for fdopen */ error = vn_open(&nd, &flags, cmode, fp); @@ -1119,7 +1069,6 @@ kern_openat(struct thread *td, int fd, char *path, enum uio_seg pathseg, return (error); } td->td_dupfd = 0; - vfslocked = NDHASGIANT(&nd); NDFREE(&nd, NDF_ONLY_PNBUF); vp = nd.ni_vp; @@ -1167,7 +1116,6 @@ kern_openat(struct thread *td, int fd, char *path, enum uio_seg pathseg, if (error) goto bad; } - VFS_UNLOCK_GIANT(vfslocked); /* * Release our private reference, leaving the one associated with * the descriptor table intact. @@ -1176,7 +1124,6 @@ kern_openat(struct thread *td, int fd, char *path, enum uio_seg pathseg, td->td_retval[0] = indx; return (0); bad: - VFS_UNLOCK_GIANT(vfslocked); fdclose(fdp, fp, indx, td); fdrop(fp, td); return (error); @@ -1263,7 +1210,6 @@ kern_mknodat(struct thread *td, int fd, char *path, enum uio_seg pathseg, int error; int whiteout = 0; struct nameidata nd; - int vfslocked; AUDIT_ARG_MODE(mode); AUDIT_ARG_DEV(dev); @@ -1290,11 +1236,10 @@ kern_mknodat(struct thread *td, int fd, char *path, enum uio_seg pathseg, return (error); restart: bwillwrite(); - NDINIT_AT(&nd, CREATE, LOCKPARENT | SAVENAME | MPSAFE | AUDITVNODE1, + NDINIT_AT(&nd, CREATE, LOCKPARENT | SAVENAME | AUDITVNODE1, pathseg, path, fd, td); if ((error = namei(&nd)) != 0) return (error); - vfslocked = NDHASGIANT(&nd); vp = nd.ni_vp; if (vp != NULL) { NDFREE(&nd, NDF_ONLY_PNBUF); @@ -1303,7 +1248,6 @@ restart: else vput(nd.ni_dvp); vrele(vp); - VFS_UNLOCK_GIANT(vfslocked); return (EEXIST); } else { VATTR_NULL(&vattr); @@ -1332,7 +1276,6 @@ restart: if (vn_start_write(nd.ni_dvp, &mp, V_NOWAIT) != 0) { NDFREE(&nd, NDF_ONLY_PNBUF); vput(nd.ni_dvp); - VFS_UNLOCK_GIANT(vfslocked); if ((error = vn_start_write(NULL, &mp, V_XSLEEP | PCATCH)) != 0) return (error); goto restart; @@ -1355,7 +1298,6 @@ restart: NDFREE(&nd, NDF_ONLY_PNBUF); vput(nd.ni_dvp); vn_finished_write(mp); - VFS_UNLOCK_GIANT(vfslocked); return (error); } @@ -1410,16 +1352,14 @@ kern_mkfifoat(struct thread *td, int fd, char *path, enum uio_seg pathseg, struct vattr vattr; int error; struct nameidata nd; - int vfslocked; AUDIT_ARG_MODE(mode); restart: bwillwrite(); - NDINIT_AT(&nd, CREATE, LOCKPARENT | SAVENAME | MPSAFE | AUDITVNODE1, + NDINIT_AT(&nd, CREATE, LOCKPARENT | SAVENAME | AUDITVNODE1, pathseg, path, fd, td); if ((error = namei(&nd)) != 0) return (error); - vfslocked = NDHASGIANT(&nd); if (nd.ni_vp != NULL) { NDFREE(&nd, NDF_ONLY_PNBUF); if (nd.ni_vp == nd.ni_dvp) @@ -1427,13 +1367,11 @@ restart: else vput(nd.ni_dvp); vrele(nd.ni_vp); - VFS_UNLOCK_GIANT(vfslocked); return (EEXIST); } if (vn_start_write(nd.ni_dvp, &mp, V_NOWAIT) != 0) { NDFREE(&nd, NDF_ONLY_PNBUF); vput(nd.ni_dvp); - VFS_UNLOCK_GIANT(vfslocked); if ((error = vn_start_write(NULL, &mp, V_XSLEEP | PCATCH)) != 0) return (error); goto restart; @@ -1455,7 +1393,6 @@ out: #endif vput(nd.ni_dvp); vn_finished_write(mp); - VFS_UNLOCK_GIANT(vfslocked); NDFREE(&nd, NDF_ONLY_PNBUF); return (error); } @@ -1556,33 +1493,27 @@ kern_linkat(struct thread *td, int fd1, int fd2, char *path1, char *path2, struct vnode *vp; struct mount *mp; struct nameidata nd; - int vfslocked; - int lvfslocked; int error; bwillwrite(); - NDINIT_AT(&nd, LOOKUP, follow | MPSAFE | AUDITVNODE1, segflg, path1, + NDINIT_AT(&nd, LOOKUP, follow | AUDITVNODE1, segflg, path1, fd1, td); if ((error = namei(&nd)) != 0) return (error); - vfslocked = NDHASGIANT(&nd); NDFREE(&nd, NDF_ONLY_PNBUF); vp = nd.ni_vp; if (vp->v_type == VDIR) { vrele(vp); - VFS_UNLOCK_GIANT(vfslocked); return (EPERM); /* POSIX */ } if ((error = vn_start_write(vp, &mp, V_WAIT | PCATCH)) != 0) { vrele(vp); - VFS_UNLOCK_GIANT(vfslocked); return (error); } - NDINIT_AT(&nd, CREATE, LOCKPARENT | SAVENAME | MPSAFE | AUDITVNODE2, + NDINIT_AT(&nd, CREATE, LOCKPARENT | SAVENAME | AUDITVNODE2, segflg, path2, fd2, td); if ((error = namei(&nd)) == 0) { - lvfslocked = NDHASGIANT(&nd); if (nd.ni_vp != NULL) { if (nd.ni_dvp == nd.ni_vp) vrele(nd.ni_dvp); @@ -1604,11 +1535,9 @@ kern_linkat(struct thread *td, int fd1, int fd2, char *path1, char *path2, vput(nd.ni_dvp); } NDFREE(&nd, NDF_ONLY_PNBUF); - VFS_UNLOCK_GIANT(lvfslocked); } vrele(vp); vn_finished_write(mp); - VFS_UNLOCK_GIANT(vfslocked); return (error); } @@ -1664,7 +1593,6 @@ kern_symlinkat(struct thread *td, char *path1, int fd, char *path2, char *syspath; int error; struct nameidata nd; - int vfslocked; if (segflg == UIO_SYSSPACE) { syspath = path1; @@ -1676,11 +1604,10 @@ kern_symlinkat(struct thread *td, char *path1, int fd, char *path2, AUDIT_ARG_TEXT(syspath); restart: bwillwrite(); - NDINIT_AT(&nd, CREATE, LOCKPARENT | SAVENAME | MPSAFE | AUDITVNODE1, + NDINIT_AT(&nd, CREATE, LOCKPARENT | SAVENAME | AUDITVNODE1, segflg, path2, fd, td); if ((error = namei(&nd)) != 0) goto out; - vfslocked = NDHASGIANT(&nd); if (nd.ni_vp) { NDFREE(&nd, NDF_ONLY_PNBUF); if (nd.ni_vp == nd.ni_dvp) @@ -1688,14 +1615,12 @@ restart: else vput(nd.ni_dvp); vrele(nd.ni_vp); - VFS_UNLOCK_GIANT(vfslocked); error = EEXIST; goto out; } if (vn_start_write(nd.ni_dvp, &mp, V_NOWAIT) != 0) { NDFREE(&nd, NDF_ONLY_PNBUF); vput(nd.ni_dvp); - VFS_UNLOCK_GIANT(vfslocked); if ((error = vn_start_write(NULL, &mp, V_XSLEEP | PCATCH)) != 0) goto out; goto restart; @@ -1718,7 +1643,6 @@ out2: NDFREE(&nd, NDF_ONLY_PNBUF); vput(nd.ni_dvp); vn_finished_write(mp); - VFS_UNLOCK_GIANT(vfslocked); out: if (segflg != UIO_SYSSPACE) uma_zfree(namei_zone, syspath); @@ -1738,16 +1662,14 @@ undelete(td, uap) int error; struct mount *mp; struct nameidata nd; - int vfslocked; restart: bwillwrite(); - NDINIT(&nd, DELETE, LOCKPARENT | DOWHITEOUT | MPSAFE | AUDITVNODE1, + NDINIT(&nd, DELETE, LOCKPARENT | DOWHITEOUT | AUDITVNODE1, UIO_USERSPACE, uap->path, td); error = namei(&nd); if (error) return (error); - vfslocked = NDHASGIANT(&nd); if (nd.ni_vp != NULLVP || !(nd.ni_cnd.cn_flags & ISWHITEOUT)) { NDFREE(&nd, NDF_ONLY_PNBUF); @@ -1757,13 +1679,11 @@ restart: vput(nd.ni_dvp); if (nd.ni_vp) vrele(nd.ni_vp); - VFS_UNLOCK_GIANT(vfslocked); return (EEXIST); } if (vn_start_write(nd.ni_dvp, &mp, V_NOWAIT) != 0) { NDFREE(&nd, NDF_ONLY_PNBUF); vput(nd.ni_dvp); - VFS_UNLOCK_GIANT(vfslocked); if ((error = vn_start_write(NULL, &mp, V_XSLEEP | PCATCH)) != 0) return (error); goto restart; @@ -1772,7 +1692,6 @@ restart: NDFREE(&nd, NDF_ONLY_PNBUF); vput(nd.ni_dvp); vn_finished_write(mp); - VFS_UNLOCK_GIANT(vfslocked); return (error); } @@ -1834,15 +1753,13 @@ kern_unlinkat(struct thread *td, int fd, char *path, enum uio_seg pathseg, int error; struct nameidata nd; struct stat sb; - int vfslocked; restart: bwillwrite(); - NDINIT_AT(&nd, DELETE, LOCKPARENT | LOCKLEAF | MPSAFE | AUDITVNODE1, + NDINIT_AT(&nd, DELETE, LOCKPARENT | LOCKLEAF | AUDITVNODE1, pathseg, path, fd, td); if ((error = namei(&nd)) != 0) return (error == EINVAL ? EPERM : error); - vfslocked = NDHASGIANT(&nd); vp = nd.ni_vp; if (vp->v_type == VDIR && oldinum == 0) { error = EPERM; /* POSIX */ @@ -1867,7 +1784,6 @@ restart: vrele(vp); else vput(vp); - VFS_UNLOCK_GIANT(vfslocked); if ((error = vn_start_write(NULL, &mp, V_XSLEEP | PCATCH)) != 0) return (error); @@ -1891,7 +1807,6 @@ out: vrele(vp); else vput(vp); - VFS_UNLOCK_GIANT(vfslocked); return (error); } @@ -1922,7 +1837,6 @@ lseek(td, uap) struct vattr vattr; off_t offset; int error, noneg; - int vfslocked; AUDIT_ARG_FD(uap->fd); if ((error = fget(td, uap->fd, &fp)) != 0) @@ -1932,7 +1846,6 @@ lseek(td, uap) return (ESPIPE); } vp = fp->f_vnode; - vfslocked = VFS_LOCK_GIANT(vp->v_mount); noneg = (vp->v_type != VCHR); offset = uap->offset; switch (uap->whence) { @@ -1978,7 +1891,6 @@ lseek(td, uap) *(off_t *)(td->td_retval) = fp->f_offset; drop: fdrop(fp, td); - VFS_UNLOCK_GIANT(vfslocked); return (error); } @@ -2117,7 +2029,6 @@ kern_accessat(struct thread *td, int fd, char *path, enum uio_seg pathseg, struct ucred *cred, *tmpcred; struct vnode *vp; struct nameidata nd; - int vfslocked; int error; /* @@ -2134,17 +2045,15 @@ kern_accessat(struct thread *td, int fd, char *path, enum uio_seg pathseg, } else cred = tmpcred = td->td_ucred; AUDIT_ARG_VALUE(mode); - NDINIT_AT(&nd, LOOKUP, FOLLOW | LOCKSHARED | LOCKLEAF | MPSAFE | + NDINIT_AT(&nd, LOOKUP, FOLLOW | LOCKSHARED | LOCKLEAF | AUDITVNODE1, pathseg, path, fd, td); if ((error = namei(&nd)) != 0) goto out1; - vfslocked = NDHASGIANT(&nd); vp = nd.ni_vp; error = vn_access(vp, mode, tmpcred, td); NDFREE(&nd, NDF_ONLY_PNBUF); vput(vp); - VFS_UNLOCK_GIANT(vfslocked); out1: if (!(flags & AT_EACCESS)) { td->td_ucred = cred; @@ -2339,18 +2248,17 @@ kern_statat_vnhook(struct thread *td, int flag, int fd, char *path, { struct nameidata nd; struct stat sb; - int error, vfslocked; + int error; if (flag & ~AT_SYMLINK_NOFOLLOW) return (EINVAL); NDINIT_AT(&nd, LOOKUP, ((flag & AT_SYMLINK_NOFOLLOW) ? NOFOLLOW : - FOLLOW) | LOCKSHARED | LOCKLEAF | AUDITVNODE1 | MPSAFE, pathseg, + FOLLOW) | LOCKSHARED | LOCKLEAF | AUDITVNODE1, pathseg, path, fd, td); if ((error = namei(&nd)) != 0) return (error); - vfslocked = NDHASGIANT(&nd); error = vn_stat(nd.ni_vp, &sb, td->td_ucred, NOCRED, td); if (!error) { SDT_PROBE(vfs, , stat, mode, path, sb.st_mode, 0, 0, 0); @@ -2361,7 +2269,6 @@ kern_statat_vnhook(struct thread *td, int flag, int fd, char *path, } NDFREE(&nd, NDF_ONLY_PNBUF); vput(nd.ni_vp); - VFS_UNLOCK_GIANT(vfslocked); if (error) return (error); *sbp = sb; @@ -2532,13 +2439,12 @@ kern_pathconf(struct thread *td, char *path, enum uio_seg pathseg, int name, u_long flags) { struct nameidata nd; - int error, vfslocked; + int error; - NDINIT(&nd, LOOKUP, LOCKSHARED | LOCKLEAF | MPSAFE | AUDITVNODE1 | - flags, pathseg, path, td); + NDINIT(&nd, LOOKUP, LOCKSHARED | LOCKLEAF | AUDITVNODE1 | flags, + pathseg, path, td); if ((error = namei(&nd)) != 0) return (error); - vfslocked = NDHASGIANT(&nd); NDFREE(&nd, NDF_ONLY_PNBUF); /* If asynchronous I/O is available, it works for all files. */ @@ -2547,7 +2453,6 @@ kern_pathconf(struct thread *td, char *path, enum uio_seg pathseg, int name, else error = VOP_PATHCONF(nd.ni_vp, name, td->td_retval); vput(nd.ni_vp); - VFS_UNLOCK_GIANT(vfslocked); return (error); } @@ -2608,24 +2513,21 @@ kern_readlinkat(struct thread *td, int fd, char *path, enum uio_seg pathseg, struct uio auio; int error; struct nameidata nd; - int vfslocked; if (count > INT_MAX) return (EINVAL); - NDINIT_AT(&nd, LOOKUP, NOFOLLOW | LOCKSHARED | LOCKLEAF | MPSAFE | + NDINIT_AT(&nd, LOOKUP, NOFOLLOW | LOCKSHARED | LOCKLEAF | AUDITVNODE1, pathseg, path, fd, td); if ((error = namei(&nd)) != 0) return (error); NDFREE(&nd, NDF_ONLY_PNBUF); - vfslocked = NDHASGIANT(&nd); vp = nd.ni_vp; #ifdef MAC error = mac_vnode_check_readlink(td->td_ucred, vp); if (error) { vput(vp); - VFS_UNLOCK_GIANT(vfslocked); return (error); } #endif @@ -2644,7 +2546,6 @@ kern_readlinkat(struct thread *td, int fd, char *path, enum uio_seg pathseg, error = VOP_READLINK(vp, &auio, td->td_ucred); } vput(vp); - VFS_UNLOCK_GIANT(vfslocked); td->td_retval[0] = count - auio.uio_resid; return (error); } @@ -2708,18 +2609,15 @@ chflags(td, uap) { int error; struct nameidata nd; - int vfslocked; AUDIT_ARG_FFLAGS(uap->flags); - NDINIT(&nd, LOOKUP, FOLLOW | MPSAFE | AUDITVNODE1, UIO_USERSPACE, + NDINIT(&nd, LOOKUP, FOLLOW | AUDITVNODE1, UIO_USERSPACE, uap->path, td); if ((error = namei(&nd)) != 0) return (error); NDFREE(&nd, NDF_ONLY_PNBUF); - vfslocked = NDHASGIANT(&nd); error = setfflags(td, nd.ni_vp, uap->flags); vrele(nd.ni_vp); - VFS_UNLOCK_GIANT(vfslocked); return (error); } @@ -2736,18 +2634,15 @@ lchflags(td, uap) { int error; struct nameidata nd; - int vfslocked; AUDIT_ARG_FFLAGS(uap->flags); - NDINIT(&nd, LOOKUP, NOFOLLOW | MPSAFE | AUDITVNODE1, UIO_USERSPACE, + NDINIT(&nd, LOOKUP, NOFOLLOW | AUDITVNODE1, UIO_USERSPACE, uap->path, td); if ((error = namei(&nd)) != 0) return (error); - vfslocked = NDHASGIANT(&nd); NDFREE(&nd, NDF_ONLY_PNBUF); error = setfflags(td, nd.ni_vp, uap->flags); vrele(nd.ni_vp); - VFS_UNLOCK_GIANT(vfslocked); return (error); } @@ -2769,21 +2664,18 @@ fchflags(td, uap) } */ *uap; { struct file *fp; - int vfslocked; int error; AUDIT_ARG_FD(uap->fd); AUDIT_ARG_FFLAGS(uap->flags); if ((error = getvnode(td->td_proc->p_fd, uap->fd, &fp)) != 0) return (error); - vfslocked = VFS_LOCK_GIANT(fp->f_vnode->v_mount); #ifdef AUDIT vn_lock(fp->f_vnode, LK_SHARED | LK_RETRY); AUDIT_ARG_VNODE1(fp->f_vnode); VOP_UNLOCK(fp->f_vnode, 0); #endif error = setfflags(td, fp->f_vnode, uap->flags); - VFS_UNLOCK_GIANT(vfslocked); fdrop(fp, td); return (error); } @@ -2895,20 +2787,17 @@ kern_fchmodat(struct thread *td, int fd, char *path, enum uio_seg pathseg, { int error; struct nameidata nd; - int vfslocked; int follow; AUDIT_ARG_MODE(mode); follow = (flag & AT_SYMLINK_NOFOLLOW) ? NOFOLLOW : FOLLOW; - NDINIT_AT(&nd, LOOKUP, follow | MPSAFE | AUDITVNODE1, pathseg, path, + NDINIT_AT(&nd, LOOKUP, follow | AUDITVNODE1, pathseg, path, fd, td); if ((error = namei(&nd)) != 0) return (error); - vfslocked = NDHASGIANT(&nd); NDFREE(&nd, NDF_ONLY_PNBUF); error = setfmode(td, nd.ni_vp, mode); vrele(nd.ni_vp); - VFS_UNLOCK_GIANT(vfslocked); return (error); } @@ -2930,21 +2819,18 @@ fchmod(td, uap) } */ *uap; { struct file *fp; - int vfslocked; int error; AUDIT_ARG_FD(uap->fd); AUDIT_ARG_MODE(uap->mode); if ((error = getvnode(td->td_proc->p_fd, uap->fd, &fp)) != 0) return (error); - vfslocked = VFS_LOCK_GIANT(fp->f_vnode->v_mount); #ifdef AUDIT vn_lock(fp->f_vnode, LK_SHARED | LK_RETRY); AUDIT_ARG_VNODE1(fp->f_vnode); VOP_UNLOCK(fp->f_vnode, 0); #endif error = setfmode(td, fp->f_vnode, uap->mode); - VFS_UNLOCK_GIANT(vfslocked); fdrop(fp, td); return (error); } @@ -3038,20 +2924,18 @@ kern_fchownat(struct thread *td, int fd, char *path, enum uio_seg pathseg, int uid, int gid, int flag) { struct nameidata nd; - int error, vfslocked, follow; + int error, follow; AUDIT_ARG_OWNER(uid, gid); follow = (flag & AT_SYMLINK_NOFOLLOW) ? NOFOLLOW : FOLLOW; - NDINIT_AT(&nd, LOOKUP, follow | MPSAFE | AUDITVNODE1, pathseg, path, + NDINIT_AT(&nd, LOOKUP, follow | AUDITVNODE1, pathseg, path, fd, td); if ((error = namei(&nd)) != 0) return (error); - vfslocked = NDHASGIANT(&nd); NDFREE(&nd, NDF_ONLY_PNBUF); error = setfown(td, nd.ni_vp, uid, gid); vrele(nd.ni_vp); - VFS_UNLOCK_GIANT(vfslocked); return (error); } @@ -3107,21 +2991,18 @@ fchown(td, uap) } */ *uap; { struct file *fp; - int vfslocked; int error; AUDIT_ARG_FD(uap->fd); AUDIT_ARG_OWNER(uap->uid, uap->gid); if ((error = getvnode(td->td_proc->p_fd, uap->fd, &fp)) != 0) return (error); - vfslocked = VFS_LOCK_GIANT(fp->f_vnode->v_mount); #ifdef AUDIT vn_lock(fp->f_vnode, LK_SHARED | LK_RETRY); AUDIT_ARG_VNODE1(fp->f_vnode); VOP_UNLOCK(fp->f_vnode, 0); #endif error = setfown(td, fp->f_vnode, uap->uid, uap->gid); - VFS_UNLOCK_GIANT(vfslocked); fdrop(fp, td); return (error); } @@ -3253,20 +3134,17 @@ kern_utimesat(struct thread *td, int fd, char *path, enum uio_seg pathseg, { struct nameidata nd; struct timespec ts[2]; - int error, vfslocked; + int error; if ((error = getutimes(tptr, tptrseg, ts)) != 0) return (error); - NDINIT_AT(&nd, LOOKUP, FOLLOW | MPSAFE | AUDITVNODE1, pathseg, path, - fd, td); + NDINIT_AT(&nd, LOOKUP, FOLLOW | AUDITVNODE1, pathseg, path, fd, td); if ((error = namei(&nd)) != 0) return (error); - vfslocked = NDHASGIANT(&nd); NDFREE(&nd, NDF_ONLY_PNBUF); error = setutimes(td, nd.ni_vp, ts, 2, tptr == NULL); vrele(nd.ni_vp); - VFS_UNLOCK_GIANT(vfslocked); return (error); } @@ -3299,18 +3177,15 @@ kern_lutimes(struct thread *td, char *path, enum uio_seg pathseg, struct timespec ts[2]; int error; struct nameidata nd; - int vfslocked; if ((error = getutimes(tptr, tptrseg, ts)) != 0) return (error); - NDINIT(&nd, LOOKUP, NOFOLLOW | MPSAFE | AUDITVNODE1, pathseg, path, td); + NDINIT(&nd, LOOKUP, NOFOLLOW | AUDITVNODE1, pathseg, path, td); if ((error = namei(&nd)) != 0) return (error); - vfslocked = NDHASGIANT(&nd); NDFREE(&nd, NDF_ONLY_PNBUF); error = setutimes(td, nd.ni_vp, ts, 2, tptr == NULL); vrele(nd.ni_vp); - VFS_UNLOCK_GIANT(vfslocked); return (error); } @@ -3341,7 +3216,6 @@ kern_futimes(struct thread *td, int fd, struct timeval *tptr, { struct timespec ts[2]; struct file *fp; - int vfslocked; int error; AUDIT_ARG_FD(fd); @@ -3349,14 +3223,12 @@ kern_futimes(struct thread *td, int fd, struct timeval *tptr, return (error); if ((error = getvnode(td->td_proc->p_fd, fd, &fp)) != 0) return (error); - vfslocked = VFS_LOCK_GIANT(fp->f_vnode->v_mount); #ifdef AUDIT vn_lock(fp->f_vnode, LK_SHARED | LK_RETRY); AUDIT_ARG_VNODE1(fp->f_vnode); VOP_UNLOCK(fp->f_vnode, 0); #endif error = setutimes(td, fp->f_vnode, ts, 2, tptr == NULL); - VFS_UNLOCK_GIANT(vfslocked); fdrop(fp, td); return (error); } @@ -3392,18 +3264,15 @@ kern_truncate(struct thread *td, char *path, enum uio_seg pathseg, off_t length) struct vattr vattr; int error; struct nameidata nd; - int vfslocked; if (length < 0) return(EINVAL); - NDINIT(&nd, LOOKUP, FOLLOW | MPSAFE | AUDITVNODE1, pathseg, path, td); + NDINIT(&nd, LOOKUP, FOLLOW | AUDITVNODE1, pathseg, path, td); if ((error = namei(&nd)) != 0) return (error); - vfslocked = NDHASGIANT(&nd); vp = nd.ni_vp; if ((error = vn_start_write(vp, &mp, V_WAIT | PCATCH)) != 0) { vrele(vp); - VFS_UNLOCK_GIANT(vfslocked); return (error); } NDFREE(&nd, NDF_ONLY_PNBUF); @@ -3422,7 +3291,6 @@ kern_truncate(struct thread *td, char *path, enum uio_seg pathseg, off_t length) } vput(vp); vn_finished_write(mp); - VFS_UNLOCK_GIANT(vfslocked); return (error); } @@ -3495,14 +3363,12 @@ fsync(td, uap) struct vnode *vp; struct mount *mp; struct file *fp; - int vfslocked; int error, lock_flags; AUDIT_ARG_FD(uap->fd); if ((error = getvnode(td->td_proc->p_fd, uap->fd, &fp)) != 0) return (error); vp = fp->f_vnode; - vfslocked = VFS_LOCK_GIANT(vp->v_mount); if ((error = vn_start_write(vp, &mp, V_WAIT | PCATCH)) != 0) goto drop; if (MNT_SHARED_WRITES(mp) || @@ -3523,7 +3389,6 @@ fsync(td, uap) VOP_UNLOCK(vp, 0); vn_finished_write(mp); drop: - VFS_UNLOCK_GIANT(vfslocked); fdrop(fp, td); return (error); } @@ -3580,23 +3445,19 @@ kern_renameat(struct thread *td, int oldfd, char *old, int newfd, char *new, struct mount *mp = NULL; struct vnode *tvp, *fvp, *tdvp; struct nameidata fromnd, tond; - int tvfslocked; - int fvfslocked; int error; bwillwrite(); #ifdef MAC - NDINIT_AT(&fromnd, DELETE, LOCKPARENT | LOCKLEAF | SAVESTART | MPSAFE | + NDINIT_AT(&fromnd, DELETE, LOCKPARENT | LOCKLEAF | SAVESTART | AUDITVNODE1, pathseg, old, oldfd, td); #else - NDINIT_AT(&fromnd, DELETE, WANTPARENT | SAVESTART | MPSAFE | + NDINIT_AT(&fromnd, DELETE, WANTPARENT | SAVESTART | AUDITVNODE1, pathseg, old, oldfd, td); #endif if ((error = namei(&fromnd)) != 0) return (error); - fvfslocked = NDHASGIANT(&fromnd); - tvfslocked = 0; #ifdef MAC error = mac_vnode_check_rename_from(td->td_ucred, fromnd.ni_dvp, fromnd.ni_vp, &fromnd.ni_cnd); @@ -3614,7 +3475,7 @@ kern_renameat(struct thread *td, int oldfd, char *old, int newfd, char *new, goto out1; } NDINIT_AT(&tond, RENAME, LOCKPARENT | LOCKLEAF | NOCACHE | SAVESTART | - MPSAFE | AUDITVNODE2, pathseg, new, newfd, td); + AUDITVNODE2, pathseg, new, newfd, td); if (fromnd.ni_vp->v_type == VDIR) tond.ni_cnd.cn_flags |= WILLBEDIR; if ((error = namei(&tond)) != 0) { @@ -3627,7 +3488,6 @@ kern_renameat(struct thread *td, int oldfd, char *old, int newfd, char *new, vn_finished_write(mp); goto out1; } - tvfslocked = NDHASGIANT(&tond); tdvp = tond.ni_dvp; tvp = tond.ni_vp; if (tvp != NULL) { @@ -3677,8 +3537,6 @@ out: out1: if (fromnd.ni_startdir) vrele(fromnd.ni_startdir); - VFS_UNLOCK_GIANT(fvfslocked); - VFS_UNLOCK_GIANT(tvfslocked); if (error == -1) return (0); return (error); @@ -3735,17 +3593,15 @@ kern_mkdirat(struct thread *td, int fd, char *path, enum uio_seg segflg, struct vattr vattr; int error; struct nameidata nd; - int vfslocked; AUDIT_ARG_MODE(mode); restart: bwillwrite(); - NDINIT_AT(&nd, CREATE, LOCKPARENT | SAVENAME | MPSAFE | AUDITVNODE1, + NDINIT_AT(&nd, CREATE, LOCKPARENT | SAVENAME | AUDITVNODE1, segflg, path, fd, td); nd.ni_cnd.cn_flags |= WILLBEDIR; if ((error = namei(&nd)) != 0) return (error); - vfslocked = NDHASGIANT(&nd); vp = nd.ni_vp; if (vp != NULL) { NDFREE(&nd, NDF_ONLY_PNBUF); @@ -3759,13 +3615,11 @@ restart: else vput(nd.ni_dvp); vrele(vp); - VFS_UNLOCK_GIANT(vfslocked); return (EEXIST); } if (vn_start_write(nd.ni_dvp, &mp, V_NOWAIT) != 0) { NDFREE(&nd, NDF_ONLY_PNBUF); vput(nd.ni_dvp); - VFS_UNLOCK_GIANT(vfslocked); if ((error = vn_start_write(NULL, &mp, V_XSLEEP | PCATCH)) != 0) return (error); goto restart; @@ -3788,7 +3642,6 @@ out: if (!error) vput(nd.ni_vp); vn_finished_write(mp); - VFS_UNLOCK_GIANT(vfslocked); return (error); } @@ -3825,15 +3678,13 @@ kern_rmdirat(struct thread *td, int fd, char *path, enum uio_seg pathseg) struct vnode *vp; int error; struct nameidata nd; - int vfslocked; restart: bwillwrite(); - NDINIT_AT(&nd, DELETE, LOCKPARENT | LOCKLEAF | MPSAFE | AUDITVNODE1, + NDINIT_AT(&nd, DELETE, LOCKPARENT | LOCKLEAF | AUDITVNODE1, pathseg, path, fd, td); if ((error = namei(&nd)) != 0) return (error); - vfslocked = NDHASGIANT(&nd); vp = nd.ni_vp; if (vp->v_type != VDIR) { error = ENOTDIR; @@ -3866,7 +3717,6 @@ restart: vrele(nd.ni_dvp); else vput(nd.ni_dvp); - VFS_UNLOCK_GIANT(vfslocked); if ((error = vn_start_write(NULL, &mp, V_XSLEEP | PCATCH)) != 0) return (error); goto restart; @@ -3880,7 +3730,6 @@ out: vrele(nd.ni_dvp); else vput(nd.ni_dvp); - VFS_UNLOCK_GIANT(vfslocked); return (error); } @@ -3912,7 +3761,7 @@ ogetdirentries(td, uap) struct iovec aiov, kiov; struct dirent *dp, *edp; caddr_t dirbuf; - int error, eofflag, readcnt, vfslocked; + int error, eofflag, readcnt; long loff; /* XXX arbitrary sanity limit on `count'. */ @@ -3926,9 +3775,7 @@ ogetdirentries(td, uap) } vp = fp->f_vnode; unionread: - vfslocked = VFS_LOCK_GIANT(vp->v_mount); if (vp->v_type != VDIR) { - VFS_UNLOCK_GIANT(vfslocked); fdrop(fp, td); return (EINVAL); } @@ -3946,7 +3793,6 @@ unionread: error = mac_vnode_check_readdir(td->td_ucred, vp); if (error) { VOP_UNLOCK(vp, 0); - VFS_UNLOCK_GIANT(vfslocked); fdrop(fp, td); return (error); } @@ -4004,7 +3850,6 @@ unionread: } if (error) { VOP_UNLOCK(vp, 0); - VFS_UNLOCK_GIANT(vfslocked); fdrop(fp, td); return (error); } @@ -4018,11 +3863,9 @@ unionread: fp->f_data = vp; fp->f_offset = 0; vput(tvp); - VFS_UNLOCK_GIANT(vfslocked); goto unionread; } VOP_UNLOCK(vp, 0); - VFS_UNLOCK_GIANT(vfslocked); error = copyout(&loff, uap->basep, sizeof(long)); fdrop(fp, td); td->td_retval[0] = uap->count - auio.uio_resid; @@ -4070,7 +3913,6 @@ kern_getdirentries(struct thread *td, int fd, char *buf, u_int count, struct file *fp; struct uio auio; struct iovec aiov; - int vfslocked; long loff; int error, eofflag; @@ -4085,9 +3927,7 @@ kern_getdirentries(struct thread *td, int fd, char *buf, u_int count, } vp = fp->f_vnode; unionread: - vfslocked = VFS_LOCK_GIANT(vp->v_mount); if (vp->v_type != VDIR) { - VFS_UNLOCK_GIANT(vfslocked); error = EINVAL; goto fail; } @@ -4111,7 +3951,6 @@ unionread: fp->f_offset = auio.uio_offset; if (error) { VOP_UNLOCK(vp, 0); - VFS_UNLOCK_GIANT(vfslocked); goto fail; } if (count == auio.uio_resid && @@ -4124,11 +3963,9 @@ unionread: fp->f_data = vp; fp->f_offset = 0; vput(tvp); - VFS_UNLOCK_GIANT(vfslocked); goto unionread; } VOP_UNLOCK(vp, 0); - VFS_UNLOCK_GIANT(vfslocked); *basep = loff; td->td_retval[0] = count - auio.uio_resid; fail: @@ -4205,13 +4042,11 @@ revoke(td, uap) struct vattr vattr; int error; struct nameidata nd; - int vfslocked; - NDINIT(&nd, LOOKUP, FOLLOW | LOCKLEAF | MPSAFE | AUDITVNODE1, + NDINIT(&nd, LOOKUP, FOLLOW | LOCKLEAF | AUDITVNODE1, UIO_USERSPACE, uap->path, td); if ((error = namei(&nd)) != 0) return (error); - vfslocked = NDHASGIANT(&nd); vp = nd.ni_vp; NDFREE(&nd, NDF_ONLY_PNBUF); if (vp->v_type != VCHR) { @@ -4235,7 +4070,6 @@ revoke(td, uap) VOP_REVOKE(vp, REVOKEALL); out: vput(vp); - VFS_UNLOCK_GIANT(vfslocked); return (error); } @@ -4281,25 +4115,22 @@ lgetfh(td, uap) struct nameidata nd; fhandle_t fh; register struct vnode *vp; - int vfslocked; int error; error = priv_check(td, PRIV_VFS_GETFH); if (error) return (error); - NDINIT(&nd, LOOKUP, NOFOLLOW | LOCKLEAF | MPSAFE | AUDITVNODE1, + NDINIT(&nd, LOOKUP, NOFOLLOW | LOCKLEAF | AUDITVNODE1, UIO_USERSPACE, uap->fname, td); error = namei(&nd); if (error) return (error); - vfslocked = NDHASGIANT(&nd); NDFREE(&nd, NDF_ONLY_PNBUF); vp = nd.ni_vp; bzero(&fh, sizeof(fh)); fh.fh_fsid = vp->v_mount->mnt_stat.f_fsid; error = VOP_VPTOFH(vp, &fh.fh_fid); vput(vp); - VFS_UNLOCK_GIANT(vfslocked); if (error) return (error); error = copyout(&fh, uap->fhp, sizeof (fh)); @@ -4320,25 +4151,22 @@ getfh(td, uap) struct nameidata nd; fhandle_t fh; register struct vnode *vp; - int vfslocked; int error; error = priv_check(td, PRIV_VFS_GETFH); if (error) return (error); - NDINIT(&nd, LOOKUP, FOLLOW | LOCKLEAF | MPSAFE | AUDITVNODE1, + NDINIT(&nd, LOOKUP, FOLLOW | LOCKLEAF | AUDITVNODE1, UIO_USERSPACE, uap->fname, td); error = namei(&nd); if (error) return (error); - vfslocked = NDHASGIANT(&nd); NDFREE(&nd, NDF_ONLY_PNBUF); vp = nd.ni_vp; bzero(&fh, sizeof(fh)); fh.fh_fsid = vp->v_mount->mnt_stat.f_fsid; error = VOP_VPTOFH(vp, &fh.fh_fid); vput(vp); - VFS_UNLOCK_GIANT(vfslocked); if (error) return (error); error = copyout(&fh, uap->fhp, sizeof (fh)); @@ -4378,7 +4206,6 @@ fhopen(td, uap) int fmode, error, type; accmode_t accmode; struct file *nfp; - int vfslocked; int indx; error = priv_check(td, PRIV_VFS_FHOPEN); @@ -4395,7 +4222,6 @@ fhopen(td, uap) mp = vfs_busyfs(&fhp.fh_fsid); if (mp == NULL) return (ESTALE); - vfslocked = VFS_LOCK_GIANT(mp); /* now give me my vnode, it gets returned to me locked */ error = VFS_FHTOVP(mp, &fhp.fh_fid, &vp); vfs_unbusy(mp); @@ -4525,14 +4351,12 @@ fhopen(td, uap) VOP_UNLOCK(vp, 0); fdrop(fp, td); - VFS_UNLOCK_GIANT(vfslocked); td->td_retval[0] = indx; return (0); bad: vput(vp); out: - VFS_UNLOCK_GIANT(vfslocked); return (error); } @@ -4557,7 +4381,6 @@ fhstat(td, uap) fhandle_t fh; struct mount *mp; struct vnode *vp; - int vfslocked; int error; error = priv_check(td, PRIV_VFS_FHSTAT); @@ -4568,16 +4391,12 @@ fhstat(td, uap) return (error); if ((mp = vfs_busyfs(&fh.fh_fsid)) == NULL) return (ESTALE); - vfslocked = VFS_LOCK_GIANT(mp); error = VFS_FHTOVP(mp, &fh.fh_fid, &vp); vfs_unbusy(mp); - if (error) { - VFS_UNLOCK_GIANT(vfslocked); + if (error) return (error); - } error = vn_stat(vp, &sb, td->td_ucred, NOCRED, td); vput(vp); - VFS_UNLOCK_GIANT(vfslocked); if (error) return (error); error = copyout(&sb, uap->sb, sizeof(sb)); @@ -4620,7 +4439,6 @@ kern_fhstatfs(struct thread *td, fhandle_t fh, struct statfs *buf) struct statfs *sp; struct mount *mp; struct vnode *vp; - int vfslocked; int error; error = priv_check(td, PRIV_VFS_FHSTATFS); @@ -4628,11 +4446,9 @@ kern_fhstatfs(struct thread *td, fhandle_t fh, struct statfs *buf) return (error); if ((mp = vfs_busyfs(&fh.fh_fsid)) == NULL) return (ESTALE); - vfslocked = VFS_LOCK_GIANT(mp); error = VFS_FHTOVP(mp, &fh.fh_fid, &vp); if (error) { vfs_unbusy(mp); - VFS_UNLOCK_GIANT(vfslocked); return (error); } vput(vp); @@ -4656,6 +4472,5 @@ kern_fhstatfs(struct thread *td, fhandle_t fh, struct statfs *buf) *buf = *sp; out: vfs_unbusy(mp); - VFS_UNLOCK_GIANT(vfslocked); return (error); } diff --git a/sys/kern/vfs_vnops.c b/sys/kern/vfs_vnops.c index d0b713c..fe11735 100644 --- a/sys/kern/vfs_vnops.c +++ b/sys/kern/vfs_vnops.c @@ -112,16 +112,12 @@ vn_open_cred(struct nameidata *ndp, int *flagp, int cmode, u_int vn_open_flags, struct vattr *vap = &vat; int fmode, error; accmode_t accmode; - int vfslocked, mpsafe; - mpsafe = ndp->ni_cnd.cn_flags & MPSAFE; restart: - vfslocked = 0; fmode = *flagp; if (fmode & O_CREAT) { ndp->ni_cnd.cn_nameiop = CREATE; - ndp->ni_cnd.cn_flags = ISOPEN | LOCKPARENT | LOCKLEAF | - MPSAFE; + ndp->ni_cnd.cn_flags = ISOPEN | LOCKPARENT | LOCKLEAF; if ((fmode & O_EXCL) == 0 && (fmode & O_NOFOLLOW) == 0) ndp->ni_cnd.cn_flags |= FOLLOW; if (!(vn_open_flags & VN_OPEN_NOAUDIT)) @@ -129,9 +125,6 @@ restart: bwillwrite(); if ((error = namei(ndp)) != 0) return (error); - vfslocked = NDHASGIANT(ndp); - if (!mpsafe) - ndp->ni_cnd.cn_flags &= ~MPSAFE; if (ndp->ni_vp == NULL) { VATTR_NULL(vap); vap->va_type = VREG; @@ -141,7 +134,6 @@ restart: if (vn_start_write(ndp->ni_dvp, &mp, V_NOWAIT) != 0) { NDFREE(ndp, NDF_ONLY_PNBUF); vput(ndp->ni_dvp); - VFS_UNLOCK_GIANT(vfslocked); if ((error = vn_start_write(NULL, &mp, V_XSLEEP | PCATCH)) != 0) return (error); @@ -157,7 +149,6 @@ restart: vput(ndp->ni_dvp); vn_finished_write(mp); if (error) { - VFS_UNLOCK_GIANT(vfslocked); NDFREE(ndp, NDF_ONLY_PNBUF); return (error); } @@ -179,17 +170,13 @@ restart: } else { ndp->ni_cnd.cn_nameiop = LOOKUP; ndp->ni_cnd.cn_flags = ISOPEN | - ((fmode & O_NOFOLLOW) ? NOFOLLOW : FOLLOW) | - LOCKLEAF | MPSAFE; + ((fmode & O_NOFOLLOW) ? NOFOLLOW : FOLLOW) | LOCKLEAF; if (!(fmode & FWRITE)) ndp->ni_cnd.cn_flags |= LOCKSHARED; if (!(vn_open_flags & VN_OPEN_NOAUDIT)) ndp->ni_cnd.cn_flags |= AUDITVNODE1; if ((error = namei(ndp)) != 0) return (error); - if (!mpsafe) - ndp->ni_cnd.cn_flags &= ~MPSAFE; - vfslocked = NDHASGIANT(ndp); vp = ndp->ni_vp; } if (vp->v_type == VLNK) { @@ -238,13 +225,10 @@ restart: vp->v_writecount++; *flagp = fmode; ASSERT_VOP_LOCKED(vp, "vn_open_cred"); - if (!mpsafe) - VFS_UNLOCK_GIANT(vfslocked); return (0); bad: NDFREE(ndp, NDF_ONLY_PNBUF); vput(vp); - VFS_UNLOCK_GIANT(vfslocked); *flagp = fmode; ndp->ni_vp = NULL; return (error); @@ -290,8 +274,6 @@ vn_close(vp, flags, file_cred, td) else lock_flags = LK_EXCLUSIVE; - VFS_ASSERT_GIANT(vp->v_mount); - vn_start_write(vp, &mp, V_WAIT); vn_lock(vp, lock_flags | LK_RETRY); if (flags & FWRITE) { @@ -371,8 +353,6 @@ vn_rdwr(rw, vp, base, len, offset, segflg, ioflg, active_cred, file_cred, struct ucred *cred; int error, lock_flags; - VFS_ASSERT_GIANT(vp->v_mount); - if ((ioflg & IO_NODELOCKED) == 0) { mp = NULL; if (rw == UIO_WRITE) { @@ -461,8 +441,6 @@ vn_rdwr_inchunks(rw, vp, base, len, offset, segflg, ioflg, active_cred, int error = 0; int iaresid; - VFS_ASSERT_GIANT(vp->v_mount); - do { int chunk; @@ -507,7 +485,6 @@ vn_read(fp, uio, active_cred, flags, td) struct vnode *vp; int error, ioflag; struct mtx *mtxp; - int vfslocked; KASSERT(uio->uio_td == td, ("uio_td %p is not td %p", uio->uio_td, td)); @@ -518,7 +495,6 @@ vn_read(fp, uio, active_cred, flags, td) ioflag |= IO_NDELAY; if (fp->f_flag & O_DIRECT) ioflag |= IO_DIRECT; - vfslocked = VFS_LOCK_GIANT(vp->v_mount); /* * According to McKusick the vn lock was protecting f_offset here. * It is now protected by the FOFFSET_LOCKED flag. @@ -555,7 +531,6 @@ vn_read(fp, uio, active_cred, flags, td) } fp->f_nextoff = uio->uio_offset; VOP_UNLOCK(vp, 0); - VFS_UNLOCK_GIANT(vfslocked); return (error); } @@ -573,12 +548,10 @@ vn_write(fp, uio, active_cred, flags, td) struct vnode *vp; struct mount *mp; int error, ioflag, lock_flags; - int vfslocked; KASSERT(uio->uio_td == td, ("uio_td %p is not td %p", uio->uio_td, td)); vp = fp->f_vnode; - vfslocked = VFS_LOCK_GIANT(vp->v_mount); if (vp->v_type == VREG) bwillwrite(); ioflag = IO_UNIT; @@ -620,7 +593,6 @@ vn_write(fp, uio, active_cred, flags, td) if (vp->v_type != VCHR) vn_finished_write(mp); unlock: - VFS_UNLOCK_GIANT(vfslocked); return (error); } @@ -637,16 +609,12 @@ vn_truncate(fp, length, active_cred, td) struct vattr vattr; struct mount *mp; struct vnode *vp; - int vfslocked; int error; vp = fp->f_vnode; - vfslocked = VFS_LOCK_GIANT(vp->v_mount); error = vn_start_write(vp, &mp, V_WAIT | PCATCH); - if (error) { - VFS_UNLOCK_GIANT(vfslocked); + if (error) return (error); - } vn_lock(vp, LK_EXCLUSIVE | LK_RETRY); if (vp->v_type == VDIR) { error = EISDIR; @@ -666,7 +634,6 @@ vn_truncate(fp, length, active_cred, td) out: VOP_UNLOCK(vp, 0); vn_finished_write(mp); - VFS_UNLOCK_GIANT(vfslocked); return (error); } @@ -681,14 +648,11 @@ vn_statfile(fp, sb, active_cred, td) struct thread *td; { struct vnode *vp = fp->f_vnode; - int vfslocked; int error; - vfslocked = VFS_LOCK_GIANT(vp->v_mount); vn_lock(vp, LK_SHARED | LK_RETRY); error = vn_stat(vp, sb, active_cred, fp->f_cred, td); VOP_UNLOCK(vp, 0); - VFS_UNLOCK_GIANT(vfslocked); return (error); } @@ -817,10 +781,8 @@ vn_ioctl(fp, com, data, active_cred, td) { struct vnode *vp = fp->f_vnode; struct vattr vattr; - int vfslocked; int error; - vfslocked = VFS_LOCK_GIANT(vp->v_mount); error = ENOTTY; switch (vp->v_type) { case VREG: @@ -842,7 +804,6 @@ vn_ioctl(fp, com, data, active_cred, td) default: break; } - VFS_UNLOCK_GIANT(vfslocked); return (error); } @@ -857,11 +818,9 @@ vn_poll(fp, events, active_cred, td) struct thread *td; { struct vnode *vp; - int vfslocked; int error; vp = fp->f_vnode; - vfslocked = VFS_LOCK_GIANT(vp->v_mount); #ifdef MAC vn_lock(vp, LK_EXCLUSIVE | LK_RETRY); error = mac_vnode_check_poll(active_cred, fp->f_cred, vp); @@ -870,7 +829,6 @@ vn_poll(fp, events, active_cred, td) #endif error = VOP_POLL(vp, events, fp->f_cred, td); - VFS_UNLOCK_GIANT(vfslocked); return (error); } @@ -919,12 +877,10 @@ vn_closefile(fp, td) { struct vnode *vp; struct flock lf; - int vfslocked; int error; vp = fp->f_vnode; - vfslocked = VFS_LOCK_GIANT(vp->v_mount); if (fp->f_type == DTYPE_VNODE && fp->f_flag & FHASLOCK) { lf.l_whence = SEEK_SET; lf.l_start = 0; @@ -936,7 +892,6 @@ vn_closefile(fp, td) fp->f_ops = &badfileops; error = vn_close(vp, fp->f_flag, fp->f_cred, td); - VFS_UNLOCK_GIANT(vfslocked); return (error); } @@ -1176,14 +1131,10 @@ vfs_write_resume(mp) static int vn_kqfilter(struct file *fp, struct knote *kn) { - int vfslocked; int error; - vfslocked = VFS_LOCK_GIANT(fp->f_vnode->v_mount); error = VOP_KQFILTER(fp->f_vnode, kn); - VFS_UNLOCK_GIANT(vfslocked); - - return error; + return (error); } /* diff --git a/sys/nfsserver/nfs.h b/sys/nfsserver/nfs.h index bb1893e..1c2435d 100644 --- a/sys/nfsserver/nfs.h +++ b/sys/nfsserver/nfs.h @@ -262,7 +262,7 @@ int nfsrv_commit(struct nfsrv_descript *nfsd, struct nfssvc_sock *slp, struct mbuf **mrq); int nfsrv_create(struct nfsrv_descript *nfsd, struct nfssvc_sock *slp, struct mbuf **mrq); -int nfsrv_fhtovp(fhandle_t *, int, struct vnode **, int *, +int nfsrv_fhtovp(fhandle_t *, int, struct vnode **, struct nfsrv_descript *, struct nfssvc_sock *, struct sockaddr *, int *, int); int nfsrv_setpublicfs(struct mount *, struct netexport *, diff --git a/sys/nfsserver/nfs_serv.c b/sys/nfsserver/nfs_serv.c index d1be5e5..d0cd6c7 100644 --- a/sys/nfsserver/nfs_serv.c +++ b/sys/nfsserver/nfs_serv.c @@ -158,32 +158,6 @@ ndclear(struct nameidata *nd) } /* - * Takes two vfslocked integers and returns with at most one - * reference to giant. The return value indicates whether giant - * is held by either lock. This simplifies nfsrv ops by allowing - * them to track only one vfslocked var. - */ -static __inline int -nfsrv_lockedpair(int vfs1, int vfs2) -{ - - if (vfs1 && vfs2) - VFS_UNLOCK_GIANT(vfs2); - - return (vfs1 | vfs2); -} - -static __inline int -nfsrv_lockedpair_nd(int vfs1, struct nameidata *nd) -{ - int vfs2; - - vfs2 = NDHASGIANT(nd); - - return nfsrv_lockedpair(vfs1, vfs2); -} - -/* * nfs v3 access service */ int @@ -204,17 +178,14 @@ nfsrv3_access(struct nfsrv_descript *nfsd, struct nfssvc_sock *slp, struct vattr vattr, *vap = &vattr; u_long testmode, nfsmode; int v3 = (nfsd->nd_flag & ND_NFSV3); - int vfslocked; nfsdbprintf(("%s %d\n", __FILE__, __LINE__)); if (!v3) panic("nfsrv3_access: v3 proc called on a v2 connection"); - vfslocked = 0; fhp = &nfh.fh_generic; nfsm_srvmtofh(fhp); tl = nfsm_dissect_nonblock(u_int32_t *, NFSX_UNSIGNED); - error = nfsrv_fhtovp(fhp, 1, &vp, &vfslocked, nfsd, slp, - nam, &rdonly, TRUE); + error = nfsrv_fhtovp(fhp, 1, &vp, nfsd, slp, nam, &rdonly, TRUE); if (error) { nfsm_reply(NFSX_UNSIGNED); nfsm_srvpostop_attr(1, NULL); @@ -250,7 +221,6 @@ nfsrv3_access(struct nfsrv_descript *nfsd, struct nfssvc_sock *slp, nfsmout: if (vp) vput(vp); - VFS_UNLOCK_GIANT(vfslocked); return(error); } @@ -274,14 +244,11 @@ nfsrv_getattr(struct nfsrv_descript *nfsd, struct nfssvc_sock *slp, caddr_t bpos; int error = 0, rdonly; struct mbuf *mb, *mreq; - int vfslocked; nfsdbprintf(("%s %d\n", __FILE__, __LINE__)); - vfslocked = 0; fhp = &nfh.fh_generic; nfsm_srvmtofh(fhp); - error = nfsrv_fhtovp(fhp, 1, &vp, &vfslocked, nfsd, slp, nam, - &rdonly, TRUE); + error = nfsrv_fhtovp(fhp, 1, &vp, nfsd, slp, nam, &rdonly, TRUE); if (error) { nfsm_reply(0); error = 0; @@ -303,7 +270,6 @@ nfsrv_getattr(struct nfsrv_descript *nfsd, struct nfssvc_sock *slp, nfsmout: if (vp) vput(vp); - VFS_UNLOCK_GIANT(vfslocked); return(error); } @@ -332,18 +298,14 @@ nfsrv_setattr(struct nfsrv_descript *nfsd, struct nfssvc_sock *slp, struct mbuf *mb, *mreq; struct timespec guard = { 0, 0 }; struct mount *mp = NULL; - int tvfslocked; - int vfslocked; nfsdbprintf(("%s %d\n", __FILE__, __LINE__)); - vfslocked = 0; fhp = &nfh.fh_generic; nfsm_srvmtofh(fhp); if ((mp = vfs_getvfs(&fhp->fh_fsid)) == NULL) { error = ESTALE; goto out; } - vfslocked = VFS_LOCK_GIANT(mp); (void) vn_start_write(NULL, &mp, V_WAIT); vfs_rel(mp); /* The write holds a ref. */ VATTR_NULL(vap); @@ -389,9 +351,7 @@ nfsrv_setattr(struct nfsrv_descript *nfsd, struct nfssvc_sock *slp, /* * Now that we have all the fields, lets do it. */ - error = nfsrv_fhtovp(fhp, 1, &vp, &tvfslocked, nfsd, slp, - nam, &rdonly, TRUE); - vfslocked = nfsrv_lockedpair(vfslocked, tvfslocked); + error = nfsrv_fhtovp(fhp, 1, &vp, nfsd, slp, nam, &rdonly, TRUE); if (error) { nfsm_reply(2 * NFSX_UNSIGNED); if (v3) @@ -461,7 +421,6 @@ nfsmout: if (vp) vput(vp); vn_finished_write(mp); - VFS_UNLOCK_GIANT(vfslocked); return(error); } @@ -486,12 +445,9 @@ nfsrv_lookup(struct nfsrv_descript *nfsd, struct nfssvc_sock *slp, int v3 = (nfsd->nd_flag & ND_NFSV3), pubflag; struct mbuf *mb, *mreq; struct vattr va, dirattr, *vap = &va; - int tvfslocked; - int vfslocked; nfsdbprintf(("%s %d\n", __FILE__, __LINE__)); ndclear(&nd); - vfslocked = 0; fhp = &nfh.fh_generic; nfsm_srvmtofh(fhp); @@ -501,10 +457,9 @@ nfsrv_lookup(struct nfsrv_descript *nfsd, struct nfssvc_sock *slp, nd.ni_cnd.cn_cred = cred; nd.ni_cnd.cn_nameiop = LOOKUP; - nd.ni_cnd.cn_flags = LOCKLEAF | SAVESTART | MPSAFE; + nd.ni_cnd.cn_flags = LOCKLEAF | SAVESTART; error = nfs_namei(&nd, nfsd, fhp, len, slp, nam, &md, &dpos, &dirp, v3, &dirattr, &dirattr_ret, pubflag); - vfslocked = NDHASGIANT(&nd); /* * namei failure, only dirp to cleanup. Clear out garbarge from @@ -551,14 +506,8 @@ nfsrv_lookup(struct nfsrv_descript *nfsd, struct nfssvc_sock *slp, nfs_pub.np_index; ind.ni_startdir = nd.ni_vp; VREF(ind.ni_startdir); - ind.ni_cnd.cn_flags &= ~GIANTHELD; - tvfslocked = VFS_LOCK_GIANT(ind.ni_startdir->v_mount); - if (tvfslocked) - nd.ni_cnd.cn_flags |= GIANTHELD; error = lookup(&ind); ind.ni_dvp = NULL; - vfslocked = nfsrv_lockedpair_nd(vfslocked, &ind); - ind.ni_cnd.cn_flags &= ~GIANTHELD; if (error == 0) { /* @@ -645,7 +594,6 @@ nfsmout: vrele(ndp->ni_startdir); } NDFREE(&nd, NDF_ONLY_PNBUF); - VFS_UNLOCK_GIANT(vfslocked); return (error); } @@ -673,10 +621,8 @@ nfsrv_readlink(struct nfsrv_descript *nfsd, struct nfssvc_sock *slp, nfsfh_t nfh; fhandle_t *fhp; struct uio io, *uiop = &io; - int vfslocked; nfsdbprintf(("%s %d\n", __FILE__, __LINE__)); - vfslocked = 0; #ifndef nolint mp = NULL; #endif @@ -712,8 +658,7 @@ nfsrv_readlink(struct nfsrv_descript *nfsd, struct nfssvc_sock *slp, uiop->uio_rw = UIO_READ; uiop->uio_segflg = UIO_SYSSPACE; uiop->uio_td = NULL; - error = nfsrv_fhtovp(fhp, 1, &vp, &vfslocked, nfsd, slp, - nam, &rdonly, TRUE); + error = nfsrv_fhtovp(fhp, 1, &vp, nfsd, slp, nam, &rdonly, TRUE); if (error) { nfsm_reply(2 * NFSX_UNSIGNED); if (v3) @@ -752,7 +697,6 @@ nfsmout: m_freem(mp3); if (vp) vput(vp); - VFS_UNLOCK_GIANT(vfslocked); return(error); } @@ -786,11 +730,8 @@ nfsrv_read(struct nfsrv_descript *nfsd, struct nfssvc_sock *slp, struct nfsheur *nh; off_t off; int ioflag = 0; - int vfslocked; - nfsdbprintf(("%s %d\n", __FILE__, __LINE__)); - vfslocked = 0; fhp = &nfh.fh_generic; nfsm_srvmtofh(fhp); if (v3) { @@ -808,8 +749,7 @@ nfsrv_read(struct nfsrv_descript *nfsd, struct nfssvc_sock *slp, * as well. */ - error = nfsrv_fhtovp(fhp, 1, &vp, &vfslocked, nfsd, slp, - nam, &rdonly, TRUE); + error = nfsrv_fhtovp(fhp, 1, &vp, nfsd, slp, nam, &rdonly, TRUE); if (error) { vp = NULL; nfsm_reply(2 * NFSX_UNSIGNED); @@ -1002,7 +942,6 @@ nfsrv_read(struct nfsrv_descript *nfsd, struct nfssvc_sock *slp, nfsmout: if (vp) vput(vp); - VFS_UNLOCK_GIANT(vfslocked); return(error); } @@ -1037,11 +976,8 @@ nfsrv_write(struct nfsrv_descript *nfsd, struct nfssvc_sock *slp, struct uio io, *uiop = &io; off_t off; struct mount *mntp = NULL; - int tvfslocked; - int vfslocked; nfsdbprintf(("%s %d\n", __FILE__, __LINE__)); - vfslocked = 0; if (mrep == NULL) { *mrq = NULL; error = 0; @@ -1053,7 +989,6 @@ nfsrv_write(struct nfsrv_descript *nfsd, struct nfssvc_sock *slp, error = ESTALE; goto ereply; } - vfslocked = VFS_LOCK_GIANT(mntp); (void) vn_start_write(NULL, &mntp, V_WAIT); vfs_rel(mntp); /* The write holds a ref. */ if (v3) { @@ -1109,9 +1044,7 @@ nfsrv_write(struct nfsrv_descript *nfsd, struct nfssvc_sock *slp, error = 0; goto nfsmout; } - error = nfsrv_fhtovp(fhp, 1, &vp, &tvfslocked, nfsd, slp, - nam, &rdonly, TRUE); - vfslocked = nfsrv_lockedpair(vfslocked, tvfslocked); + error = nfsrv_fhtovp(fhp, 1, &vp, nfsd, slp, nam, &rdonly, TRUE); if (error) { vp = NULL; nfsm_reply(2 * NFSX_UNSIGNED); @@ -1220,7 +1153,6 @@ nfsmout: if (vp) vput(vp); vn_finished_write(mntp); - VFS_UNLOCK_GIANT(vfslocked); return(error); } @@ -1252,11 +1184,8 @@ nfsrv_create(struct nfsrv_descript *nfsd, struct nfssvc_sock *slp, u_quad_t tempsize; struct timespec cverf; struct mount *mp = NULL; - int tvfslocked; - int vfslocked; nfsdbprintf(("%s %d\n", __FILE__, __LINE__)); - vfslocked = 0; #ifndef nolint rdev = 0; #endif @@ -1268,14 +1197,13 @@ nfsrv_create(struct nfsrv_descript *nfsd, struct nfssvc_sock *slp, error = ESTALE; goto ereply; } - vfslocked = VFS_LOCK_GIANT(mp); (void) vn_start_write(NULL, &mp, V_WAIT); vfs_rel(mp); /* The write holds a ref. */ nfsm_srvnamesiz(len); nd.ni_cnd.cn_cred = cred; nd.ni_cnd.cn_nameiop = CREATE; - nd.ni_cnd.cn_flags = LOCKPARENT | LOCKLEAF | SAVESTART | MPSAFE; + nd.ni_cnd.cn_flags = LOCKPARENT | LOCKLEAF | SAVESTART; /* * Call namei and do initial cleanup to get a few things @@ -1288,7 +1216,6 @@ nfsrv_create(struct nfsrv_descript *nfsd, struct nfssvc_sock *slp, */ error = nfs_namei(&nd, nfsd, fhp, len, slp, nam, &md, &dpos, &dirp, v3, &dirfor, &dirfor_ret, FALSE); - vfslocked = nfsrv_lockedpair_nd(vfslocked, &nd); if (dirp && !v3) { vrele(dirp); dirp = NULL; @@ -1424,13 +1351,8 @@ nfsrv_create(struct nfsrv_descript *nfsd, struct nfssvc_sock *slp, nd.ni_cnd.cn_flags &= ~(LOCKPARENT); nd.ni_cnd.cn_thread = curthread; nd.ni_cnd.cn_cred = cred; - tvfslocked = VFS_LOCK_GIANT(nd.ni_startdir->v_mount); - if (tvfslocked) - nd.ni_cnd.cn_flags |= GIANTHELD; error = lookup(&nd); nd.ni_dvp = NULL; - vfslocked = nfsrv_lockedpair_nd(vfslocked, &nd); - nd.ni_cnd.cn_flags &= ~GIANTHELD; if (error) goto ereply; @@ -1518,7 +1440,6 @@ nfsmout: vrele(dirp); NDFREE(&nd, NDF_ONLY_PNBUF); vn_finished_write(mp); - VFS_UNLOCK_GIANT(vfslocked); return (error); } @@ -1548,11 +1469,8 @@ nfsrv_mknod(struct nfsrv_descript *nfsd, struct nfssvc_sock *slp, fhandle_t *fhp; struct mount *mp = NULL; int v3 = (nfsd->nd_flag & ND_NFSV3); - int tvfslocked; - int vfslocked; nfsdbprintf(("%s %d\n", __FILE__, __LINE__)); - vfslocked = 0; if (!v3) panic("nfsrv_mknod: v3 proc called on a v2 connection"); ndclear(&nd); @@ -1563,14 +1481,13 @@ nfsrv_mknod(struct nfsrv_descript *nfsd, struct nfssvc_sock *slp, error = ESTALE; goto ereply; } - vfslocked = VFS_LOCK_GIANT(mp); (void) vn_start_write(NULL, &mp, V_WAIT); vfs_rel(mp); /* The write holds a ref. */ nfsm_srvnamesiz(len); nd.ni_cnd.cn_cred = cred; nd.ni_cnd.cn_nameiop = CREATE; - nd.ni_cnd.cn_flags = LOCKPARENT | LOCKLEAF | SAVESTART | MPSAFE; + nd.ni_cnd.cn_flags = LOCKPARENT | LOCKLEAF | SAVESTART; /* * Handle nfs_namei() call. If an error occurs, the nd structure @@ -1580,7 +1497,6 @@ nfsrv_mknod(struct nfsrv_descript *nfsd, struct nfssvc_sock *slp, error = nfs_namei(&nd, nfsd, fhp, len, slp, nam, &md, &dpos, &dirp, v3, &dirfor, &dirfor_ret, FALSE); - vfslocked = nfsrv_lockedpair_nd(vfslocked, &nd); if (error) { nfsm_reply(NFSX_WCCDATA(1)); nfsm_srvwcc_data(dirfor_ret, &dirfor, diraft_ret, &diraft); @@ -1640,13 +1556,8 @@ nfsrv_mknod(struct nfsrv_descript *nfsd, struct nfssvc_sock *slp, nd.ni_cnd.cn_flags &= ~(LOCKPARENT); nd.ni_cnd.cn_thread = td; nd.ni_cnd.cn_cred = td->td_ucred; - tvfslocked = VFS_LOCK_GIANT(nd.ni_startdir->v_mount); - if (tvfslocked) - nd.ni_cnd.cn_flags |= GIANTHELD; error = lookup(&nd); nd.ni_dvp = NULL; - vfslocked = nfsrv_lockedpair_nd(vfslocked, &nd); - nd.ni_cnd.cn_flags &= ~GIANTHELD; if (error) goto out; @@ -1698,7 +1609,6 @@ ereply: nfsm_srvwcc_data(dirfor_ret, &dirfor, diraft_ret, &diraft); } vn_finished_write(mp); - VFS_UNLOCK_GIANT(vfslocked); return (0); nfsmout: if (nd.ni_dvp) { @@ -1715,7 +1625,6 @@ nfsmout: vrele(nd.ni_startdir); NDFREE(&nd, NDF_ONLY_PNBUF); vn_finished_write(mp); - VFS_UNLOCK_GIANT(vfslocked); return (error); } @@ -1740,11 +1649,9 @@ nfsrv_remove(struct nfsrv_descript *nfsd, struct nfssvc_sock *slp, nfsfh_t nfh; fhandle_t *fhp; struct mount *mp = NULL; - int vfslocked; nfsdbprintf(("%s %d\n", __FILE__, __LINE__)); ndclear(&nd); - vfslocked = 0; fhp = &nfh.fh_generic; nfsm_srvmtofh(fhp); @@ -1752,17 +1659,15 @@ nfsrv_remove(struct nfsrv_descript *nfsd, struct nfssvc_sock *slp, error = ESTALE; goto ereply; } - vfslocked = VFS_LOCK_GIANT(mp); (void) vn_start_write(NULL, &mp, V_WAIT); vfs_rel(mp); /* The write holds a ref. */ nfsm_srvnamesiz(len); nd.ni_cnd.cn_cred = cred; nd.ni_cnd.cn_nameiop = DELETE; - nd.ni_cnd.cn_flags = LOCKPARENT | LOCKLEAF | MPSAFE; + nd.ni_cnd.cn_flags = LOCKPARENT | LOCKLEAF; error = nfs_namei(&nd, nfsd, fhp, len, slp, nam, &md, &dpos, &dirp, v3, &dirfor, &dirfor_ret, FALSE); - vfslocked = nfsrv_lockedpair_nd(vfslocked, &nd); if (dirp && !v3) { vrele(dirp); dirp = NULL; @@ -1824,7 +1729,6 @@ nfsmout: if (nd.ni_vp) vput(nd.ni_vp); vn_finished_write(mp); - VFS_UNLOCK_GIANT(vfslocked); return(error); } @@ -1852,10 +1756,8 @@ nfsrv_rename(struct nfsrv_descript *nfsd, struct nfssvc_sock *slp, fhandle_t *ffhp, *tfhp; uid_t saved_uid; struct mount *mp = NULL; - int vfslocked; nfsdbprintf(("%s %d\n", __FILE__, __LINE__)); - vfslocked = 0; #ifndef nolint fvp = NULL; #endif @@ -1874,7 +1776,6 @@ nfsrv_rename(struct nfsrv_descript *nfsd, struct nfssvc_sock *slp, error = ESTALE; goto out1; } - vfslocked = VFS_LOCK_GIANT(mp); (void) vn_start_write(NULL, &mp, V_WAIT); vfs_rel(mp); /* The write holds a ref. */ nfsm_srvnamesiz(len); @@ -1885,10 +1786,9 @@ nfsrv_rename(struct nfsrv_descript *nfsd, struct nfssvc_sock *slp, saved_uid = cred->cr_uid; fromnd.ni_cnd.cn_cred = cred; fromnd.ni_cnd.cn_nameiop = DELETE; - fromnd.ni_cnd.cn_flags = WANTPARENT | SAVESTART | MPSAFE; + fromnd.ni_cnd.cn_flags = WANTPARENT | SAVESTART; error = nfs_namei(&fromnd, nfsd, ffhp, len, slp, nam, &md, &dpos, &fdirp, v3, &fdirfor, &fdirfor_ret, FALSE); - vfslocked = nfsrv_lockedpair_nd(vfslocked, &fromnd); if (fdirp && !v3) { vrele(fdirp); fdirp = NULL; @@ -1908,10 +1808,9 @@ nfsrv_rename(struct nfsrv_descript *nfsd, struct nfssvc_sock *slp, cred->cr_uid = saved_uid; tond.ni_cnd.cn_cred = cred; tond.ni_cnd.cn_nameiop = RENAME; - tond.ni_cnd.cn_flags = LOCKPARENT | LOCKLEAF | NOCACHE | SAVESTART | MPSAFE; + tond.ni_cnd.cn_flags = LOCKPARENT | LOCKLEAF | NOCACHE | SAVESTART; error = nfs_namei(&tond, nfsd, tfhp, len2, slp, nam, &md, &dpos, &tdirp, v3, &tdirfor, &tdirfor_ret, FALSE); - vfslocked = nfsrv_lockedpair_nd(vfslocked, &tond); if (tdirp && !v3) { vrele(tdirp); tdirp = NULL; @@ -2057,7 +1956,6 @@ nfsmout: vrele(fromnd.ni_vp); vn_finished_write(mp); - VFS_UNLOCK_GIANT(vfslocked); return (error); } @@ -2082,12 +1980,9 @@ nfsrv_link(struct nfsrv_descript *nfsd, struct nfssvc_sock *slp, nfsfh_t nfh, dnfh; fhandle_t *fhp, *dfhp; struct mount *mp = NULL; - int tvfslocked; - int vfslocked; nfsdbprintf(("%s %d\n", __FILE__, __LINE__)); ndclear(&nd); - vfslocked = 0; fhp = &nfh.fh_generic; dfhp = &dnfh.fh_generic; @@ -2096,15 +1991,12 @@ nfsrv_link(struct nfsrv_descript *nfsd, struct nfssvc_sock *slp, error = ESTALE; goto ereply; } - vfslocked = VFS_LOCK_GIANT(mp); (void) vn_start_write(NULL, &mp, V_WAIT); vfs_rel(mp); /* The write holds a ref. */ nfsm_srvmtofh(dfhp); nfsm_srvnamesiz(len); - error = nfsrv_fhtovp(fhp, TRUE, &vp, &tvfslocked, nfsd, slp, - nam, &rdonly, TRUE); - vfslocked = nfsrv_lockedpair(vfslocked, tvfslocked); + error = nfsrv_fhtovp(fhp, TRUE, &vp, nfsd, slp, nam, &rdonly, TRUE); if (error) { nfsm_reply(NFSX_POSTOPATTR(v3) + NFSX_WCCDATA(v3)); if (v3) { @@ -2124,10 +2016,9 @@ nfsrv_link(struct nfsrv_descript *nfsd, struct nfssvc_sock *slp, VOP_UNLOCK(vp, 0); nd.ni_cnd.cn_cred = cred; nd.ni_cnd.cn_nameiop = CREATE; - nd.ni_cnd.cn_flags = LOCKPARENT | MPSAFE | MPSAFE; + nd.ni_cnd.cn_flags = LOCKPARENT; error = nfs_namei(&nd, nfsd, dfhp, len, slp, nam, &md, &dpos, &dirp, v3, &dirfor, &dirfor_ret, FALSE); - vfslocked = nfsrv_lockedpair_nd(vfslocked, &nd); if (dirp && !v3) { vrele(dirp); dirp = NULL; @@ -2205,7 +2096,6 @@ nfsmout: if (nd.ni_vp) vrele(nd.ni_vp); vn_finished_write(mp); - VFS_UNLOCK_GIANT(vfslocked); return(error); } @@ -2234,12 +2124,9 @@ nfsrv_symlink(struct nfsrv_descript *nfsd, struct nfssvc_sock *slp, nfsfh_t nfh; fhandle_t *fhp; struct mount *mp = NULL; - int tvfslocked; - int vfslocked; nfsdbprintf(("%s %d\n", __FILE__, __LINE__)); ndclear(&nd); - vfslocked = 0; fhp = &nfh.fh_generic; nfsm_srvmtofh(fhp); @@ -2247,16 +2134,14 @@ nfsrv_symlink(struct nfsrv_descript *nfsd, struct nfssvc_sock *slp, error = ESTALE; goto out; } - vfslocked = VFS_LOCK_GIANT(mp); (void) vn_start_write(NULL, &mp, V_WAIT); vfs_rel(mp); /* The write holds a ref. */ nfsm_srvnamesiz(len); nd.ni_cnd.cn_cred = cred; nd.ni_cnd.cn_nameiop = CREATE; - nd.ni_cnd.cn_flags = LOCKPARENT | SAVESTART | MPSAFE; + nd.ni_cnd.cn_flags = LOCKPARENT | SAVESTART; error = nfs_namei(&nd, nfsd, fhp, len, slp, nam, &md, &dpos, &dirp, v3, &dirfor, &dirfor_ret, FALSE); - vfslocked = nfsrv_lockedpair_nd(vfslocked, &nd); if (error == 0) { VATTR_NULL(vap); if (v3) @@ -2322,13 +2207,8 @@ nfsrv_symlink(struct nfsrv_descript *nfsd, struct nfssvc_sock *slp, nd.ni_cnd.cn_flags |= (NOFOLLOW | LOCKLEAF); nd.ni_cnd.cn_thread = curthread; nd.ni_cnd.cn_cred = cred; - tvfslocked = VFS_LOCK_GIANT(nd.ni_startdir->v_mount); - if (tvfslocked) - nd.ni_cnd.cn_flags |= GIANTHELD; error = lookup(&nd); nd.ni_dvp = NULL; - vfslocked = nfsrv_lockedpair_nd(vfslocked, &nd); - nd.ni_cnd.cn_flags &= ~GIANTHELD; if (error == 0) { bzero((caddr_t)fhp, sizeof(nfh)); @@ -2388,7 +2268,6 @@ nfsmout: free(pathcp, M_TEMP); vn_finished_write(mp); - VFS_UNLOCK_GIANT(vfslocked); return (error); } @@ -2417,11 +2296,9 @@ nfsrv_mkdir(struct nfsrv_descript *nfsd, struct nfssvc_sock *slp, nfsfh_t nfh; fhandle_t *fhp; struct mount *mp = NULL; - int vfslocked; nfsdbprintf(("%s %d\n", __FILE__, __LINE__)); ndclear(&nd); - vfslocked = 0; fhp = &nfh.fh_generic; nfsm_srvmtofh(fhp); @@ -2429,17 +2306,15 @@ nfsrv_mkdir(struct nfsrv_descript *nfsd, struct nfssvc_sock *slp, error = ESTALE; goto out; } - vfslocked = VFS_LOCK_GIANT(mp); (void) vn_start_write(NULL, &mp, V_WAIT); vfs_rel(mp); /* The write holds a ref. */ nfsm_srvnamesiz(len); nd.ni_cnd.cn_cred = cred; nd.ni_cnd.cn_nameiop = CREATE; - nd.ni_cnd.cn_flags = LOCKPARENT | MPSAFE; + nd.ni_cnd.cn_flags = LOCKPARENT; error = nfs_namei(&nd, nfsd, fhp, len, slp, nam, &md, &dpos, &dirp, v3, &dirfor, &dirfor_ret, FALSE); - vfslocked = nfsrv_lockedpair_nd(vfslocked, &nd); if (dirp && !v3) { vrele(dirp); dirp = NULL; @@ -2551,7 +2426,6 @@ nfsmout: if (dirp) vrele(dirp); vn_finished_write(mp); - VFS_UNLOCK_GIANT(vfslocked); return (error); } @@ -2576,11 +2450,9 @@ nfsrv_rmdir(struct nfsrv_descript *nfsd, struct nfssvc_sock *slp, fhandle_t *fhp; struct nameidata nd; struct mount *mp = NULL; - int vfslocked; nfsdbprintf(("%s %d\n", __FILE__, __LINE__)); ndclear(&nd); - vfslocked = 0; fhp = &nfh.fh_generic; nfsm_srvmtofh(fhp); @@ -2588,16 +2460,14 @@ nfsrv_rmdir(struct nfsrv_descript *nfsd, struct nfssvc_sock *slp, error = ESTALE; goto out; } - vfslocked = VFS_LOCK_GIANT(mp); (void) vn_start_write(NULL, &mp, V_WAIT); vfs_rel(mp); /* The write holds a ref. */ nfsm_srvnamesiz(len); nd.ni_cnd.cn_cred = cred; nd.ni_cnd.cn_nameiop = DELETE; - nd.ni_cnd.cn_flags = LOCKPARENT | LOCKLEAF | MPSAFE; + nd.ni_cnd.cn_flags = LOCKPARENT | LOCKLEAF; error = nfs_namei(&nd, nfsd, fhp, len, slp, nam, &md, &dpos, &dirp, v3, &dirfor, &dirfor_ret, FALSE); - vfslocked = nfsrv_lockedpair_nd(vfslocked, &nd); if (dirp && !v3) { vrele(dirp); dirp = NULL; @@ -2675,7 +2545,6 @@ nfsmout: vrele(dirp); vn_finished_write(mp); - VFS_UNLOCK_GIANT(vfslocked); return(error); } @@ -2744,10 +2613,8 @@ nfsrv_readdir(struct nfsrv_descript *nfsd, struct nfssvc_sock *slp, int v3 = (nfsd->nd_flag & ND_NFSV3); u_quad_t off, toff, verf; u_long *cookies = NULL, *cookiep; /* needs to be int64_t or off_t */ - int vfslocked; nfsdbprintf(("%s %d\n", __FILE__, __LINE__)); - vfslocked = 0; fhp = &nfh.fh_generic; nfsm_srvmtofh(fhp); if (v3) { @@ -2770,8 +2637,7 @@ nfsrv_readdir(struct nfsrv_descript *nfsd, struct nfssvc_sock *slp, if (siz > xfer) siz = xfer; fullsiz = siz; - error = nfsrv_fhtovp(fhp, 1, &vp, &vfslocked, nfsd, slp, - nam, &rdonly, TRUE); + error = nfsrv_fhtovp(fhp, 1, &vp, nfsd, slp, nam, &rdonly, TRUE); if (!error && vp->v_type != VDIR) { error = ENOTDIR; vput(vp); @@ -3008,7 +2874,6 @@ again: nfsmout: if (vp) vrele(vp); - VFS_UNLOCK_GIANT(vfslocked); return(error); } @@ -3041,10 +2906,8 @@ nfsrv_readdirplus(struct nfsrv_descript *nfsd, struct nfssvc_sock *slp, u_quad_t off, toff, verf; u_long *cookies = NULL, *cookiep; /* needs to be int64_t or off_t */ int v3 = (nfsd->nd_flag & ND_NFSV3); - int vfslocked; nfsdbprintf(("%s %d\n", __FILE__, __LINE__)); - vfslocked = 0; if (!v3) panic("nfsrv_readdirplus: v3 proc called on a v2 connection"); fhp = &nfh.fh_generic; @@ -3064,8 +2927,7 @@ nfsrv_readdirplus(struct nfsrv_descript *nfsd, struct nfssvc_sock *slp, if (siz > xfer) siz = xfer; fullsiz = siz; - error = nfsrv_fhtovp(fhp, 1, &vp, &vfslocked, nfsd, slp, - nam, &rdonly, TRUE); + error = nfsrv_fhtovp(fhp, 1, &vp, nfsd, slp, nam, &rdonly, TRUE); if (!error && vp->v_type != VDIR) { error = ENOTDIR; vput(vp); @@ -3357,7 +3219,6 @@ invalid: nfsmout: if (vp) vrele(vp); - VFS_UNLOCK_GIANT(vfslocked); return(error); } @@ -3383,11 +3244,8 @@ nfsrv_commit(struct nfsrv_descript *nfsd, struct nfssvc_sock *slp, u_quad_t off; struct mount *mp = NULL; int v3 = (nfsd->nd_flag & ND_NFSV3); - int tvfslocked; - int vfslocked; nfsdbprintf(("%s %d\n", __FILE__, __LINE__)); - vfslocked = 0; if (!v3) panic("nfsrv_commit: v3 proc called on a v2 connection"); fhp = &nfh.fh_generic; @@ -3396,7 +3254,6 @@ nfsrv_commit(struct nfsrv_descript *nfsd, struct nfssvc_sock *slp, error = ESTALE; goto ereply; } - vfslocked = VFS_LOCK_GIANT(mp); (void) vn_start_write(NULL, &mp, V_WAIT); vfs_rel(mp); /* The write holds a ref. */ tl = nfsm_dissect_nonblock(u_int32_t *, 3 * NFSX_UNSIGNED); @@ -3408,9 +3265,7 @@ nfsrv_commit(struct nfsrv_descript *nfsd, struct nfssvc_sock *slp, off = fxdr_hyper(tl); tl += 2; cnt = fxdr_unsigned(int, *tl); - error = nfsrv_fhtovp(fhp, 1, &vp, &tvfslocked, nfsd, slp, - nam, &rdonly, TRUE); - vfslocked = nfsrv_lockedpair(vfslocked, tvfslocked); + error = nfsrv_fhtovp(fhp, 1, &vp, nfsd, slp, nam, &rdonly, TRUE); if (error) { nfsm_reply(2 * NFSX_UNSIGNED); nfsm_srvwcc_data(for_ret, &bfor, aft_ret, &aft); @@ -3520,7 +3375,6 @@ nfsmout: if (vp) vput(vp); vn_finished_write(mp); - VFS_UNLOCK_GIANT(vfslocked); return(error); } @@ -3547,14 +3401,11 @@ nfsrv_statfs(struct nfsrv_descript *nfsd, struct nfssvc_sock *slp, fhandle_t *fhp; struct statfs statfs; u_quad_t tval; - int vfslocked; nfsdbprintf(("%s %d\n", __FILE__, __LINE__)); - vfslocked = 0; fhp = &nfh.fh_generic; nfsm_srvmtofh(fhp); - error = nfsrv_fhtovp(fhp, 1, &vp, &vfslocked, nfsd, slp, - nam, &rdonly, TRUE); + error = nfsrv_fhtovp(fhp, 1, &vp, nfsd, slp, nam, &rdonly, TRUE); if (error) { nfsm_reply(NFSX_UNSIGNED); if (v3) @@ -3614,7 +3465,6 @@ nfsrv_statfs(struct nfsrv_descript *nfsd, struct nfssvc_sock *slp, nfsmout: if (vp) vput(vp); - VFS_UNLOCK_GIANT(vfslocked); return(error); } @@ -3640,16 +3490,13 @@ nfsrv_fsinfo(struct nfsrv_descript *nfsd, struct nfssvc_sock *slp, u_quad_t maxfsize; struct statfs sb; int v3 = (nfsd->nd_flag & ND_NFSV3); - int vfslocked; nfsdbprintf(("%s %d\n", __FILE__, __LINE__)); if (!v3) panic("nfsrv_fsinfo: v3 proc called on a v2 connection"); fhp = &nfh.fh_generic; - vfslocked = 0; nfsm_srvmtofh(fhp); - error = nfsrv_fhtovp(fhp, 1, &vp, &vfslocked, nfsd, slp, - nam, &rdonly, TRUE); + error = nfsrv_fhtovp(fhp, 1, &vp, nfsd, slp, nam, &rdonly, TRUE); if (error) { nfsm_reply(NFSX_UNSIGNED); nfsm_srvpostop_attr(getret, &at); @@ -3690,7 +3537,6 @@ nfsrv_fsinfo(struct nfsrv_descript *nfsd, struct nfssvc_sock *slp, nfsmout: if (vp) vput(vp); - VFS_UNLOCK_GIANT(vfslocked); return(error); } @@ -3715,16 +3561,13 @@ nfsrv_pathconf(struct nfsrv_descript *nfsd, struct nfssvc_sock *slp, nfsfh_t nfh; fhandle_t *fhp; int v3 = (nfsd->nd_flag & ND_NFSV3); - int vfslocked; nfsdbprintf(("%s %d\n", __FILE__, __LINE__)); if (!v3) panic("nfsrv_pathconf: v3 proc called on a v2 connection"); - vfslocked = 0; fhp = &nfh.fh_generic; nfsm_srvmtofh(fhp); - error = nfsrv_fhtovp(fhp, 1, &vp, &vfslocked, nfsd, slp, - nam, &rdonly, TRUE); + error = nfsrv_fhtovp(fhp, 1, &vp, nfsd, slp, nam, &rdonly, TRUE); if (error) { nfsm_reply(NFSX_UNSIGNED); nfsm_srvpostop_attr(getret, &at); @@ -3764,7 +3607,6 @@ nfsrv_pathconf(struct nfsrv_descript *nfsd, struct nfssvc_sock *slp, nfsmout: if (vp) vput(vp); - VFS_UNLOCK_GIANT(vfslocked); return(error); } @@ -3833,8 +3675,6 @@ nfsrv_access(struct vnode *vp, accmode_t accmode, struct ucred *cred, struct vattr vattr; int error; - VFS_ASSERT_GIANT(vp->v_mount); - nfsdbprintf(("%s %d\n", __FILE__, __LINE__)); if (accmode & VWRITE) { diff --git a/sys/nfsserver/nfs_srvsubs.c b/sys/nfsserver/nfs_srvsubs.c index ee0614b..865444d 100644 --- a/sys/nfsserver/nfs_srvsubs.c +++ b/sys/nfsserver/nfs_srvsubs.c @@ -593,11 +593,7 @@ nfs_namei(struct nameidata *ndp, struct nfsrv_descript *nfsd, int error, rdonly, linklen; struct componentname *cnp = &ndp->ni_cnd; int lockleaf = (cnp->cn_flags & LOCKLEAF) != 0; - int dvfslocked; - int vfslocked; - vfslocked = 0; - dvfslocked = 0; *retdirp = NULL; cnp->cn_flags |= NOMACCHECK; cnp->cn_pnbuf = uma_zalloc(namei_zone, M_WAITOK); @@ -641,11 +637,7 @@ nfs_namei(struct nameidata *ndp, struct nfsrv_descript *nfsd, /* * Extract and set starting directory. */ - error = nfsrv_fhtovp(fhp, FALSE, &dp, &dvfslocked, - nfsd, slp, nam, &rdonly, pubflag); - if (error) - goto out; - vfslocked = VFS_LOCK_GIANT(dp->v_mount); + error = nfsrv_fhtovp(fhp, FALSE, &dp, nfsd, slp, nam, &rdonly, pubflag); if (dp->v_type != VDIR) { vrele(dp); error = ENOTDIR; @@ -663,7 +655,7 @@ nfs_namei(struct nameidata *ndp, struct nfsrv_descript *nfsd, if (v3) { vn_lock(dp, LK_EXCLUSIVE | LK_RETRY); *retdirattr_retp = VOP_GETATTR(dp, retdirattrp, - ndp->ni_cnd.cn_cred); + ndp->ni_cnd.cn_cred); VOP_UNLOCK(dp, 0); } @@ -723,14 +715,9 @@ nfs_namei(struct nameidata *ndp, struct nfsrv_descript *nfsd, if (pubflag) { ndp->ni_rootdir = rootvnode; ndp->ni_loopcnt = 0; - if (cnp->cn_pnbuf[0] == '/') { - int tvfslocked; - tvfslocked = VFS_LOCK_GIANT(rootvnode->v_mount); - VFS_UNLOCK_GIANT(vfslocked); + if (cnp->cn_pnbuf[0] == '/') dp = rootvnode; - vfslocked = tvfslocked; - } } else { cnp->cn_flags |= NOCROSSMOUNT; } @@ -755,11 +742,7 @@ nfs_namei(struct nameidata *ndp, struct nfsrv_descript *nfsd, * In either case ni_startdir will be dereferenced and NULLed * out. */ - if (vfslocked) - ndp->ni_cnd.cn_flags |= GIANTHELD; error = lookup(ndp); - vfslocked = (ndp->ni_cnd.cn_flags & GIANTHELD) != 0; - ndp->ni_cnd.cn_flags &= ~GIANTHELD; if (error) break; @@ -857,10 +840,6 @@ nfs_namei(struct nameidata *ndp, struct nfsrv_descript *nfsd, } if (!lockleaf) cnp->cn_flags &= ~LOCKLEAF; - if (cnp->cn_flags & GIANTHELD) { - mtx_unlock(&Giant); - cnp->cn_flags &= ~GIANTHELD; - } /* * nfs_namei() guarentees that fields will not contain garbage @@ -874,21 +853,9 @@ out: ndp->ni_dvp = NULL; ndp->ni_startdir = NULL; cnp->cn_flags &= ~HASBUF; - VFS_UNLOCK_GIANT(vfslocked); - vfslocked = 0; } else if ((ndp->ni_cnd.cn_flags & (WANTPARENT|LOCKPARENT)) == 0) { ndp->ni_dvp = NULL; } - /* - * This differs from normal namei() in that even on failure we may - * return with Giant held due to the dirp return. Make sure we only - * have not recursed however. The calling code only expects to drop - * one acquire. - */ - if (vfslocked || dvfslocked) - ndp->ni_cnd.cn_flags |= GIANTHELD; - if (vfslocked && dvfslocked) - VFS_UNLOCK_GIANT(vfslocked); return (error); } @@ -1053,7 +1020,7 @@ nfsm_srvfattr(struct nfsrv_descript *nfsd, struct vattr *vap, * - if not lockflag unlock it with VOP_UNLOCK() */ int -nfsrv_fhtovp(fhandle_t *fhp, int lockflag, struct vnode **vpp, int *vfslockedp, +nfsrv_fhtovp(fhandle_t *fhp, int lockflag, struct vnode **vpp, struct nfsrv_descript *nfsd, struct nfssvc_sock *slp, struct sockaddr *nam, int *rdonlyp, int pubflag) { @@ -1065,13 +1032,11 @@ nfsrv_fhtovp(fhandle_t *fhp, int lockflag, struct vnode **vpp, int *vfslockedp, struct sockaddr_int *saddr; #endif int credflavor; - int vfslocked; int numsecflavors, *secflavors; int authsys; int v3 = nfsd->nd_flag & ND_NFSV3; int mountreq; - *vfslockedp = 0; *vpp = NULL; if (nfs_ispublicfh(fhp)) { @@ -1083,7 +1048,6 @@ nfsrv_fhtovp(fhandle_t *fhp, int lockflag, struct vnode **vpp, int *vfslockedp, mp = vfs_busyfs(&fhp->fh_fsid); if (!mp) return (ESTALE); - vfslocked = VFS_LOCK_GIANT(mp); error = VFS_CHECKEXP(mp, nam, &exflags, &credanon, &numsecflavors, &secflavors); if (error) { @@ -1162,10 +1126,6 @@ out: if (credanon != NULL) crfree(credanon); - if (error) { - VFS_UNLOCK_GIANT(vfslocked); - } else - *vfslockedp = vfslocked; return (error); } diff --git a/sys/nlm/nlm_prot_impl.c b/sys/nlm/nlm_prot_impl.c index f6b296d..0ee56b6 100644 --- a/sys/nlm/nlm_prot_impl.c +++ b/sys/nlm/nlm_prot_impl.c @@ -1769,7 +1769,6 @@ nlm_convert_to_fhandle_t(fhandle_t *fhp, struct netobj *p) struct vfs_state { struct mount *vs_mp; struct vnode *vs_vp; - int vs_vfslocked; int vs_vnlocked; }; @@ -1786,7 +1785,6 @@ nlm_get_vfs_state(struct nlm_host *host, struct svc_req *rqstp, if (!vs->vs_mp) { return (ESTALE); } - vs->vs_vfslocked = VFS_LOCK_GIANT(vs->vs_mp); error = VFS_CHECKEXP(vs->vs_mp, (struct sockaddr *)&host->nh_addr, &exflags, &credanon, NULL, NULL); @@ -1848,7 +1846,6 @@ nlm_release_vfs_state(struct vfs_state *vs) } if (vs->vs_mp) vfs_rel(vs->vs_mp); - VFS_UNLOCK_GIANT(vs->vs_vfslocked); } static nlm4_stats diff --git a/sys/security/audit/audit_arg.c b/sys/security/audit/audit_arg.c index 562b799..0ae6e8c 100644 --- a/sys/security/audit/audit_arg.c +++ b/sys/security/audit/audit_arg.c @@ -651,7 +651,6 @@ audit_arg_file(struct proc *p, struct file *fp) struct socket *so; struct inpcb *pcb; struct vnode *vp; - int vfslocked; ar = currecord(); if (ar == NULL) @@ -664,11 +663,9 @@ audit_arg_file(struct proc *p, struct file *fp) * XXXAUDIT: Only possibly to record as first vnode? */ vp = fp->f_vnode; - vfslocked = VFS_LOCK_GIANT(vp->v_mount); vn_lock(vp, LK_SHARED | LK_RETRY); audit_arg_vnode1(vp); VOP_UNLOCK(vp, 0); - VFS_UNLOCK_GIANT(vfslocked); break; case DTYPE_SOCKET: @@ -768,11 +765,6 @@ audit_arg_vnode(struct vnode *vp, struct vnode_au_info *vnp) struct vattr vattr; int error; - /* - * Assume that if the caller is calling audit_arg_vnode() on a - * non-MPSAFE vnode, then it will have acquired Giant. - */ - VFS_ASSERT_GIANT(vp->v_mount); ASSERT_VOP_LOCKED(vp, "audit_arg_vnode"); error = VOP_GETATTR(vp, &vattr, curthread->td_ucred); @@ -876,7 +868,6 @@ audit_sysclose(struct thread *td, int fd) struct kaudit_record *ar; struct vnode *vp; struct file *fp; - int vfslocked; KASSERT(td != NULL, ("audit_sysclose: td == NULL")); @@ -890,10 +881,8 @@ audit_sysclose(struct thread *td, int fd) return; vp = fp->f_vnode; - vfslocked = VFS_LOCK_GIANT(vp->v_mount); vn_lock(vp, LK_SHARED | LK_RETRY); audit_arg_vnode1(vp); VOP_UNLOCK(vp, 0); - VFS_UNLOCK_GIANT(vfslocked); fdrop(fp, td); } diff --git a/sys/security/audit/audit_syscalls.c b/sys/security/audit/audit_syscalls.c index 075aac5..b326563 100644 --- a/sys/security/audit/audit_syscalls.c +++ b/sys/security/audit/audit_syscalls.c @@ -749,7 +749,7 @@ auditctl(struct thread *td, struct auditctl_args *uap) struct ucred *cred; struct vnode *vp; int error = 0; - int flags, vfslocked; + int flags; if (jailed(td->td_ucred)) return (ENOSYS); @@ -770,20 +770,18 @@ auditctl(struct thread *td, struct auditctl_args *uap) if (uap->path == NULL) return (EINVAL); - NDINIT(&nd, LOOKUP, FOLLOW | LOCKLEAF | MPSAFE | AUDITVNODE1, + NDINIT(&nd, LOOKUP, FOLLOW | LOCKLEAF | AUDITVNODE1, UIO_USERSPACE, uap->path, td); flags = AUDIT_OPEN_FLAGS; error = vn_open(&nd, &flags, 0, NULL); if (error) return (error); - vfslocked = NDHASGIANT(&nd); vp = nd.ni_vp; #ifdef MAC error = mac_system_check_auditctl(td->td_ucred, vp); VOP_UNLOCK(vp, 0); if (error) { vn_close(vp, AUDIT_CLOSE_FLAGS, td->td_ucred, td); - VFS_UNLOCK_GIANT(vfslocked); return (error); } #else @@ -792,10 +790,8 @@ auditctl(struct thread *td, struct auditctl_args *uap) NDFREE(&nd, NDF_ONLY_PNBUF); if (vp->v_type != VREG) { vn_close(vp, AUDIT_CLOSE_FLAGS, td->td_ucred, td); - VFS_UNLOCK_GIANT(vfslocked); return (EINVAL); } - VFS_UNLOCK_GIANT(vfslocked); cred = td->td_ucred; crhold(cred); diff --git a/sys/security/audit/audit_worker.c b/sys/security/audit/audit_worker.c index 631b29f..d21ae18 100644 --- a/sys/security/audit/audit_worker.c +++ b/sys/security/audit/audit_worker.c @@ -113,7 +113,7 @@ audit_record_write(struct vnode *vp, struct ucred *cred, void *data, static struct timeval last_fail; static int cur_lowspace_trigger; struct statfs *mnt_stat; - int error, vfslocked; + int error; static int cur_fail; struct vattr vattr; long temp; @@ -124,7 +124,6 @@ audit_record_write(struct vnode *vp, struct ucred *cred, void *data, return; mnt_stat = &vp->v_mount->mnt_stat; - vfslocked = VFS_LOCK_GIANT(vp->v_mount); /* * First, gather statistics on the audit log file and file system so @@ -258,7 +257,6 @@ audit_record_write(struct vnode *vp, struct ucred *cred, void *data, } } - VFS_UNLOCK_GIANT(vfslocked); return; fail_enospc: @@ -289,7 +287,6 @@ fail: panic("audit_worker: write error %d\n", error); } else if (ppsratecheck(&last_fail, &cur_fail, 1)) printf("audit_worker: write error %d\n", error); - VFS_UNLOCK_GIANT(vfslocked); } /* @@ -451,7 +448,6 @@ audit_rotate_vnode(struct ucred *cred, struct vnode *vp) { struct ucred *old_audit_cred; struct vnode *old_audit_vp; - int vfslocked; KASSERT((cred != NULL && vp != NULL) || (cred == NULL && vp == NULL), ("audit_rotate_vnode: cred %p vp %p", cred, vp)); @@ -473,10 +469,8 @@ audit_rotate_vnode(struct ucred *cred, struct vnode *vp) * If there was an old vnode/credential, close and free. */ if (old_audit_vp != NULL) { - vfslocked = VFS_LOCK_GIANT(old_audit_vp->v_mount); vn_close(old_audit_vp, AUDIT_CLOSE_FLAGS, old_audit_cred, curthread); - VFS_UNLOCK_GIANT(vfslocked); crfree(old_audit_cred); } } diff --git a/sys/security/mac/mac_process.c b/sys/security/mac/mac_process.c index 5b692dd..68875f2 100644 --- a/sys/security/mac/mac_process.c +++ b/sys/security/mac/mac_process.c @@ -254,7 +254,7 @@ mac_proc_vm_revoke_recurse(struct thread *td, struct ucred *cred, struct vm_map *map) { vm_map_entry_t vme; - int vfslocked, result; + int result; vm_prot_t revokeperms; vm_object_t backing_object, object; vm_ooffset_t offset; @@ -300,7 +300,6 @@ mac_proc_vm_revoke_recurse(struct thread *td, struct ucred *cred, if (object->type != OBJT_VNODE) continue; vp = (struct vnode *)object->handle; - vfslocked = VFS_LOCK_GIANT(vp->v_mount); vn_lock(vp, LK_EXCLUSIVE | LK_RETRY); result = vme->max_protection; mac_vnode_check_mmap_downgrade(cred, vp, &result); @@ -310,10 +309,8 @@ mac_proc_vm_revoke_recurse(struct thread *td, struct ucred *cred, * but a policy needs to get removed. */ revokeperms = vme->max_protection & ~result; - if (!revokeperms) { - VFS_UNLOCK_GIANT(vfslocked); + if (!revokeperms) continue; - } printf("pid %ld: revoking %s perms from %#lx:%ld " "(max %s/cur %s)\n", (long)td->td_proc->p_pid, prot2str(revokeperms), (u_long)vme->start, @@ -372,7 +369,6 @@ mac_proc_vm_revoke_recurse(struct thread *td, struct ucred *cred, vme->protection & ~revokeperms); vm_map_simplify_entry(map, vme); } - VFS_UNLOCK_GIANT(vfslocked); } vm_map_unlock(map); } diff --git a/sys/security/mac/mac_syscalls.c b/sys/security/mac/mac_syscalls.c index 905c43b..69d6653 100644 --- a/sys/security/mac/mac_syscalls.c +++ b/sys/security/mac/mac_syscalls.c @@ -226,7 +226,7 @@ __mac_get_fd(struct thread *td, struct __mac_get_fd_args *uap) struct pipe *pipe; struct socket *so; short label_type; - int vfslocked, error; + int error; error = copyin(uap->mac_p, &mac, sizeof(mac)); if (error) @@ -256,11 +256,9 @@ __mac_get_fd(struct thread *td, struct __mac_get_fd_args *uap) return (EINVAL); vp = fp->f_vnode; intlabel = mac_vnode_label_alloc(); - vfslocked = VFS_LOCK_GIANT(vp->v_mount); vn_lock(vp, LK_EXCLUSIVE | LK_RETRY); mac_vnode_copy_label(vp->v_label, intlabel); VOP_UNLOCK(vp, 0); - VFS_UNLOCK_GIANT(vfslocked); error = mac_vnode_externalize_label(intlabel, elements, buffer, mac.m_buflen); mac_vnode_label_free(intlabel); @@ -312,7 +310,7 @@ __mac_get_file(struct thread *td, struct __mac_get_file_args *uap) struct nameidata nd; struct label *intlabel; struct mac mac; - int vfslocked, error; + int error; if (!(mac_labeled & MPC_OBJECT_VNODE)) return (EINVAL); @@ -333,20 +331,18 @@ __mac_get_file(struct thread *td, struct __mac_get_file_args *uap) } buffer = malloc(mac.m_buflen, M_MACTEMP, M_WAITOK | M_ZERO); - NDINIT(&nd, LOOKUP, MPSAFE | LOCKLEAF | FOLLOW, UIO_USERSPACE, + NDINIT(&nd, LOOKUP, LOCKLEAF | FOLLOW, UIO_USERSPACE, uap->path_p, td); error = namei(&nd); if (error) goto out; intlabel = mac_vnode_label_alloc(); - vfslocked = NDHASGIANT(&nd); mac_vnode_copy_label(nd.ni_vp->v_label, intlabel); error = mac_vnode_externalize_label(intlabel, elements, buffer, mac.m_buflen); NDFREE(&nd, 0); - VFS_UNLOCK_GIANT(vfslocked); mac_vnode_label_free(intlabel); if (error == 0) error = copyout(buffer, mac.m_string, strlen(buffer)+1); @@ -365,7 +361,7 @@ __mac_get_link(struct thread *td, struct __mac_get_link_args *uap) struct nameidata nd; struct label *intlabel; struct mac mac; - int vfslocked, error; + int error; if (!(mac_labeled & MPC_OBJECT_VNODE)) return (EINVAL); @@ -386,19 +382,17 @@ __mac_get_link(struct thread *td, struct __mac_get_link_args *uap) } buffer = malloc(mac.m_buflen, M_MACTEMP, M_WAITOK | M_ZERO); - NDINIT(&nd, LOOKUP, MPSAFE | LOCKLEAF | NOFOLLOW, UIO_USERSPACE, + NDINIT(&nd, LOOKUP, LOCKLEAF | NOFOLLOW, UIO_USERSPACE, uap->path_p, td); error = namei(&nd); if (error) goto out; intlabel = mac_vnode_label_alloc(); - vfslocked = NDHASGIANT(&nd); mac_vnode_copy_label(nd.ni_vp->v_label, intlabel); error = mac_vnode_externalize_label(intlabel, elements, buffer, mac.m_buflen); NDFREE(&nd, 0); - VFS_UNLOCK_GIANT(vfslocked); mac_vnode_label_free(intlabel); if (error == 0) @@ -422,7 +416,7 @@ __mac_set_fd(struct thread *td, struct __mac_set_fd_args *uap) struct vnode *vp; struct mac mac; char *buffer; - int error, vfslocked; + int error; error = copyin(uap->mac_p, &mac, sizeof(mac)); if (error) @@ -455,10 +449,8 @@ __mac_set_fd(struct thread *td, struct __mac_set_fd_args *uap) break; } vp = fp->f_vnode; - vfslocked = VFS_LOCK_GIANT(vp->v_mount); error = vn_start_write(vp, &mp, V_WAIT | PCATCH); if (error != 0) { - VFS_UNLOCK_GIANT(vfslocked); mac_vnode_label_free(intlabel); break; } @@ -466,7 +458,6 @@ __mac_set_fd(struct thread *td, struct __mac_set_fd_args *uap) error = vn_setlabel(vp, intlabel, td->td_ucred); VOP_UNLOCK(vp, 0); vn_finished_write(mp); - VFS_UNLOCK_GIANT(vfslocked); mac_vnode_label_free(intlabel); break; @@ -515,7 +506,7 @@ __mac_set_file(struct thread *td, struct __mac_set_file_args *uap) struct mount *mp; struct mac mac; char *buffer; - int vfslocked, error; + int error; if (!(mac_labeled & MPC_OBJECT_VNODE)) return (EINVAL); @@ -541,10 +532,9 @@ __mac_set_file(struct thread *td, struct __mac_set_file_args *uap) if (error) goto out; - NDINIT(&nd, LOOKUP, MPSAFE | LOCKLEAF | FOLLOW, UIO_USERSPACE, + NDINIT(&nd, LOOKUP, LOCKLEAF | FOLLOW, UIO_USERSPACE, uap->path_p, td); error = namei(&nd); - vfslocked = NDHASGIANT(&nd); if (error == 0) { error = vn_start_write(nd.ni_vp, &mp, V_WAIT | PCATCH); if (error == 0) { @@ -555,7 +545,6 @@ __mac_set_file(struct thread *td, struct __mac_set_file_args *uap) } NDFREE(&nd, 0); - VFS_UNLOCK_GIANT(vfslocked); out: mac_vnode_label_free(intlabel); return (error); @@ -569,7 +558,7 @@ __mac_set_link(struct thread *td, struct __mac_set_link_args *uap) struct mount *mp; struct mac mac; char *buffer; - int vfslocked, error; + int error; if (!(mac_labeled & MPC_OBJECT_VNODE)) return (EINVAL); @@ -595,10 +584,9 @@ __mac_set_link(struct thread *td, struct __mac_set_link_args *uap) if (error) goto out; - NDINIT(&nd, LOOKUP, MPSAFE | LOCKLEAF | NOFOLLOW, UIO_USERSPACE, + NDINIT(&nd, LOOKUP, LOCKLEAF | NOFOLLOW, UIO_USERSPACE, uap->path_p, td); error = namei(&nd); - vfslocked = NDHASGIANT(&nd); if (error == 0) { error = vn_start_write(nd.ni_vp, &mp, V_WAIT | PCATCH); if (error == 0) { @@ -609,7 +597,6 @@ __mac_set_link(struct thread *td, struct __mac_set_link_args *uap) } NDFREE(&nd, 0); - VFS_UNLOCK_GIANT(vfslocked); out: mac_vnode_label_free(intlabel); return (error); diff --git a/sys/sys/bufobj.h b/sys/sys/bufobj.h index 916b256..3934553 100644 --- a/sys/sys/bufobj.h +++ b/sys/sys/bufobj.h @@ -111,7 +111,6 @@ struct bufobj { */ #define BO_ONWORKLST (1 << 0) /* On syncer work-list */ #define BO_WWAIT (1 << 1) /* Wait for output to complete */ -#define BO_NEEDSGIANT (1 << 2) /* Require giant for child buffers. */ #define BO_MTX(bo) (&(bo)->bo_mtx) #define BO_LOCK(bo) mtx_lock(BO_MTX((bo))) diff --git a/sys/sys/mount.h b/sys/sys/mount.h index b826413..edba8a2 100644 --- a/sys/sys/mount.h +++ b/sys/sys/mount.h @@ -620,37 +620,6 @@ vfs_statfs_t __vfs_statfs; ({if (*(MP)->mnt_op->vfs_susp_clean != NULL) \ (*(MP)->mnt_op->vfs_susp_clean)(MP); }) -#define VFS_NEEDSGIANT_(MP) \ - ((MP) != NULL && ((MP)->mnt_kern_flag & MNTK_MPSAFE) == 0) - -#define VFS_NEEDSGIANT(MP) __extension__ \ -({ \ - struct mount *_mp; \ - _mp = (MP); \ - VFS_NEEDSGIANT_(_mp); \ -}) - -#define VFS_LOCK_GIANT(MP) __extension__ \ -({ \ - int _locked; \ - struct mount *_mp; \ - _mp = (MP); \ - if (VFS_NEEDSGIANT_(_mp)) { \ - mtx_lock(&Giant); \ - _locked = 1; \ - } else \ - _locked = 0; \ - _locked; \ -}) -#define VFS_UNLOCK_GIANT(locked) if ((locked)) mtx_unlock(&Giant); -#define VFS_ASSERT_GIANT(MP) do \ -{ \ - struct mount *_mp; \ - _mp = (MP); \ - if (VFS_NEEDSGIANT_(_mp)) \ - mtx_assert(&Giant, MA_OWNED); \ -} while (0) - #define VFS_KNOTE_LOCKED(vp, hint) do \ { \ if (((vp)->v_vflag & VV_NOKNOTE) == 0) \ diff --git a/sys/sys/namei.h b/sys/sys/namei.h index 716b38d..35968a2 100644 --- a/sys/sys/namei.h +++ b/sys/sys/namei.h @@ -138,15 +138,11 @@ struct nameidata { #define ISOPEN 0x00200000 /* caller is opening; return a real vnode. */ #define NOCROSSMOUNT 0x00400000 /* do not cross mount points */ #define NOMACCHECK 0x00800000 /* do not perform MAC checks */ -#define MPSAFE 0x01000000 /* namei() must acquire Giant if needed. */ -#define GIANTHELD 0x02000000 /* namei() is holding giant. */ #define AUDITVNODE1 0x04000000 /* audit the looked up vnode information */ #define AUDITVNODE2 0x08000000 /* audit the looked up vnode information */ #define TRAILINGSLASH 0x10000000 /* path ended in a slash */ #define PARAMASK 0x1ffffe00 /* mask of parameter descriptors */ -#define NDHASGIANT(NDP) (((NDP)->ni_cnd.cn_flags & GIANTHELD) != 0) - /* * Initialization of a nameidata structure. */ diff --git a/sys/ufs/ffs/ffs_alloc.c b/sys/ufs/ffs/ffs_alloc.c index 7bf1177..75ad03e 100644 --- a/sys/ufs/ffs/ffs_alloc.c +++ b/sys/ufs/ffs/ffs_alloc.c @@ -2433,7 +2433,7 @@ sysctl_ffs_fsck(SYSCTL_HANDLER_ARGS) long blkcnt, blksize; struct filedesc *fdp; struct file *fp; - int vfslocked, filetype, error; + int filetype, error; if (req->newlen > sizeof cmd) return (EBADRPC); @@ -2638,23 +2638,18 @@ sysctl_ffs_fsck(SYSCTL_HANDLER_ARGS) #endif /* DEBUG */ if ((error = ffs_vget(mp, (ino_t)cmd.value, LK_SHARED, &vp))) break; - vfslocked = VFS_LOCK_GIANT(vp->v_mount); AUDIT_ARG_VNODE1(vp); if ((error = change_dir(vp, td)) != 0) { vput(vp); - VFS_UNLOCK_GIANT(vfslocked); break; } VOP_UNLOCK(vp, 0); - VFS_UNLOCK_GIANT(vfslocked); fdp = td->td_proc->p_fd; FILEDESC_XLOCK(fdp); vpold = fdp->fd_cdir; fdp->fd_cdir = vp; FILEDESC_XUNLOCK(fdp); - vfslocked = VFS_LOCK_GIANT(vpold->v_mount); vrele(vpold); - VFS_UNLOCK_GIANT(vfslocked); break; case FFS_SET_DOTDOT: diff --git a/sys/ufs/ffs/ffs_softdep.c b/sys/ufs/ffs/ffs_softdep.c index 4d652c1..1316f84 100644 --- a/sys/ufs/ffs/ffs_softdep.c +++ b/sys/ufs/ffs/ffs_softdep.c @@ -717,14 +717,12 @@ softdep_flush(void) struct ufsmount *ump; struct thread *td; int remaining; - int vfslocked; td = curthread; td->td_pflags |= TDP_NORUNNINGBUF; for (;;) { kproc_suspend_check(softdepproc); - vfslocked = VFS_LOCK_GIANT((struct mount *)NULL); ACQUIRE_LOCK(&lk); /* * If requested, try removing inode or removal dependencies. @@ -740,7 +738,6 @@ softdep_flush(void) wakeup_one(&proc_waiting); } FREE_LOCK(&lk); - VFS_UNLOCK_GIANT(vfslocked); remaining = 0; mtx_lock(&mountlist_mtx); for (mp = TAILQ_FIRST(&mountlist); mp != NULL; mp = nmp) { @@ -749,12 +746,10 @@ softdep_flush(void) continue; if (vfs_busy(mp, MBF_NOWAIT | MBF_MNTLSTLOCK)) continue; - vfslocked = VFS_LOCK_GIANT(mp); softdep_process_worklist(mp, 0); ump = VFSTOUFS(mp); remaining += ump->softdep_on_worklist - ump->softdep_on_worklist_inprogress; - VFS_UNLOCK_GIANT(vfslocked); mtx_lock(&mountlist_mtx); nmp = TAILQ_NEXT(mp, mnt_list); vfs_unbusy(mp); diff --git a/sys/ufs/ufs/ufs_quota.c b/sys/ufs/ufs/ufs_quota.c index 2db0444..c7b757c 100644 --- a/sys/ufs/ufs/ufs_quota.c +++ b/sys/ufs/ufs/ufs_quota.c @@ -489,7 +489,7 @@ quotaon(struct thread *td, struct mount *mp, int type, void *fname) struct vnode *vp, **vpp; struct vnode *mvp; struct dquot *dq; - int error, flags, vfslocked; + int error, flags; struct nameidata nd; error = priv_check(td, PRIV_UFS_QUOTAON); @@ -499,18 +499,16 @@ quotaon(struct thread *td, struct mount *mp, int type, void *fname) ump = VFSTOUFS(mp); dq = NODQUOT; - NDINIT(&nd, LOOKUP, FOLLOW | MPSAFE, UIO_USERSPACE, fname, td); + NDINIT(&nd, LOOKUP, FOLLOW, UIO_USERSPACE, fname, td); flags = FREAD | FWRITE; error = vn_open(&nd, &flags, 0, NULL); if (error) return (error); - vfslocked = NDHASGIANT(&nd); NDFREE(&nd, NDF_ONLY_PNBUF); vp = nd.ni_vp; VOP_UNLOCK(vp, 0); if (vp->v_type != VREG) { (void) vn_close(vp, FREAD|FWRITE, td->td_ucred, td); - VFS_UNLOCK_GIANT(vfslocked); return (EACCES); } @@ -518,7 +516,6 @@ quotaon(struct thread *td, struct mount *mp, int type, void *fname) if ((ump->um_qflags[type] & (QTF_OPENING|QTF_CLOSING)) != 0) { UFS_UNLOCK(ump); (void) vn_close(vp, FREAD|FWRITE, td->td_ucred, td); - VFS_UNLOCK_GIANT(vfslocked); return (EALREADY); } ump->um_qflags[type] |= QTF_OPENING|QTF_CLOSING; @@ -535,7 +532,6 @@ quotaon(struct thread *td, struct mount *mp, int type, void *fname) vp->v_vflag |= VV_SYSTEM; VOP_UNLOCK(vp, 0); *vpp = vp; - VFS_UNLOCK_GIANT(vfslocked); /* * Save the credential of the process that turned on quotas. * Set up the time limits for this quota. @@ -613,7 +609,6 @@ quotaoff1(struct thread *td, struct mount *mp, int type) struct dquot *dq; struct inode *ip; struct ucred *cr; - int vfslocked; int error; ump = VFSTOUFS(mp); @@ -666,12 +661,10 @@ again: ump->um_cred[type] = NOCRED; UFS_UNLOCK(ump); - vfslocked = VFS_LOCK_GIANT(qvp->v_mount); vn_lock(qvp, LK_EXCLUSIVE | LK_RETRY); qvp->v_vflag &= ~VV_SYSTEM; VOP_UNLOCK(qvp, 0); error = vn_close(qvp, FREAD|FWRITE, td->td_ucred, td); - VFS_UNLOCK_GIANT(vfslocked); crfree(cr); return (error); @@ -1037,7 +1030,7 @@ dqget(struct vnode *vp, u_long id, struct ufsmount *ump, int type, struct vnode *dqvp; struct iovec aiov; struct uio auio; - int vfslocked, dqvplocked, error; + int dqvplocked, error; #ifdef DEBUG_VFS_LOCKS if (vp != NULLVP) @@ -1083,12 +1076,10 @@ hfound: DQI_LOCK(dq); error = EIO; } *dqp = dq; - vfslocked = VFS_LOCK_GIANT(dqvp->v_mount); if (dqvplocked) vput(dqvp); else vrele(dqvp); - VFS_UNLOCK_GIANT(vfslocked); return (error); } @@ -1142,12 +1133,10 @@ hfound: DQI_LOCK(dq); DQH_UNLOCK(); tablefull("dquot"); *dqp = NODQUOT; - vfslocked = VFS_LOCK_GIANT(dqvp->v_mount); if (dqvplocked) vput(dqvp); else vrele(dqvp); - VFS_UNLOCK_GIANT(vfslocked); return (EUSERS); } if (dq->dq_cnt || (dq->dq_flags & DQ_MOD)) @@ -1179,7 +1168,6 @@ hfound: DQI_LOCK(dq); auio.uio_rw = UIO_READ; auio.uio_td = (struct thread *)0; - vfslocked = VFS_LOCK_GIANT(dqvp->v_mount); error = VOP_READ(dqvp, &auio, 0, ump->um_cred[type]); if (auio.uio_resid == sizeof(struct dqblk) && error == 0) bzero(&dq->dq_dqb, sizeof(struct dqblk)); @@ -1187,7 +1175,6 @@ hfound: DQI_LOCK(dq); vput(dqvp); else vrele(dqvp); - VFS_UNLOCK_GIANT(vfslocked); /* * I/O error in reading quota file, release * quota structure and reflect problem to caller. @@ -1296,7 +1283,7 @@ dqsync(struct vnode *vp, struct dquot *dq) struct vnode *dqvp; struct iovec aiov; struct uio auio; - int vfslocked, error; + int error; struct mount *mp; struct ufsmount *ump; @@ -1317,12 +1304,10 @@ dqsync(struct vnode *vp, struct dquot *dq) vref(dqvp); UFS_UNLOCK(ump); - vfslocked = VFS_LOCK_GIANT(dqvp->v_mount); DQI_LOCK(dq); if ((dq->dq_flags & DQ_MOD) == 0) { DQI_UNLOCK(dq); vrele(dqvp); - VFS_UNLOCK_GIANT(vfslocked); return (0); } DQI_UNLOCK(dq); @@ -1331,7 +1316,6 @@ dqsync(struct vnode *vp, struct dquot *dq) if (vp != dqvp) vn_lock(dqvp, LK_EXCLUSIVE | LK_RETRY); - VFS_UNLOCK_GIANT(vfslocked); DQI_LOCK(dq); DQI_WAIT(dq, PINOD+2, "dqsync"); if ((dq->dq_flags & DQ_MOD) == 0) @@ -1348,9 +1332,7 @@ dqsync(struct vnode *vp, struct dquot *dq) auio.uio_segflg = UIO_SYSSPACE; auio.uio_rw = UIO_WRITE; auio.uio_td = (struct thread *)0; - vfslocked = VFS_LOCK_GIANT(dqvp->v_mount); error = VOP_WRITE(dqvp, &auio, 0, dq->dq_ump->um_cred[dq->dq_type]); - VFS_UNLOCK_GIANT(vfslocked); if (auio.uio_resid && error == 0) error = EIO; @@ -1358,13 +1340,11 @@ dqsync(struct vnode *vp, struct dquot *dq) DQI_WAKEUP(dq); dq->dq_flags &= ~DQ_MOD; out: DQI_UNLOCK(dq); - vfslocked = VFS_LOCK_GIANT(dqvp->v_mount); if (vp != dqvp) vput(dqvp); else vrele(dqvp); vn_finished_secondary_write(mp); - VFS_UNLOCK_GIANT(vfslocked); return (error); } diff --git a/sys/vm/vm_contig.c b/sys/vm/vm_contig.c index 7358cb0..ebf6538 100644 --- a/sys/vm/vm_contig.c +++ b/sys/vm/vm_contig.c @@ -94,7 +94,6 @@ vm_contig_launder_page(vm_page_t m, vm_page_t *next) vm_page_t m_tmp; struct vnode *vp; struct mount *mp; - int vfslocked; mtx_assert(&vm_page_queue_mtx, MA_OWNED); object = m->object; @@ -122,13 +121,11 @@ vm_contig_launder_page(vm_page_t m, vm_page_t *next) vm_object_reference_locked(object); VM_OBJECT_UNLOCK(object); (void) vn_start_write(vp, &mp, V_WAIT); - vfslocked = VFS_LOCK_GIANT(vp->v_mount); vn_lock(vp, LK_EXCLUSIVE | LK_RETRY); VM_OBJECT_LOCK(object); vm_object_page_clean(object, 0, 0, OBJPC_SYNC); VM_OBJECT_UNLOCK(object); VOP_UNLOCK(vp, 0); - VFS_UNLOCK_GIANT(vfslocked); vm_object_deallocate(object); vn_finished_write(mp); vm_page_lock_queues(); diff --git a/sys/vm/vm_fault.c b/sys/vm/vm_fault.c index 0a5a412..9f26f41 100644 --- a/sys/vm/vm_fault.c +++ b/sys/vm/vm_fault.c @@ -98,8 +98,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include /* XXX Temporary for VFS_LOCK_GIANT() */ - #define PFBAK 4 #define PFFOR 4 #define PAGEORDER_SIZE (PFBAK+PFFOR) @@ -129,7 +127,6 @@ struct faultstate { vm_map_entry_t entry; int lookup_still_valid; struct vnode *vp; - int vfslocked; }; static inline void @@ -174,8 +171,6 @@ unlock_and_deallocate(struct faultstate *fs) vput(fs->vp); fs->vp = NULL; } - VFS_UNLOCK_GIANT(fs->vfslocked); - fs->vfslocked = 0; } /* @@ -225,7 +220,6 @@ vm_fault(vm_map_t map, vm_offset_t vaddr, vm_prot_t fault_type, growstack = TRUE; PCPU_INC(cnt.v_vm_faults); fs.vp = NULL; - fs.vfslocked = 0; faultcount = behind = 0; RetryFault:; @@ -499,7 +493,6 @@ readrest: */ unlock_map(&fs); -vnode_lock: if (fs.object->type == OBJT_VNODE) { vp = fs.object->handle; if (vp == fs.vp) @@ -510,25 +503,12 @@ vnode_lock: } locked = VOP_ISLOCKED(vp); - if (VFS_NEEDSGIANT(vp->v_mount) && !fs.vfslocked) { - fs.vfslocked = 1; - if (!mtx_trylock(&Giant)) { - VM_OBJECT_UNLOCK(fs.object); - mtx_lock(&Giant); - VM_OBJECT_LOCK(fs.object); - goto vnode_lock; - } - } if (locked != LK_EXCLUSIVE) locked = LK_SHARED; /* Do not sleep for vnode lock while fs.m is busy */ error = vget(vp, locked | LK_CANRECURSE | LK_NOWAIT, curthread); if (error != 0) { - int vfslocked; - - vfslocked = fs.vfslocked; - fs.vfslocked = 0; /* Keep Giant */ vhold(vp); release_page(&fs); unlock_and_deallocate(&fs); @@ -536,7 +516,6 @@ vnode_lock: LK_CANRECURSE, curthread); vdrop(vp); fs.vp = vp; - fs.vfslocked = vfslocked; KASSERT(error == 0, ("vm_fault: vget failed")); goto RetryFault; diff --git a/sys/vm/vm_mmap.c b/sys/vm/vm_mmap.c index 4963a60..b469dfc 100644 --- a/sys/vm/vm_mmap.c +++ b/sys/vm/vm_mmap.c @@ -1155,15 +1155,11 @@ vm_mmap_vnode(struct thread *td, vm_size_t objsize, struct mount *mp; struct ucred *cred; int error, flags; - int vfslocked; mp = vp->v_mount; cred = td->td_ucred; - vfslocked = VFS_LOCK_GIANT(mp); - if ((error = vget(vp, LK_SHARED, td)) != 0) { - VFS_UNLOCK_GIANT(vfslocked); + if ((error = vget(vp, LK_SHARED, td)) != 0) return (error); - } foff = *foffp; flags = *flagsp; obj = vp->v_object; @@ -1227,7 +1223,6 @@ mark_atime: done: vput(vp); - VFS_UNLOCK_GIANT(vfslocked); return (error); } diff --git a/sys/vm/vm_object.c b/sys/vm/vm_object.c index 399cb10..983fcdb 100644 --- a/sys/vm/vm_object.c +++ b/sys/vm/vm_object.c @@ -434,7 +434,6 @@ vm_object_vndeallocate(vm_object_t object) { struct vnode *vp = (struct vnode *) object->handle; - VFS_ASSERT_GIANT(vp->v_mount); VM_OBJECT_LOCK_ASSERT(object, MA_OWNED); KASSERT(object->type == OBJT_VNODE, ("vm_object_vndeallocate: not a vnode object")); @@ -475,38 +474,11 @@ vm_object_deallocate(vm_object_t object) vm_object_t temp; while (object != NULL) { - int vfslocked; - - vfslocked = 0; - restart: VM_OBJECT_LOCK(object); if (object->type == OBJT_VNODE) { - struct vnode *vp = (struct vnode *) object->handle; - - /* - * Conditionally acquire Giant for a vnode-backed - * object. We have to be careful since the type of - * a vnode object can change while the object is - * unlocked. - */ - if (VFS_NEEDSGIANT(vp->v_mount) && !vfslocked) { - vfslocked = 1; - if (!mtx_trylock(&Giant)) { - VM_OBJECT_UNLOCK(object); - mtx_lock(&Giant); - goto restart; - } - } vm_object_vndeallocate(object); - VFS_UNLOCK_GIANT(vfslocked); return; - } else - /* - * This is to handle the case that the object - * changed type while we dropped its lock to - * obtain Giant. - */ - VFS_UNLOCK_GIANT(vfslocked); + } KASSERT(object->ref_count != 0, ("vm_object_deallocate: object deallocated too many times: %d", object->type)); @@ -1081,11 +1053,9 @@ vm_object_sync(vm_object_t object, vm_ooffset_t offset, vm_size_t size, */ if (object->type == OBJT_VNODE && (object->flags & OBJ_MIGHTBEDIRTY) != 0) { - int vfslocked; vp = object->handle; VM_OBJECT_UNLOCK(object); (void) vn_start_write(vp, &mp, V_WAIT); - vfslocked = VFS_LOCK_GIANT(vp->v_mount); vn_lock(vp, LK_EXCLUSIVE | LK_RETRY); flags = (syncio || invalidate) ? OBJPC_SYNC : 0; flags |= invalidate ? OBJPC_INVAL : 0; @@ -1096,7 +1066,6 @@ vm_object_sync(vm_object_t object, vm_ooffset_t offset, vm_size_t size, flags); VM_OBJECT_UNLOCK(object); VOP_UNLOCK(vp, 0); - VFS_UNLOCK_GIANT(vfslocked); vn_finished_write(mp); VM_OBJECT_LOCK(object); } diff --git a/sys/vm/vm_pageout.c b/sys/vm/vm_pageout.c index 723b14d..d71a040 100644 --- a/sys/vm/vm_pageout.c +++ b/sys/vm/vm_pageout.c @@ -885,7 +885,7 @@ rescan0: * pressure where there are insufficient clean pages * on the inactive queue, we may have to go all out. */ - int swap_pageouts_ok, vfslocked = 0; + int swap_pageouts_ok; struct vnode *vp = NULL; struct mount *mp = NULL; @@ -956,7 +956,6 @@ rescan0: vm_page_unlock_queues(); vm_object_reference_locked(object); VM_OBJECT_UNLOCK(object); - vfslocked = VFS_LOCK_GIANT(vp->v_mount); if (vget(vp, LK_EXCLUSIVE | LK_TIMELOCK, curthread)) { VM_OBJECT_LOCK(object); @@ -1025,7 +1024,6 @@ unlock_and_continue: vm_page_unlock_queues(); if (vp != NULL) vput(vp); - VFS_UNLOCK_GIANT(vfslocked); vm_object_deallocate(object); vn_finished_write(mp); vm_page_lock_queues(); diff --git a/sys/vm/vnode_pager.c b/sys/vm/vnode_pager.c index 179afbf..8fea854 100644 --- a/sys/vm/vnode_pager.c +++ b/sys/vm/vnode_pager.c @@ -288,7 +288,6 @@ vnode_pager_haspage(object, pindex, before, after) int poff; int bsize; int pagesperblock, blocksperpage; - int vfslocked; VM_OBJECT_LOCK_ASSERT(object, MA_OWNED); /* @@ -314,9 +313,7 @@ vnode_pager_haspage(object, pindex, before, after) reqblock = pindex * blocksperpage; } VM_OBJECT_UNLOCK(object); - vfslocked = VFS_LOCK_GIANT(vp->v_mount); err = VOP_BMAP(vp, reqblock, NULL, &bn, after, before); - VFS_UNLOCK_GIANT(vfslocked); VM_OBJECT_LOCK(object); if (err) return TRUE; @@ -659,15 +656,12 @@ vnode_pager_getpages(object, m, count, reqpage) int rtval; struct vnode *vp; int bytes = count * PAGE_SIZE; - int vfslocked; vp = object->handle; VM_OBJECT_UNLOCK(object); - vfslocked = VFS_LOCK_GIANT(vp->v_mount); rtval = VOP_GETPAGES(vp, m, bytes, reqpage, 0); KASSERT(rtval != EOPNOTSUPP, ("vnode_pager: FS getpages not implemented\n")); - VFS_UNLOCK_GIANT(vfslocked); VM_OBJECT_LOCK(object); return rtval; } -- Test scenario: msdos.sh