brooks [Fri, 10 Feb 2012 15:54:39 +0000 (15:54 +0000)]
MFC r230403.
When creating the jails /dev/log symlink, do it by full path to avoid
creating stray "log" symlinks if the mount fails. That apparently
happens in some ezjail configs.
PR: conf/143084
Submitted by: Dirk Engling <erdgeist at erdgeist.org>
bz [Fri, 10 Feb 2012 13:15:11 +0000 (13:15 +0000)]
MFC r223741:
Tag mbufs of all incoming frames or packets with the interface's FIB
setting (either default or if supported as set by SIOCSIFFIB, e.g.
from ifconfig).
Submitted by: Alexander V. Chernikov (melifaro ipfw.ru)
Reviewed by: julian
dougb [Fri, 10 Feb 2012 10:18:30 +0000 (10:18 +0000)]
MFC r208307:
This change does the following for the scripts that run up through
FILESYSTEMS (the default early_late_divider):
1. Move sysctl to run first
2. Move as many BEFOREs to REQUIREs as possible.
3. Minor effect, move hostid_save from right before mdconfig to right
after.
A lot of the early scripts make use of sysctl one way or another so
running this first makes a lot of sense given that system-critical
values are often placed in sysctl.conf. (More details in original log.)
In addition to the changes from this revision, tweak a few other rcorder
elements in order to minimize the differences between the order before
and after this change, mostly related to scripts still in this branch
that are no longer in HEAD.
tuexen [Fri, 10 Feb 2012 07:28:37 +0000 (07:28 +0000)]
MFC 216825:
Define and use SCTP_SSN_GE, SCTP_SSN_GT, SCTP_TSN_GE, SCTP_TSN_GT macros
and use them instead of the generic compare_with_wrap.
Retire compare_with_wrap.
ae [Fri, 10 Feb 2012 06:35:14 +0000 (06:35 +0000)]
MFC r228061:
The size of APM could be bigger than number of already allocated entries.
And the first usable sector should not start from the inside of APM area.
MFC r228076:
Add an ability to increase number of allocated APM entries when we
have reserved free space in the APM area.
Also instead of one write request per each APM entry, use MAXPHYS
sized writes when we are updating APM.
bz [Fri, 10 Feb 2012 06:12:48 +0000 (06:12 +0000)]
MFC r223334:
Leave an extra comment about flowtable and IPv6 support rectifying a
previous comment (r206024 in stable/8) to not forget things here in the
future as well and merge the changes without conflicts.
rmacklem [Fri, 10 Feb 2012 04:01:17 +0000 (04:01 +0000)]
MFC: r230605
A problem with respect to data read through the buffer cache for both
NFS clients was reported to freebsd-fs@ under the subject "NFS
corruption in recent HEAD" on Nov. 26, 2011. This problem occurred when
a TCP mounted root fs was changed to using UDP. I believe that this
problem was caused by the change in mnt_stat.f_iosize that occurred
because rsize was decreased to the maximum supported by UDP. This
patch fixes the problem by using v_bufobj.bo_bsize instead of f_iosize,
since the latter is set to f_iosize when the vnode is allocated, but
does not change for a given vnode when f_iosize changes.
In case ntp cannot resolve a hostname on startup it will queue the entry
for resolving by a child process that, upon success, will add the entry
to the config of the running running parent process.
Unfortunately there are a couple of bugs with this, fixed in various
later versions of upstream in potentially different ways due to other
code changes:
1) Upon server [-46] <FQDN> the [-46] are used as FQDN for later resolving
which does not work. Make sure we always pass the name (or IP there).
2) The intermediate file to carry the information to the child process
does not know about -4/-6 restrictions, so that a dual-stacked host
could resolve to an IPv6 address but that might be unreachable (see
r223626) leading to no working synchronization ignoring a IPv4 record.
Thus alter the intermediate format to also pass the address family
(AF_UNSPEC (default), AF_INET or AF_INET6) to the child process
depending on -4 or -6.
3) Make the child process to parse the new intermediate file format and
save the address family for getaddrinfo() hints flags.
4) Change child to always reload resolv.conf calling res_init() before
trying to resolve names. This will pick up resolv.conf changes or
new resolv.confs should they have not existed or been empty or
unusable on ntp startup. This fix is more conditional in upstream
versions but given FreeBSD has res_init there is no need for the
configure logic as well.
mav [Thu, 9 Feb 2012 07:45:02 +0000 (07:45 +0000)]
MFC r230921:
Insert ordered command every 1/4 of the current command timeout, not 1/4
of the default one.
Without this change setting kern.cam.ada.default_timeout to 1 instead of 30
allowed me to trigger several false positive command timeouts under heavy
ZFS load on a SiI3132 siis(4) controller with 5 HDDs on a port multiplier.
Compare port numbers correctly. They are stored by SRCPORT()
in host byte order, so we need to compare them as such.
Properly compare IPv6 addresses as well.
This allows the, by default, 8 badaddrs slots per address
family to work correctly and only print sendto() errors once.
The change is no longer applicable to any latest upstream versions.
marius [Wed, 8 Feb 2012 23:57:03 +0000 (23:57 +0000)]
Given that sun4u uses sparc64/sparc64/ofw_machdep.c, use the sparc64
<machine/ofw_machdep.h> here also. This isn't exactly a clean approach
though as ofw_machdep.h also includes some prototypes for functions
that aren't actually shared between both architectures but just happen
to have the same interface. Given that the sun4v support actually is
dead and this is just to allow things to continue to compile it should
be okay though.
Hide IPv6 next header parsing warnings under the verbose sysctl
so people can possibly disable it when their consoles are flooded,
or enabled it for debugging.
If we detect an IPv6 fragment header and it is not the first fragment,
then terminate the loop as we will not find any further headers and
for short fragments this could otherwise lead to a pullup error
discarding the fragment.
Submitted by: Matthew Luckie (mjl luckie.org.nz)
PR: kern/145733
ipfw internally checks for offset == 0 to determine whether the
packet is a/the first fragment or not. For IPv6 we have added the
"more fragments" flag as well to be able to determine on whether
there will be more as we do not have the fragment header avaialble
for logging, while for IPv4 this information can be derived directly
from the IPv4 header. This allowed fragmented packets to bypass
normal rules as proper masking was not done when checking offset.
Split variables to not need masking for IPv6 to avoid further errors.
After r225032 fix logging in a similar way masking the the IPv6
more fragments flag off so that offset == 0 checks work properly.
Submitted by: Matthew Luckie (mjl luckie.org.nz)
PR: kern/145733
While not explicitly allowed by RFC 2460, in case there is no
translation technology involved (and that section is suggested to
be removed by Errata 2843), single packet fragments do not harm.
There is another errata and further drafts under discussion to clarify
on these kinds of packets.
Meanwhile add a sysctl to allow disabling this behaviour again.
We will treat single packet fragment (a fragment header added
when not needed) as if there was no fragment header.
Submitted by: Matthew Luckie (mjl luckie.org.nz) (original version)
PR: kern/145733
kib [Wed, 8 Feb 2012 15:19:49 +0000 (15:19 +0000)]
MFC r230553:
When doing vflush(WRITECLOSE), clean vnode pages.
Unmounts do vfs_msync() before calling VFS_UNMOUNT(), but there is
still a race allowing a process to dirty pages after msync
finished. Remounts rw->ro just left dirty pages in system.
mav [Wed, 8 Feb 2012 07:31:55 +0000 (07:31 +0000)]
MFC 230877:
Fix NULL dereference panic on attempt to turn off (on system shutdown)
disconnected swap device.
This is quick and imperfect solution, as swap device will still be opened
and GEOM will not be able to destroy it. Proper solution would be to
automatically turn off and close disconnected swap device, but with existing
code it will cause panic if there is at least one page on device, even if
it is unimportant page of the user-level process. It needs some work.
delphij [Tue, 7 Feb 2012 21:56:58 +0000 (21:56 +0000)]
MFC r227454:
Use __packed to prevent alignment from taking place, which otherwise may
change the on-disk format in an incompatible way. Without this change,
msdosfs created on FreeBSD/arm would not be mountable.
PR: bin/162486
Submitted by: Ian Lepore <freebsd damnhippie dyndns org>
Reported by: Mattia Rossi <mrossi at swin.edu.au>
jhb [Tue, 7 Feb 2012 19:56:22 +0000 (19:56 +0000)]
MFC 229614:
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.
Rev. 13572:
disk sync write perf regression when slog is used post oi_148 [1]
Rev. 13573:
crash during reguid causes stale config [2]
allow and unallow missing from zpool history since removal of pyzfs [5]
Rev. 13574:
leaking a vdev when removing an l2cache device [3]
memory leak when adding a file-based l2arc device [4]
leak in ZFS from metaslab_group_create and zfs_ereport_checksum [6]
MFC r230495:
Try resolving jail path with realpath(3).
jail(8) does a chdir(2) to the given path argument. Kernel evaluates the
jail path from the new cwd and not from the original cwd, which leads to
undesired behavior if given a relative path.
cognet [Tue, 7 Feb 2012 15:50:14 +0000 (15:50 +0000)]
MFC r226441 and r226443
r226441:
Explicitely set ARM_RAS_START and ARM_RAS_END once the cacheline or the
page has been allocated, or we could end up using random values, and bad things
could happen.
PR: arm/161492
Submitted by: Ian Lepore <freebsd AT damnhippie dot dyndns DOT org>
r226443:
Fix 2 bugs :
- A race condition could happen if two threads were using RAS at the same time
as the code didn't reset RAS_END, the RAS code could believe we were not in
a RAS, when we were in fact.
- Using signed value logic to compare addresses wasn't such a good idea.
Many thanks to Ian to investigate on these issues.
Pointy hat to: cognet
PR: arm/161498
Submitted by: Ian Lepore <freebsd At damnhippie DOT dyndns dot org
emaste [Tue, 7 Feb 2012 04:06:21 +0000 (04:06 +0000)]
MFC r227893 and r228119:
Avoid double free creating a new RAID with invalid command line
arguments.
In build_volume(), check if arrays is allocated before traversing its
items. While parsing the arrays input, it's possible that we reach the
error path before initializing the 'arrays' pointer, which in turn leads
to a NULL deference.
emaste [Tue, 7 Feb 2012 03:37:29 +0000 (03:37 +0000)]
MFC r226697 and r226708:
Avoid printing // for packages that install to /
I have some packages that install to / (for whatever reason). Right now we
print entries of the form //path/to/file when listing files (pkg_info -L,
pkg_info -g etc.) This change avoids printing the redundant / .
emaste [Tue, 7 Feb 2012 03:15:12 +0000 (03:15 +0000)]
MFC r219708:
Reemove uptime validity check that hasn't been necessary since r151417
switched to clock_gettime. vmstat will now not exit with an error
if run on a system with 10 years of uptime.
r228491:
Do not clobber the ingress queue's congestion setting.
r228561:
Many updates to cxgbe(4)
- Device configuration via plain text config file. Also able to operate
when not attached to the chip as the master driver.
- Generic "work request" queue that serves as the base for both ctrl and
ofld tx queues.
- Generic interrupt handler routine that can process any event on any
kind of ingress queue (via a dispatch table).
- A couple of new driver ioctls. cxgbetool can now install a firmware
to the card ("loadfw" command) and can read the card's memory
("memdump" and "tcb" commands).
- Lots of assorted information within dev.t4nex.X.misc.* This is
primarily for debugging and won't show up in sysctl -a.
- Code to manage the L2 tables on the chip.
- Updates to cxgbe(4) man page to go with the tunables that have changed.
- Updates to the shared code in common/
- Updates to the driver-firmware interface (now at fw 1.4.16.0)
r228594:
Catch up with new driver ioctls in cxgbe.
dumbbell [Mon, 6 Feb 2012 13:36:49 +0000 (13:36 +0000)]
MFC r230212:
sh: Fix execution of multiple statements in a trap when evalskip is set
Before this fix, only the first statement of the trap was executed if
evalskip was set. This is for example the case when:
o "-e" is set for this shell
o a trap is set on EXIT
o a function returns 1 and causes the script to abort
kib [Mon, 6 Feb 2012 10:35:21 +0000 (10:35 +0000)]
MFC r230785:
A debugger which requested PT_FOLLOW_FORK should get the notification
about new child not only when doing PT_TO_SCX, but also for PT_CONTINUE.
If TDB_FORK flag is set, always issue a stop, the same as is done for
TDB_EXEC.
pfg [Sun, 5 Feb 2012 20:18:53 +0000 (20:18 +0000)]
MFC: r230897
Use new OSS-based BSD-licensed header for cs sound driver.
The cs driver requires a table with firmware values. An
alternative firmware is available in a similar Open Sound
System driver. This is actually a partial revert of
Revision 77504.
fork(2) returns -1 on failure, not some random negative number.
r229778 (uqs):
Spelling fixes for sbin/
r229944 (pjd):
Don't touch pidfiles when running in foreground. Before that change we
would create an empty pidfile on start and check if it changed on SIGHUP.
r229945 (pjd):
For functions that return -1 on failure check exactly for -1 and not for
any negative number.
r229946 (pjd):
- Fix a bug where pidfile was removed in SIGHUP when it hasn't changed in
configuration file.
- Log the fact that pidfile has changed.
r230092 (pjd):
Style cleanups.
r230395 (pjd):
Remove unused token 'port'.
r230396 (pjd):
Remove another unused token.
r230436 (pjd):
Fix minor memory leak.
r230457 (pjd):
Free memory that won't be used in child.
r230515 (pjd):
- Fix documentation to note that /etc/hast.conf is the default configuration
file for hastd(8) and hastctl(8) and not hast.conf.
- In copyright statement correct that this file is documentation, not software.
- Bump date.