Commit Graph

167659 Commits

Author SHA1 Message Date
Jaakko Heinonen
d467c9472a r222004 changed sbuf_finish() to not clear the buffer error status. As a
consequence sbuf_len() will return -1 for buffers which had the error
status set prior to sbuf_finish() call. This causes a problem in
pfs_read() which purposely uses a fixed size sbuf to discard bytes which
are not needed to fulfill the read request.

Work around the problem by using the full buffer length when
sbuf_finish() indicates an overflow. An overflowed sbuf with fixed size
is always full.

PR:		kern/163076
Approved by:	des
MFC after:	2 weeks
2012-01-06 10:12:59 +00:00
Andreas Tobler
b286f80c2d Use the macro WEAK_ALIAS. Tested on 32 and 64-bit. 2012-01-06 09:21:40 +00:00
Jaakko Heinonen
9cb24e3c98 Check the return value of sbuf_finish() in pfs_readlink() and return
ENAMETOOLONG if the buffer overflowed.

Approved by:	des
MFC after:	2 weeks
2012-01-06 09:17:34 +00:00
Adrian Chadd
ff23e401a5 Flip these options on so the modules build correctly for now. 2012-01-06 08:51:20 +00:00
Oleksandr Tymoshenko
6cc1d135cd - Add better COP2 (crypto coprocessor) context handler for Octeon. Keep
COP2 disabled and lazily allocate COP2 context structure in exception
    handler. Keep kernel and userland contexts separated.
2012-01-06 01:23:26 +00:00
Adrian Chadd
6b1dcfcd83 Import the first cut of "bsdbox".
This uses the existing crunchgen infrastructure to build
a series of tools designed to replace the base and networking
tools on an embedded system.

It reuses 'bsd.crunchgen.mk' to drive the actual file
creation. The rescue build system also uses this.

Unlike busybox, it doesn't include its own source - instead,
it just builds from the sources in /usr/src/ and leverages
the existing BSD framework.

Thie is still quite messy and could do with a whole lot of
cleaning up.   However it is proving to be very useful with
my current build framework, allowing me to build binary root
images that are about 30% less than simply cherrypicking files
and libraries from an installworld.
2012-01-06 00:56:31 +00:00
Adrian Chadd
0d9f40f219 Fix the broken non-cross compile build. Oops!
Another pointy hat to:	adrian, for stirring up more trouble.
2012-01-06 00:34:27 +00:00
Sergey Kandaurov
4f7fca1ca1 Fix a typo.
X-MFC-with:	229665
2012-01-06 00:23:17 +00:00
Jim Harris
9bea89c1b0 Add 0x2826 device ID for C600 (Patsburg) SATA controller in RAID mode.
Reviewed by: mav
Approved by: scottl
2012-01-06 00:22:55 +00:00
Robert Watson
460b3e8f1d Replace an OpenBSDism with a FreeBSDism in the pfctl(8) man page: we put
configuration file man pages in section 5, and we prefer rc.conf to
rc.conf.local.

MFC after:	3 days
2012-01-05 23:11:05 +00:00
Guy Helmer
532b72687e Fix a memory leak in addgroup() by ensuring the allocated memory
is freed if an error occurs.

PR:		bin/161510
MFC after:	4 weeks
2012-01-05 23:08:11 +00:00
Guy Helmer
074db536b3 Allow daemon(8) to run pidfile_open() before relenquishing privileges
so pid files can be written in /var/run when started as root.

I do not expect this to cause any security issues, but if anyone objects
it could be easily reverted.

PR:		bin/159568
MFC after:	4 weeks
2012-01-05 22:48:36 +00:00
John Baldwin
1e96ae8193 Remove the assertion from tcp_input() that rcv_nxt is always greater
than or equal to rcv_adv and fix tcp_twstart() to handle this case by
assuming the last window was zero rather than a negative value.

The code in tcp_input() already safely handled this case.  It can happen
due to delayed ACKs along with a remote sender that sends data beyond
the window we previously advertised.  If we have room in our socket buffer
for the extra data beyond the advertised window, we will accept it.
However, if the ACK for that segment is delayed, then we will not
effectively fixup rcv_adv to account for that extra data until the
next segment arrives and forces out an ACK.  When that next segment
arrives, rcv_nxt will be beyond rcv_adv.

Tested by:	pjd
MFC after:	1 week
2012-01-05 22:29:11 +00:00
Pawel Jakub Dawidek
62859c9061 - Allow to change vfs.zfs.arc_meta_limit at runtime.
- Change vfs.zfs.arc_meta_used from CTLFLAG_RDTUN to CTLFLAG_RD, as it is
  not a tunable.

MFC after:	3 days
2012-01-05 22:16:41 +00:00
Andreas Tobler
8d252f7868 Fix build on powerpc64 too. The same as r229640. 2012-01-05 22:06:01 +00:00
Adrian Chadd
9b428cfab6 Allow extra directories to be added to the build-tools target.
Things such as "sh" require local tools to be built before
cross-compiling. This allows for extra software (that's
built via LOCAL_DIRS) to also have a build-tools target where
required.
2012-01-05 21:50:50 +00:00
Adrian Chadd
030b95d479 Allow crunchgen binary link generation to be disabled.
If CRUNCH_GENERATE_LINKS is set to "no", then no links will be
generated.

This defaults to "yes" so things like release crunch building
still works.
2012-01-05 21:49:43 +00:00
Ulrich Spörlein
8948622005 Apply Typo-B-Gone 2000 [TM] 2012-01-05 21:43:33 +00:00
Ulrich Spörlein
381edcda1e Convert files over to UTF-8.
These files contained various combinations of Big5, eucJP and KOI8-U
encoded strings. The byte representations of their respective encodings
have been translated to $'...' escape sequences as understood by our sh(1).

With help from:	jilles
2012-01-05 21:36:53 +00:00
Ulrich Spörlein
389ae6c65d Touch up some more small typos missed in the previous round.
Reported by:	Ben Kaduk <minimarmot@gmail.com> et al.
2012-01-05 21:36:45 +00:00
Ulrich Spörlein
f7bcc1c411 Further fix a typo and spelling classic correctly in function names,
too.

Submitted by:	Ben Kaduk <minimarmot@gmail.com>
2012-01-05 21:36:36 +00:00
Ulrich Spörlein
b81da4450d Partial backout of r228990, restore original MIB object name.
It's too late to change this in 9.0 -- so we have a release with the
misspelling in the wild and should not break users that depend on it.

Deprecating/replacing it because of a one-char typo seems excessive.
2012-01-05 21:36:28 +00:00
Ulrich Spörlein
b93ce255b5 Document the detrimental effect of kern.cam.XX.retry_count for recoverdisk(1)
recoverdisk(1) wants to know about read errors when doing the 1MB/64k
reads as fast as possible so it can continue and retry them later with
smaller reads (down to sector size). Any retries by lower layers will
only slow it down.

Prodded by:	arundel
2012-01-05 21:36:20 +00:00
Ulrich Spörlein
cabdddae57 Pull up vendor changes to mdoc(7)
This switches us to using -isoC-2011 as the symbol name which is used by
groff and mdocml. It follows the change to 4 digit years as done with
IEEE Std 1003 post-1999.

MFC after:	2 weeks (groff changes only)
2012-01-05 21:36:12 +00:00
Adrian Chadd
8cb8d9fb89 Fix build. 2012-01-05 20:19:33 +00:00
Adrian Chadd
4573d52b08 Add missing options so modules build/load correctly. 2012-01-05 20:18:01 +00:00
John Baldwin
948c460971 Fix a logic bug in change 228207 in the check for a thread's new user
priority being a realtime priority.

MFC after:	3 days
2012-01-05 19:02:52 +00:00
John Baldwin
137f91e80f Convert all users of IF_ADDR_LOCK to use new locking macros that specify
either a read lock or write lock.

Reviewed by:	bz
MFC after:	2 weeks
2012-01-05 19:00:36 +00:00
John Baldwin
a2cb1d522b Add new variants of the IF_ADDR_*LOCK*() macros used for protecting
interface address lists that distinguish read locks from write locks.
To preserve the KPI, the previous operations are mapped to the write
lock macros.  The lock is still kept as a mutex for now.

Reviewed by:	bz
MFC after:	2 weeks
2012-01-05 18:35:49 +00:00
John Baldwin
b02a80a7c5 Update recently added drivers to use the if_*addr_r*lock() wrapper
functions instead of using the IF_ADDR_LOCK directly.  The wrapper
functions are the supported interface for device drivers.

Reviewed by:	bz, philip
MFC after:	1 week
2012-01-05 18:32:37 +00:00
Robert Watson
19d52de5f4 When extracting the VLAN tag from if_em and if_lem receive descriptor
rings, copy the whole VLAN tag, not just the VLAN ID.  This fixes a
problem in which VLAN priority information was dropped when using
offloaded VLAN processing with these drivers.

Discussed with:	jfv, rrs
Sponsored by:	ADARA Networks, Inc.
MFC after:	3 days
2012-01-05 17:30:15 +00:00
Adrian Chadd
3d090dd20d Flip on IEEE80211_SUPPORT_MESH and AH_SUPPORT_AR5416, the
wlan and ath modules respectively assume this is set.

Pointy hat to:	adrian
2012-01-05 17:28:05 +00:00
Dimitry Andric
f39adedd5b In sys/fs/nullfs/null_subr.c, in a KASSERT, output the correct vnode
pointer 'lowervp' instead of 'vp', which is uninitialized at that point.

Reviewed by:	kib
MFC after:	1 week
2012-01-05 17:06:04 +00:00
John Baldwin
e0636bc0ca Remove use of explicit bus space tags and handles and use methods that
operate on resource objects instead.

MFC after:	1 week
2012-01-05 16:27:32 +00:00
Ed Schouten
ff3e248a90 Remove redundant inclusion of <sys/cdefs.h>.
Mea culpa.
2012-01-05 12:09:39 +00:00
Ed Schouten
cede7d22fe Remove _Complex_I workaround from <tgmath.h>.
This removes the use of __typeof() from this header, thus making it work
with a plain C11 compiler.
2012-01-05 12:06:49 +00:00
Ed Schouten
f92d9d7d37 Make _Complex_I a proper float _Complex when using GCC 4.2.
It turns out our GCC has quite an interesting bug:

	typeof(1.0fi) != float _Complex
	typeof((float _Complex)1.0fi) != float _Complex
	typeof((float _Complex)1.0i) == float _Complex

In other words: if casting to an equal size, GCC seems to take a
shortcut. By casting down from a double to a float, GCC doesn't take
this shortcut, yielding the proper type.

To prevent foot-shooting, add a _Static_assert() to guarantee that
_Complex_I is always a float _Complex. I'm not going to MFC this part of
the diff.

MFC after:	2 weeks
2012-01-05 12:05:48 +00:00
Robert Watson
5a39f779b2 Refine last comment.
Submitted by:	joeld
Sponsored by:	ADARA Networks, Inc.
MFC after:	3 days
2012-01-05 11:42:34 +00:00
Robert Watson
15f6780ef4 Add comment to the VLAN code about its integration with VIMAGE: we see what
the code is doing, we recognise the legitimacy of its goal, but we're not
quite sure it's going about it the right way.  More pondering is clearly
required.

Sponsored by:	ADARA Networks, Inc.
Discussed with:	bz
MFC after:	3 days
2012-01-05 11:24:22 +00:00
Christian Brueffer
b730be7a19 Fix typo.
MFC after:	1 week
2012-01-05 11:16:42 +00:00
Ed Schouten
069a43171f Reimplement <tgmath.h> on top of __generic().
The macro construction used now, is almost identical to the code
provided in C11 proposal N1404. This new version doesn't seem to
introduce any regressions according to the regression test in tools/,
but still seems to malfunction with Clang on certain aspects.

The new code does work successfully with GCC 4.2, 4.6 and 4.7. With 4.7,
it also works when __generic() is implemented on top of _Generic().

Discussed with:	stefanf
2012-01-05 10:46:22 +00:00
Ed Schouten
f8fd121ca4 Add __generic(), to be able to use a very simple _Generic().
Already introducing this allows us to be forward compatible with C11
compilers. By implementing <tgmath.h> on top of this interface, it
becomes trivial to support both our existing GCC and newer compilers.
2012-01-05 10:43:03 +00:00
Baptiste Daroussin
a9e4a4780a Add new pw_make_v7 to make a passwd line (in v7 format) out of a struct passwd
while here, fix missing parentheses of the return statement of pw_make.

Approved by:	des (mentor)
2012-01-05 10:40:24 +00:00
Ed Schouten
19c262fe87 Change index() and rindex() to a weak alias.
This allows people to still write statically linked applications that
call strchr() or strrchr() and have a local variable or function called
index.

Discussed with:	bde@
2012-01-05 10:32:53 +00:00
Ed Schouten
30b42655cf Also import WEAK_ALIAS() from the MIPS code. 2012-01-05 08:51:06 +00:00
Adrian Chadd
8f5aa976d7 This isn't required any longer - it turns out the flash
has ~ 1.7MB of space for a kernel.  There's thus plenty of
space for a full, non-module kernel.
2012-01-05 07:19:05 +00:00
Adrian Chadd
188da34c00 Re-enable this bit of logic from before, which only sets a default
opt_ah.h file if KERNBUILDDIR isn't defined.

For now, AH_SUPPORT_AR5416 is required, so I'll just fix any
configuration file in /usr/src which is missing this option.

Pointy hat when things do break to:	adrian
2012-01-05 06:22:09 +00:00
Adrian Chadd
b018dade46 Use geom_uncompress now, rather than geom_uzip.
This results in a much smaller rootfs image and it easily
fits in the 8MB flash.
2012-01-05 03:38:34 +00:00
Bjoern A. Zeeb
9d9b92f299 Mark a couple of file local functions static and stop exporting them.
MFC after:	1 week
2012-01-05 01:14:35 +00:00
Bjoern A. Zeeb
f67e13d66d Convert an #ifdef DIAGNOSTIC if/panic to a KASSERT.
MFC after:	1 week
2012-01-05 01:13:25 +00:00