kib [Tue, 12 May 2009 09:28:45 +0000 (09:28 +0000)]
Report all fdescfs vnodes as VCHR for stat(2). Fake the unique
major/minor numbers of the devices.
Pretending that the vnodes are character devices prevents file tree
walkers from descending into the directories opened by current process.
Also, not doing stat on the filedescriptors prevents the recursive entry
into the VFS.
kib [Tue, 12 May 2009 09:22:33 +0000 (09:22 +0000)]
Return controlled EINVAL when the fdescfs lookup routine is given string
representing too large integer, instead of overflowing and possibly
returning a random but valid vnode.
qingli [Tue, 12 May 2009 07:41:20 +0000 (07:41 +0000)]
This patch adds a host route to an interface address (that is assigned
to a non loopback/ppp link types) through the loopback interface. Prior
to the new L2/L3 rewrite, this host route is implicitly added by the L2
code during RTM_RESOLVE of that interface address. This host route is
deleted when that interface is removed.
jhb [Mon, 11 May 2009 21:13:00 +0000 (21:13 +0000)]
*sigh*, while the kernel built, userland C did not. Revert the previous
commit and fix it correctly by removing the _KERNEL check entirely. Now
the kernel always sees the same value of NULL as userland meaning that it
sees __null, 0, or 0L when compiled as C++, and '(void *)0' when compiled
as C.
ed [Mon, 11 May 2009 18:52:46 +0000 (18:52 +0000)]
Add macros around the sx operations in snp(4).
As an experiment, I changed snp(4) to use a mutex instead of an sx lock.
We can't enable this right now, because Syscons still picks up Giant.
It's nice to already have the framework there.
rmacklem [Mon, 11 May 2009 18:45:04 +0000 (18:45 +0000)]
Modify nfsvno_fhtovp() to ensure that it always sets the credp
argument. Returning without credp set could result in a caller
doing crfree() on garbage.
jhb [Mon, 11 May 2009 17:29:11 +0000 (17:29 +0000)]
Always use __null to define NULL for GCC 4+. Use '0' rather than
'(void *)0' for NULL for C++ compilers compiling kernel code. Together this
makes it easier to build kernel modules using C++.
attilio [Mon, 11 May 2009 15:33:26 +0000 (15:33 +0000)]
Remove the thread argument from the FSD (File-System Dependent) parts of
the VFS. Now all the VFS_* functions and relating parts don't want the
context as long as it always refers to curthread.
In some points, in particular when dealing with VOPs and functions living
in the same namespace (eg. vflush) which still need to be converted,
pass curthread explicitly in order to retain the old behaviour.
Such loose ends will be fixed ASAP.
While here fix a bug: now, UFS_EXTATTR can be compiled alone without the
UFS_EXTATTR_AUTOSTART option.
VFS KPI is heavilly changed by this commit so thirdy parts modules needs
to be recompiled. Bump __FreeBSD_version in order to signal such
situation.
dchagin [Mon, 11 May 2009 13:50:42 +0000 (13:50 +0000)]
Translate l_timeval arg to native struct timeval in
linux_setsockopt()/linux_getsockopt() for SO_RCVTIMEO,
SO_SNDTIMEO opts as l_timeval has MD members.
Remove bogus __packed attribute from l_timeval struct on __amd64__.
alc [Mon, 11 May 2009 05:16:57 +0000 (05:16 +0000)]
Revert CVS revision 1.94 (svn r16840). Current pmap implementations don't
suffer from the race condition that motivated revision 1.94. Consequently,
the work-around that was implemented by revision 1.94 is no longer needed.
Moreover, reverting this work-around eliminates the need for
vfs_busy_pages() to acquire the page queues lock when preparing a buffer
for read.
marius [Sun, 10 May 2009 20:41:52 +0000 (20:41 +0000)]
Just like in cpu_halt(), use cpu_shutdown() rather than ofw_exit()
directly in cpu_reset() in order to idle the APs before exiting
the kernel and letting the BSP enter the firmware so that processes
like init(8) which still might be running on an AP at that point
don't cause a panic there when it crashes due to the fact it no
longer can be supported by the kernel.
marius [Sun, 10 May 2009 20:14:19 +0000 (20:14 +0000)]
Change uses of the struct ccb_hdr timeout_ch missed when isp(4) was
adapted to MPSAFE cam(4) to a isp(4) specific callout structure.
Thanks to Florian Smeets for providing access to a machine exhibiting
this problem for debugging.
dchagin [Sun, 10 May 2009 18:43:43 +0000 (18:43 +0000)]
Do not export AT_CLKTCK when emulating Linux kernel prior
to 2.4.0, as it has appeared in the 2.4.0-rc7 first time.
Being exported, AT_CLKTCK is returned by sysconf(_SC_CLK_TCK),
glibc falls back to the hard-coded CLK_TCK value when aux entry
is not present.
Glibc versions prior to 2.2.1 always use hard-coded CLK_TCK value.
For older applications/libc's which depends on hard-coded CLK_TCK
value user should set compat.linux.osrelease less than 2.4.0.
stas [Sun, 10 May 2009 10:32:29 +0000 (10:32 +0000)]
- Fix multicast operation that I broke in previous commit.
- Do not enable multicast hash lookup if no multicast addresses
were configured or if promisc mode is enabled.
stas [Sun, 10 May 2009 08:54:10 +0000 (08:54 +0000)]
- Fix promisc/multicast/broadcast parameters setting by introducing the
new ate_rxfilter function to set requested parameters. Use this function
on parameters change rather than reinitializing the chip.
thompsa [Sun, 10 May 2009 02:44:19 +0000 (02:44 +0000)]
Abort any scan on a fatal firmware. ic_scan_curchan is overridden to perform
the scan in firmware and this relies on the firmware to wake up the scan task
on completion.
thompsa [Sun, 10 May 2009 02:21:19 +0000 (02:21 +0000)]
Cancel the scan when going to INIT state. Should do this for other states here
too as once the protocol newstate handler runs the scan has always ended.
sam [Sat, 9 May 2009 19:22:37 +0000 (19:22 +0000)]
push wme parameter setting to the taskq thread; the update callback from
net80211 can happen from the ithread and submitting the fw cmd requires
a sleepable context
- Just use #error when including <sys/ioctl.h> in the kernel. Code
hasn't used this header for years now and probably doesn't compile
anyway, because of -Werror.
- Get rid of struct ttysize, TIOCGSIZE and TIOCSSIZE. All code nowadays
use both TIOC[GS]SIZE and TIOC[GS]WINSZ. Because we have other popular
systems that don't implement the first, it's of little use to support
interfaces nowadays.
kan [Sat, 9 May 2009 18:09:17 +0000 (18:09 +0000)]
Do not embed struct ucred into larger netcred parent structures.
Credential might need to hang around longer than its parent and be used
outside of mnt_explock scope controlling netcred lifetime. Use separate
reference-counted ucred allocated separately instead.
While there, extend mnt_explock coverage in vfs_stdexpcheck and clean-up
some unused declarations in new NFS code.
Reported by: John Hickey
PR: kern/133439
Reviewed by: dfr, kib
At first I allowed ioctl_compat.h to be included, but it just returned
an empty file. I had to do this, to keep kdump happy. I really want to
raise a compiler error when including this header, so now it will just
throw an error if you don't set COMPAT_43TTY.
alc [Sat, 9 May 2009 08:30:44 +0000 (08:30 +0000)]
Fix a race involving vnode_pager_input_smlfs(). Specifically, in the case
that vnode_pager_input_smlfs() zeroes the page, it should not mark the page
as valid until after the page is zeroed. Otherwise, the page could be
mapped for read access (e.g., by vm_map_pmap_enter()) before the page is
zeroed. Reviewed by: tegge
Eliminate gratuitous clearing of the page's dirty mask by
vnode_pager_input_smlfs(). Instead, assert that the page is clean.
Reviewed by: tegge
Eliminate some blank lines.
Eliminate pointless calls to pmap_clear_modify() and vm_page_undirty() from
vnode_pager_input_old(). The page is not mapped. Therefore, it cannot have
any page table entries that are modified.
Eliminate an incorrect comment from vnode_pager_generic_getpages().
jhb [Sat, 9 May 2009 05:07:36 +0000 (05:07 +0000)]
Convert IPFW_DEFAULT_TO_ACCEPT into a loader tunable
'net.inet.ip.fw.default_to_accept'. The current value can also be queried
via a read-only sysctl of the same name.
kmacy [Sat, 9 May 2009 01:45:55 +0000 (01:45 +0000)]
- rename atomic.S and crc32.c to avoid collisions when linking zfs in to the kernel
- update Makefile
- ifdef out acl_{alloc, free}, they aren't used by zfs and conflict with existing in-kernel routines
davidch [Fri, 8 May 2009 22:20:45 +0000 (22:20 +0000)]
- Fixed incorrect packet length problem caused be earlier change to
support ZERO_COPY_SOCKETS.
- Created #define for context initialization retry count.
I really don't want any pieces of code to include ioctl_compat.h, so let
the ibcs2 and svr4 compat leave sgtty alone. If they want to support
sgtty, they should emulate it on top of termios, not sgtty.
The code has been marked with BURN_BRIDGES for a long time. ibcs2 and
svr4 are not really popular pieces of code anyway.
zec [Fri, 8 May 2009 14:11:06 +0000 (14:11 +0000)]
Introduce a new virtualization container, provisionally named vprocg, to hold
virtualized instances of hostname and domainname, as well as a new top-level
virtualization struct vimage, which holds pointers to struct vnet and struct
vprocg. Struct vprocg is likely to become replaced in the near future with
a new jail management API import.
As a consequence of this change, change struct ucred to point to a struct
vimage, instead of directly pointing to a vnet.
sepotvin [Fri, 8 May 2009 02:18:46 +0000 (02:18 +0000)]
Change the internal buffer used to store input lines from a static buffer
to a dynamically allocated one in order to support input lines of
arbitrary length.
kientzle [Thu, 7 May 2009 23:01:03 +0000 (23:01 +0000)]
Partially revert r191171, which went too far in trying
to eliminate some duplicated code. In particular,
archive_read_open_filename() has different close
handling than archive_read_open_fd(), so delegating
the former to the latter in the degenerate case
(a NULL filename is treated as stdin) broke reading
from pipelines. In particular, this fixes occasional
port failures that were seen when using "gunzip | tar"
pipelines under /bin/csh.
Thanks to Alexey Shuvaev for reporting this failure and
patiently helping me to track down the cause.
kmacy [Thu, 7 May 2009 20:28:06 +0000 (20:28 +0000)]
Asynchronously release vnodes to avoid blocking on range locks when calling back in to zfs.
This is based on a fix that went in to opensolaris on March 9th. However, it uses a dedicated
thread instead of a Solaris' taskq to avoid doing a blocking memory allocation with the vnode
interlock held.
This fixes a long-time deadlock in ZFS. This is not, strictly speaking, an LOR. The spa_zio
thread releases a vnode, this calls in to vn_reclaim which in turn needs to acquire range locks
to sync dirty data out to disk. The range locks are already held by a user-level process waiting
on a condition variable that it the process is waiting on a spa_zio thread to signal it on. The
process could not be signalled because the spa_zio thread could not proceed.
The nature of this problem was not apparent due to ZFS locks opting out of witness which meant
that DDB did not know about the locks that were held by ZFS.
jamie [Thu, 7 May 2009 18:36:47 +0000 (18:36 +0000)]
Move the per-prison Linux MIB from a private one-off pointer to the new
OSD-based jail extensions. This allows the Linux MIB to accessed via
jail_set and jail_get, and serves as a demonstration of adding jail support
to a module.
If we have a regular rint handler, never go into rint_bypass mode.
It turns out if we called cfmakeraw() on a TTY with only a rint handler
in place, it could inject data into the TTY, even though it should be
redirected. Always take a look at the hooks before looking at the
termios flags.