Subject: CVS commit: syssrc
To: None <source-changes@netbsd.org>
From: Jason R Thorpe <thorpej@netbsd.org>
List: source-changes
Date: 06/14/2001 23:32:49
Module Name: syssrc
Committed By: thorpej
Date: Thu Jun 14 20:32:49 UTC 2001
Modified Files:
syssrc/sys/compat/common: vfs_syscalls_12.c vfs_syscalls_43.c
syssrc/sys/compat/hpux: hpux_compat.c hpux_file.c hpux_tty.c
syssrc/sys/compat/ibcs2: ibcs2_fcntl.c ibcs2_ioctl.c ibcs2_misc.c
syssrc/sys/compat/linux/arch/i386: linux_machdep.c
syssrc/sys/compat/linux/common: linux_blkio.c linux_cdrom.c
linux_fdio.c linux_file.c linux_hdio.c linux_ioctl.c linux_socket.c
linux_termios.c
syssrc/sys/compat/netbsd32: netbsd32_fs.c netbsd32_ioctl.c
syssrc/sys/compat/osf1: osf1_descrip.c
syssrc/sys/compat/ossaudio: ossaudio.c
syssrc/sys/compat/sunos: sunos_ioctl.c sunos_misc.c
syssrc/sys/compat/sunos32: sunos32_ioctl.c sunos32_misc.c
syssrc/sys/compat/svr4: svr4_fcntl.c svr4_ioctl.c svr4_net.c
svr4_stream.c
syssrc/sys/compat/svr4_32: svr4_32_fcntl.c svr4_32_ioctl.c
svr4_32_net.c svr4_32_stream.c
syssrc/sys/compat/ultrix: ultrix_ioctl.c ultrix_misc.c
ultrix_pathname.c
syssrc/sys/kern: exec_script.c kern_descrip.c kern_ktrace.c
sys_generic.c uipc_syscalls.c uipc_usrreq.c vfs_syscalls.c
syssrc/sys/miscfs/fdesc: fdesc_vnops.c
syssrc/sys/netsmb: smb_dev.c
syssrc/sys/sys: file.h filedesc.h
syssrc/sys/uvm: uvm_mmap.c
Log Message:
Fix a partial construction problem that can cause race conditions
between creation of a file descriptor and close(2) when using kernel
assisted threads. What we do is stick descriptors in the table, but
mark them as "larval". This causes essentially everything to treat
it as a non-existent descriptor, except for fdalloc(), which sees a
filled slot so that it won't (incorrectly) allocate it again. When
a descriptor is fully constructed, the code that has constructed it
marks it as "mature" (which actually clears the "larval" flag), and
things continue to work as normal.
While here, gather all the code that gets a descriptor from the table
into a fd_getfile() function, and call it, rather than having the
same (sometimes incorrect) code copied all over the place.
To generate a diff of this commit:
cvs rdiff -r1.8 -r1.9 syssrc/sys/compat/common/vfs_syscalls_12.c
cvs rdiff -r1.18 -r1.19 syssrc/sys/compat/common/vfs_syscalls_43.c
cvs rdiff -r1.56 -r1.57 syssrc/sys/compat/hpux/hpux_compat.c
cvs rdiff -r1.16 -r1.17 syssrc/sys/compat/hpux/hpux_file.c
cvs rdiff -r1.18 -r1.19 syssrc/sys/compat/hpux/hpux_tty.c
cvs rdiff -r1.10 -r1.11 syssrc/sys/compat/ibcs2/ibcs2_fcntl.c
cvs rdiff -r1.21 -r1.22 syssrc/sys/compat/ibcs2/ibcs2_ioctl.c
cvs rdiff -r1.56 -r1.57 syssrc/sys/compat/ibcs2/ibcs2_misc.c
cvs rdiff -r1.63 -r1.64 syssrc/sys/compat/linux/arch/i386/linux_machdep.c
cvs rdiff -r1.3 -r1.4 syssrc/sys/compat/linux/common/linux_blkio.c
cvs rdiff -r1.8 -r1.9 syssrc/sys/compat/linux/common/linux_cdrom.c
cvs rdiff -r1.1 -r1.2 syssrc/sys/compat/linux/common/linux_fdio.c \
syssrc/sys/compat/linux/common/linux_hdio.c
cvs rdiff -r1.37 -r1.38 syssrc/sys/compat/linux/common/linux_file.c
cvs rdiff -r1.26 -r1.27 syssrc/sys/compat/linux/common/linux_ioctl.c
cvs rdiff -r1.29 -r1.30 syssrc/sys/compat/linux/common/linux_socket.c
cvs rdiff -r1.12 -r1.13 syssrc/sys/compat/linux/common/linux_termios.c
cvs rdiff -r1.5 -r1.6 syssrc/sys/compat/netbsd32/netbsd32_fs.c
cvs rdiff -r1.8 -r1.9 syssrc/sys/compat/netbsd32/netbsd32_ioctl.c
cvs rdiff -r1.11 -r1.12 syssrc/sys/compat/osf1/osf1_descrip.c
cvs rdiff -r1.35 -r1.36 syssrc/sys/compat/ossaudio/ossaudio.c
cvs rdiff -r1.36 -r1.37 syssrc/sys/compat/sunos/sunos_ioctl.c
cvs rdiff -r1.109 -r1.110 syssrc/sys/compat/sunos/sunos_misc.c
cvs rdiff -r1.5 -r1.6 syssrc/sys/compat/sunos32/sunos32_ioctl.c
cvs rdiff -r1.8 -r1.9 syssrc/sys/compat/sunos32/sunos32_misc.c
cvs rdiff -r1.36 -r1.37 syssrc/sys/compat/svr4/svr4_fcntl.c
cvs rdiff -r1.20 -r1.21 syssrc/sys/compat/svr4/svr4_ioctl.c
cvs rdiff -r1.25 -r1.26 syssrc/sys/compat/svr4/svr4_net.c
cvs rdiff -r1.42 -r1.43 syssrc/sys/compat/svr4/svr4_stream.c
cvs rdiff -r1.1 -r1.2 syssrc/sys/compat/svr4_32/svr4_32_fcntl.c
cvs rdiff -r1.4 -r1.5 syssrc/sys/compat/svr4_32/svr4_32_ioctl.c
cvs rdiff -r1.2 -r1.3 syssrc/sys/compat/svr4_32/svr4_32_net.c
cvs rdiff -r1.3 -r1.4 syssrc/sys/compat/svr4_32/svr4_32_stream.c
cvs rdiff -r1.16 -r1.17 syssrc/sys/compat/ultrix/ultrix_ioctl.c
cvs rdiff -r1.69 -r1.70 syssrc/sys/compat/ultrix/ultrix_misc.c
cvs rdiff -r1.11 -r1.12 syssrc/sys/compat/ultrix/ultrix_pathname.c
cvs rdiff -r1.27 -r1.28 syssrc/sys/kern/exec_script.c
cvs rdiff -r1.76 -r1.77 syssrc/sys/kern/kern_descrip.c
cvs rdiff -r1.53 -r1.54 syssrc/sys/kern/kern_ktrace.c
cvs rdiff -r1.55 -r1.56 syssrc/sys/kern/sys_generic.c
cvs rdiff -r1.58 -r1.59 syssrc/sys/kern/uipc_syscalls.c
cvs rdiff -r1.50 -r1.51 syssrc/sys/kern/uipc_usrreq.c
cvs rdiff -r1.165 -r1.166 syssrc/sys/kern/vfs_syscalls.c
cvs rdiff -r1.62 -r1.63 syssrc/sys/miscfs/fdesc/fdesc_vnops.c
cvs rdiff -r1.2 -r1.3 syssrc/sys/netsmb/smb_dev.c
cvs rdiff -r1.26 -r1.27 syssrc/sys/sys/file.h
cvs rdiff -r1.22 -r1.23 syssrc/sys/sys/filedesc.h
cvs rdiff -r1.53 -r1.54 syssrc/sys/uvm/uvm_mmap.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.