Commit Graph

108304 Commits

Author SHA1 Message Date
Denis Peplin
27b7711324 Fix typo. 2004-10-11 13:07:04 +00:00
Brian Somers
2167678b9c Handle a malloc() failure when allocating urgent ports
PR:		59995
2004-10-11 10:21:53 +00:00
Robert Watson
acf032f516 When harvesting entropy from an ethernet mbuf, do so before freeing the
mbuf.

RELENG_5 candidate.
2004-10-11 10:21:34 +00:00
Brian Somers
5d604c1161 Add a bunch of malloc() return checks
PR:		71592
Submitted by:	Dan Lukes <dan@obluda.cz> with further changes
2004-10-11 09:45:58 +00:00
Robert Watson
cc34aa2094 Add entropy harvest mutex to hard-coded spin lock witness lock order,
remove previous entropy harvesting mutex names as they are no longer
present.  Commit to this file was ommitted when randomdev_soft.c:1.5
was made.

Feet shot:	Robert Huff <roberthuff at rcn dot com>
2004-10-11 08:26:18 +00:00
Robert Watson
35b260cd69 Rework sofree() logic to take into account a possible race with accept().
Sockets in the listen queues have reference counts of 0, so if the
protocol decides to disconnect the pcb and try to free the socket, this
triggered a race with accept() wherein accept() would bump the reference
count before sofree() had removed the socket from the listen queues,
resulting in a panic in sofree() when it discovered it was freeing a
referenced socket.  This might happen if a RST came in prior to accept()
on a TCP connection.

The fix is two-fold: to expand the coverage of the accept mutex earlier
in sofree() to prevent accept() from grabbing the socket after the "is it
really safe to free" tests, and to expand the logic of the "is it really
safe to free" tests to check that the refcount is still 0 (i.e., we
didn't race).

RELENG_5 candidate.

Much discussion with and work by:	green
Reported by:	Marc UBM Bocklet <ubm at u-boot-man dot de>
Reported by:	Vlad <marchenko at gmail dot com>
2004-10-11 08:11:26 +00:00
Philip Paeps
2a669c474a Add 'virtual scrolling' support to moused(8). When holding down the middle
mouse button, motions are interpreted as scrolling.

Submitted by:	Jordan Sissel <psionic-AT-csh.rit.edu>
Approved by:	njl
2004-10-11 07:57:08 +00:00
Gleb Smirnoff
570343bfec Assign pointer NULL, not 0.
Approved by:	julian (mentor)
2004-10-11 07:28:36 +00:00
Denis Peplin
5d3544e59d Merge from English version 1.780
Obtained from:	The FreeBSD Russian Documentation Project
2004-10-11 06:36:48 +00:00
Nate Lawson
a0885d3f14 Notify the user when the battery is critically low. In the future, we
may want to shut down here but the chance of BIOS vendors getting this
wrong is high.  They're only supposed to announce this when all batteries
hit their critical level but past experience indicates we should be
conservative about this for now.
2004-10-11 06:18:07 +00:00
Nate Lawson
18ececa0b8 If bus mastering control is not available (PM2_BLK), don't just disable
C3.  Instead, flush caches before entering C3.  This may be slower but
provides good power savings.
2004-10-11 06:06:42 +00:00
Nate Lawson
7f35f90eae Match surrounding style, not style(msmith). 2004-10-11 05:42:12 +00:00
Nate Lawson
31ad3b8802 Move the code for halting the CPU (acpi_cpu_c1) into machdep files.
This removes the last MD portion of acpi_cpu.c.

MFC after:	2 weeks
2004-10-11 05:39:15 +00:00
Warner Losh
905454c86c Fix conflicts I didn't fix before I committed my busspace changes.
Noticed by: ru@ (and likely tinderbox, I haven't checked)
2004-10-11 00:58:24 +00:00
Peter Edwards
8fe457d687 Fix off-by-one error in fd_native_types that results in a panic on boot
for machines with 2.88M floppies.

Reviewed By: phk
2004-10-10 23:39:59 +00:00
David Malone
08de85f54a Rename thread args to be called "td" rather than "p" to be
consistent with other bits of this file. There should be no
functional change.

Submitted by:	Andrea Campi (many moons ago)
MFC after:	2 month
2004-10-10 18:34:30 +00:00
Lukas Ertl
be75dba724 Add an '-a' switch to only display providers that are at least
0.1% busy.

OK'ed by:  phk
2004-10-10 16:13:11 +00:00
Mike Makonnen
00bd8f10be Add additional information on how to cope with the change. 2004-10-10 16:12:09 +00:00
Søren Schmidt
b913aa0b7f Dont sleep with lock held. 2004-10-10 13:24:39 +00:00
Gleb Smirnoff
8c4a75be4a Revert last commit since it breaks API.
Requested by:	sam
2004-10-10 09:16:48 +00:00
Warner Losh
e94598bb16 The got_siginfo = 0 should have been got_sigalarm=0 to match the other
passes.

Submitted by: Dworkin Muller
2004-10-10 06:37:56 +00:00
Julian Elischer
042b7b1af0 Don't release the slot twice.. sched_rem() has already done it.
Submitted by:	stephan uphoff (ups at tree dot com)
MFC after:	3 days
2004-10-10 05:19:22 +00:00
Julian Elischer
9b036bdf5a Remove duplicate line. 2004-10-10 05:07:43 +00:00
Warner Losh
ac00fac23a Convert to newbus. (chances are we could now move this to dev/pbio
since I believe it is now MI, but that hasn't been done yet).

Reviewed by: dds
2004-10-10 03:26:20 +00:00
Robert Watson
a28ce935d9 Modify entropy harvesting locking strategy:
- Trade off granularity to reduce overhead, since the current model
  doesn't appear to reduce contention substantially: move to a single
  harvest mutex protecting harvesting queues, rather than one mutex
  per source plus a mutex for the free list.

- Reduce mutex operations in a harvesting event to 2 from 4, and
  maintain lockless read to avoid mutex operations if the queue is
  full.

- When reaping harvested entries from the queue, move all entries from
  the queue at once, and when done with them, insert them all into a
  thread-local queue for processing; then insert them all into the
  empty fifo at once.  This reduces O(4n) mutex operations to O(2)
  mutex operations per wakeup.

In the future, we may want to look at re-introducing granularity,
although perhaps at the granularity of the source rather than the
source class; both the new and old strategies would cause contention
between different instances of the same source (i.e., multiple
network interfaces).

Reviewed by:	markm
2004-10-09 22:04:13 +00:00
Robert Watson
6a671583a4 Add a simple C-based TCP connection generator, which generates and
closes the specified number of TCP connections sequentially and
synchronously.  Useful for trying to trigger races in the accept
code.
2004-10-09 20:58:28 +00:00
Nate Lawson
894d8d3c03 Fix fsbtodb() for UFS1. This fixes an overflow for file sizes >1 TB,
allowing for sizes up to 4 TB.  This doesn't affect UFS2 since b is already
a 64 bit type, coincidental with daddr_t.

Submitted by:	bde
2004-10-09 20:16:06 +00:00
Christian S.J. Peron
93962a3a50 Add a note to the man page warning users about possible lock order
reversals+system lock ups if they are using ucred based rules
while running with debug.mpsafenet=1.

I am working on merging a shared locking mechanism into ipfw which
should take care of this problem, but it still requires a bit more
testing and review.
2004-10-09 20:07:33 +00:00
Brian Feldman
55fc8c1146 In the previous revision, I did not intend to change the default value
of "nosleepwithlocks."

Submitted by:	ru
2004-10-09 18:51:32 +00:00
Stefan Farfeleder
552ebda9dd Use the FP_ILOG macros from <math.h> rather than hardcoded return values.
Also be prepared for FP_ILOGBNAN != INT_MAX.

Reviewed by:	md5
2004-10-09 17:14:28 +00:00
Maxim Konovalov
e2494b93fc o Backout rev. 1.16, see 1.3 commit log for more info.
Requested by:	bde

o Remove unneeded sys/types.h and netinet/in.h from the synopsis and
the example.
o We do have struct in_addr in arpa/inet.h, so no need for netinet/in.h.
o Mention where AF_* constants defined are.

Educated by:	bde
2004-10-09 17:13:58 +00:00
Robert Watson
cf2942b67c Acquire the send socket buffer lock around tcp_output() activities
reaching into the socket buffer.  This prevents a number of potential
races, including dereferencing of sb_mb while unlocked leading to
a NULL pointer deref (how I found it).  Potentially this might also
explain other "odd" TCP behavior on SMP boxes (although  haven't
seen it reported).

RELENG_5 candidate.
2004-10-09 16:48:51 +00:00
Robert Watson
b10eb61529 Add SOCKBUF_UNLOCK_ASSERT(), which asserts that the current thread does
not hold the mutex for a socket buffer.
2004-10-09 16:42:57 +00:00
Ken Smith
27dd55ed35 Flush the register windows before we start changing the context.
Submitted by:	Andrew Belashov <bel (at) orel.ru> (slightly modified)
Reviewed by:	jake
2004-10-09 16:42:09 +00:00
Søren Schmidt
8353d82bfd Add support for the ICH6 in legacy mode.
The AHCI part is not supported yet, but is in the works.

5.3 RC1 candidate
2004-10-09 16:27:13 +00:00
Lukas Ertl
c9eaf2265c Make fsck WARNS=2 clean. 2004-10-09 15:56:34 +00:00
Stefan Farfeleder
fbdef8fb8f Include <unistd.h> for {g,s}eteuid(). 2004-10-09 15:36:13 +00:00
Dag-Erling Smørgrav
7ea5573cd8 Return 0, not NULL, from a function declared as returning int. 2004-10-09 14:20:18 +00:00
Joerg Wunsch
4e8ba8de26 Forcibly create symlinked headers, otherwise the build process may fail
if the target link already existed (e. g. -DNO_KERNELCLEAN).
2004-10-09 13:51:28 +00:00
Gleb Smirnoff
42c5607501 Remove inlined m_tag_free(). Rename _m_tag_free() to m_tag_free()
and make it visible (same way as in OpenBSD). Describe usage in manpage.

This change is useful for creating custom free methods, which
call default free method at their end.

While here, make malloc declaration for mbuf tags more informative.

Approved by:	julian (mentor), sam
MFC after:	1 month
2004-10-09 13:25:19 +00:00
David E. O'Brien
3b33d41dc2 style(9) 2004-10-09 08:31:21 +00:00
Brian Feldman
41f57cbc8d Don't "implicitly order all sleep locks before spin locks" in witness
when the spin lock in question isn't -- it's the critical_enter() that
KDB set.  No more panic in DDB for console -> syscons -> tty -> knote
operations.
2004-10-09 08:16:37 +00:00
Takanori Watanabe
42d69dd63e Don't use matchlvl attach arg. It seems to be not initialized
in FreeBSD probe mechanism.
2004-10-09 07:48:31 +00:00
Pyun YongHyeon
e60fc88fa6 Port NetBSD auxio driver. The driver was modified to use led(4) and can
be used to announce various system activity.
The auxio device provides auxiliary I/O functions and is found on various
SBus/EBus UltraSPARC models. At present, only front panel LED is
controlled by this driver.

Approved by:    jake (mentor)
Reviewed by:    joerg
Tested by:      joerg
2004-10-09 07:31:03 +00:00
Scott Long
2f93f011ec Don't count RNBC (internal buffer full) towards the RX error count since it's
not really an error.

Submitted by: Gerrit Nagelhout
2004-10-09 07:27:03 +00:00
Giorgos Keramidas
c084d183ed Delete a .Fn that had no argument and
properly terminate a .Bl with a matching .El

MFC after:	3 days
2004-10-09 04:03:08 +00:00
Scott Long
e7c4605481 3 important fixes for growfs:
1) ginode() is passed a cylinder group number and inode number.  The inode
number is relative to the cg.  Use this relative number rather than the
absolute inode number when searching the cg inode bitmap to see if the inode
is allocated.  Using the absolute number quickly runs the check off the end
of the array and causes invalid inodes to be referenced.

2) ginode() checks the absolute indoe number to make sure that it is greater
than ROOTINO.  However, the caller loops through all of the possible inode
numbers and directly passes in values that are < ROOTINO.  Instead of halting
the program with an error, just return NULL.

3) When allocating new cylinder groups, growfs was initializing all of the
inodes in the group regardless of this only being required for UFS1.  Not
doing this for UFS2 provides a significant performance increase.

These fixes allow growing a filesystem beyond a trivial amount and have
been tested to grow an 8GB filesystem to 1.9TB.  Much more testing would
be appreciated.

Obtained from: Sandvine, Inc.
2004-10-09 02:53:47 +00:00
David Xu
42c7735ce5 if system scope thread didn't set timeout, don't call clock_gettime syscall
before and after sleeping.

Reviewed by: deischen
2004-10-08 22:57:30 +00:00
Søren Schmidt
39e6971cba Only do the geometry translations on ad* devices, other devices seems to
have their own way of life.
Those other devices translations should be moved here as well.
2004-10-08 21:27:27 +00:00
Gleb Smirnoff
2e89951b6f When send()ing to syslogd return ENOBUFS keep trying until success.
This fixes a case, when DoSed syslogd completely loses messages.

PR:		bin/72366
Discussed with:	dwmalone, millert@OpenBSD.org
Approved by:	julian (mentor)
Obtained from:	OpenBSD (rev. 1.17, 1.21 by millert)
MFC after:	3 months
2004-10-08 21:15:21 +00:00