tijl [Mon, 13 Feb 2012 10:24:49 +0000 (10:24 +0000)]
MFC r229794:
- Fix how hexdump parses escape strings
From the NetBSD bug:
The way how hexdump(1) parses escape sequences has some bugs.
It shows up when an escape sequence is used as the non-last character
of a format string.
MFC r230649:
Fix decoding of escape sequences in format strings:
- Zero-terminate the resulting string by letting the for-loop copy the
terminating zero.
- Exit the for-loop after handling a backslash at the end of the format
string to fix a buffer overrun.
- Remove some unnecessary comments and blank lines.
truckman [Mon, 13 Feb 2012 07:30:42 +0000 (07:30 +0000)]
MFC r231102:
Improve sparse file handling when printing the block list for an inode by
not bailing out early when a hole is encountered in the direct block list.
Print NULL block pointers in the direct block list. Simplify the
code that prints the fragment count.
brooks [Sun, 12 Feb 2012 23:07:45 +0000 (23:07 +0000)]
MFC 231196:
eui64_aton and eui64_ntoa are actually the equivalent of ether_aton_r and
ether_nota_r and do not use static variables so remove the note copied
from ethers.3 saying they do.
trociny [Sun, 12 Feb 2012 07:57:58 +0000 (07:57 +0000)]
MFC r231015, r231016:
r231015:
Fix the regression introduced in r226859: if the local component is
out of date BIO_READ requests got lost instead of being sent to the
remote component.
Reviewed by: pjd
r231016:
If a local write request is from the synchronization thread, when it
is synchronizing data that is out of date on the local component, we
should not send G_GATE_CMD_DONE acknowledge to the kernel.
This fixes the issue, observed in async mode, when on synchronization
from the remote component the worker terminated with "G_GATE_CMD_DONE
failed" error.
trociny [Sun, 12 Feb 2012 07:55:33 +0000 (07:55 +0000)]
MFC r230874:
Try to avoid ambiguity when sysctl returns ENOMEM additionally
checking the returned oldlen: when ENOMEM is due to the supplied
buffer being too short the return oldlen is equal to buffer size.
Without this additional check sockstat gets stuck in loop leaking the
memory if the returned ENOMEM was due the exceeded memorylocked
limit. This is easily can be observed running `limits -l 1k sockstat'.
trociny [Sun, 12 Feb 2012 07:52:14 +0000 (07:52 +0000)]
MFC r230873:
Try to avoid ambiguity when sysctl returns ENOMEM additionally
checking the returned oldlen: when ENOMEM is due to the supplied
buffer being too short the return oldlen is equal to buffer size.
Without this additional check kvm_getprocs() gets stuck in loop if the
returned ENOMEM was due the exceeded memorylocked limit. This is
easily can be observed running `limits -l 1k top'.
rmacklem [Sun, 12 Feb 2012 06:01:49 +0000 (06:01 +0000)]
MFC: r231133
r228827 fixed a problem where copying of NFSv4 open credentials into
a credential structure would corrupt it. This happened when the
p argument was != NULL. However, I now realize that the copying of
open credentials should only happen for p == NULL, since that indicates
that it is a read-ahead or write-behind. This patch fixes this.
After this commit, r228827 could be reverted, but I think the code is
clearer and safer with the patch, so I am going to leave it in.
Without this patch, it was possible that a NFSv4 VOP_SETATTR() could have
changed the credentials of the caller. This would have happened if
the process doing the VOP_SETATTR() did not have the file open, but
some other process running as a different uid had the file open for writing
at the same time.
brooks [Fri, 10 Feb 2012 15:54:17 +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>
ae [Fri, 10 Feb 2012 06:34:21 +0000 (06:34 +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.
rmacklem [Fri, 10 Feb 2012 03:32:29 +0000 (03:32 +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.
__COUNTER__ allows one to obtain incrementing (read: unique) numbers
from the C preprocesor. This is useful when implementing things like a
robust implementation of CTASSERT(), which currently fails when using
it more than once on a single line of code. Probably not likely to cause
any breakage, but still.
__COUNTER__ was also added to GCC 4.3, but since that implementation is
GPLv3 licensed, I took the liberty of implementing it without looking at
any upstream sources. Therefore, this version is licensed under the same
license as the rest of the code; GPLv2.
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.
kib [Thu, 9 Feb 2012 10:30:45 +0000 (10:30 +0000)]
MFC r230341:
Use shared lock for the executable vnode in the exec path after the
VV_TEXT changes are handled. Assert that vnode is exclusively locked at
the places that modify VV_TEXT.
mav [Thu, 9 Feb 2012 07:43:38 +0000 (07:43 +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.
kib [Wed, 8 Feb 2012 14:09:08 +0000 (14:09 +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:30:48 +0000 (07:30 +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:55:58 +0000 (19:55 +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.
jhb [Tue, 7 Feb 2012 19:53:02 +0000 (19:53 +0000)]
MFC 229613:
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.
bschmidt [Tue, 7 Feb 2012 18:05:10 +0000 (18:05 +0000)]
MFC r230620:
On state changes from RUN to anything else the AGGR sessions are
cleared/dropped leading to qid2tap[n] being NULL as there no longer
is a tap. Now, if there have been lots of frames queued the firmware
processes and returns those after the tap is gone.
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]
tuexen [Tue, 7 Feb 2012 17:52:32 +0000 (17:52 +0000)]
MFC r227755:
Add support for the SCTP_REMOTE_UDP_ENCAPS_PORT socket option.
Retire the the now unused sctp_udp_tunneling_for_client_enable
sysctl variable.
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 16:07:29 +0000 (16:07 +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:03:39 +0000 (04:03 +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:34:57 +0000 (03:34 +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 / .
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:29:50 +0000 (13:29 +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
tuexen [Mon, 6 Feb 2012 10:22:50 +0000 (10:22 +0000)]
MFC r227755:
Add support for the SCTP_REMOTE_UDP_ENCAPS_PORT socket option.
Retire the the now unused sctp_udp_tunneling_for_client_enable
sysctl variable.
kib [Mon, 6 Feb 2012 10:14:07 +0000 (10:14 +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.
tuexen [Sun, 5 Feb 2012 20:53:06 +0000 (20:53 +0000)]
MFC r230555:
Don't print a warning when using netstat to print
SCTP statistics when there is not SCTP in the kernel.
This problem was reported by Sean Mahood.
tuexen [Sun, 5 Feb 2012 20:45:32 +0000 (20:45 +0000)]
MFC r230104:
Fix two bugs, which result in a panic when calling getsockopt()
using SCTP_RECVINFO or SCTP_NXTINFO.
Reported by Clement Lecigne and forwarded to us by zi@.
pfg [Sun, 5 Feb 2012 20:09:50 +0000 (20:09 +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.
tuexen [Sun, 5 Feb 2012 20:06:43 +0000 (20:06 +0000)]
MFC r229805:
Add an SCTP sysctl "blackhole", similar to the one for TCP.
If set to 1, no ABORT is sent back in response to an incoming
INIT. If set to 2, no ABORT is sent back in response to
an out of the blue packet. If set to 0 (the default), ABORTs
are sent.
Discussed with rrs@.
tuexen [Sun, 5 Feb 2012 20:04:21 +0000 (20:04 +0000)]
MFC 229775:
Retire the SCTP sysctl "strict_init". We always perform the validation
and there is no reason to make is configuarable.
Discussed with rrs@.
tuexen [Sun, 5 Feb 2012 19:59:01 +0000 (19:59 +0000)]
MFC r229774:
Improve the handling of received INITs. Send an ABORT when
not accepting the connection. Also fix a crash, which
could happen when the user closed the socket.