This is primarily for developer/debugging use; it enables built-in tagged
tracking of refcounts inside ZFS. It can only be enabled from the loader,
since it modifies how in-core state is managed. Default remains disabled.
mav [Sun, 20 Mar 2016 18:56:03 +0000 (18:56 +0000)]
MFC r271781i (by will):
bpobj_iterate_impl(): Close a refcount leak iterating on a sublist.
If bpobj_space() returned non-zero here, the sublist would have been
left open, along with the bonus buffer hold it requires. This call
does not invoke any calls to bpobj_close() itself.
This bug doesn't have any known vector, but was found on inspection.
MFC after: 1 week
Sponsored by: Spectra Logic
Affects: All ZFS versions starting 21 May 2010 (illumos cde58dbc)
MFSpectraBSD: r1050998 on 2014/03/26
mav [Sun, 20 Mar 2016 14:37:37 +0000 (14:37 +0000)]
MFC r256613, r256862: MFprojects/camlock r254763:
Move tq_enqueue() call out of the queue lock for known handlers (actually
I have found no others in the base system). This reduces queue lock hold
time and congestion spinning under active multithreaded enqueuing.
np [Sun, 20 Mar 2016 05:01:40 +0000 (05:01 +0000)]
MFC r277759 (by jhb@)
Fix a couple of panics when detaching from a cxgbe/cxl interface that was
never brought up:
- Allow NULL to be passed to sglist_free().
- Don't try to stop an interface that was never fully initialized.
Raise WARNS from 1 to 6 (the default)
Fix warnings:
* Use C99 designated initializers for structs, and initialize all fields
* Mark global variables as static
* Mark unused function arguments
* Be careful about signed/unsigned comparisons
rpcbind/check_bound.c
Fix CID1347798, a memory leak in mergeaddr.
rpcbind/tests/addrmerge_test.c
Fix CID1347800 through CID1347803, memory leaks in ATF tests. They
are harmless because each ATF test case runs in its own process, but
they are trivial to fix. Fix a few other leaks that Coverity didn't
detect, too.
Fix a bug in rpcbind for multihomed hosts. If the server had interfaces on
two separate subnets, and a client on the first subnet contacted rpcbind at
the address on the second subnet, rpcbind would advertise addresses on the
first subnet. This is a bug, because it should prefer to advertise the
address where it was contacted. The requested service might be firewalled
off from the address on the first subnet, for example.
usr.sbin/rpcbind/check_bound.c
If the address on which a request was received is known, pass that
to addrmerge as the clnt_uaddr parameter. That is what addrmerge's
comment indicates the parameter is supposed to mean. The previous
behavior is that clnt_uaddr would contain the address from which the
client sent the request.
usr.sbin/rpcbind/util.c
Modify addrmerge to prefer to use an IP that is equal to clnt_uaddr,
if one is found. Refactor the relevant portion of the function for
clarity, and to reduce the number of ifdefs.
etc/mtree/BSD.tests.dist
usr.sbin/rpcbind/tests/Makefile
usr.sbin/rpcbind/tests/addrmerge_test.c
Add unit tests for usr.sbin/rpcbind/util.c:addrmerge.
usr.sbin/rpcbind/check_bound.c
usr.sbin/rpcbind/rpcbind.h
usr.sbin/rpcbind/util.c
Constify some function arguments
pfg [Thu, 17 Mar 2016 19:28:15 +0000 (19:28 +0000)]
MFC r294504, r294652, r294653, r294655:
ext2fs: Bring back the htree dir_index implementation.
The htree dir_index is perhaps one of the most characteristic
features of the linux ext3 implementation. It was removed
in r281670, due to repeated bug reports.
Damjan Jovanic detected and fixed three bugs and did some
stress testing by building Apache OpenOffice on top of it
so it is now in good shape to bring back.
mp [Thu, 17 Mar 2016 00:32:29 +0000 (00:32 +0000)]
MFC 296416:
Signal handling within tcsh vfork code path will conflict with some system
libraries (such as libthr) which maintain their own signal state. This
change adds the tcsh SAVESIGVEC option to save and restore the sigvecs for
the signals the child modifies before it execs.
glebius [Wed, 16 Mar 2016 22:35:55 +0000 (22:35 +0000)]
Merge r296956:
Due to invalid use of a signed intermediate value in the bounds checking
during argument validity verification, unbound zero'ing of the process LDT
and adjacent memory can be initiated from usermode.
ngie [Mon, 14 Mar 2016 01:35:46 +0000 (01:35 +0000)]
MFC r293878,r293880,r295116,r295117,r295477:
r293878:
Remove unnecessary kldload logic added to geom_subr.sh in r293028
r293880:
PID file support hasn't been committed for ggated(8) yet. Unbreak running
the testcase more than once by restoring the "killall ggated"
r295116:
Add an additional 1 second sleep to after calling ggatec before calling
dd to defeat a race when writing out to the geom_gate(4) device
This will quell the Jenkins failure emails until I come up with a better
solution
r295117:
Use the pidfile support added to ggated(8) in r294973 to ensure that the
ggated(8) daemon used by the tests is the instance specifically invoked by
the tests instead of one or more daemon instances running on the system
r295477:
Similar to r295116, add an additional 1 second sleep after calling ggatel
before calling dd to defeat a race when writing out to the geom_gate(4)
device
ngie [Mon, 14 Mar 2016 01:31:40 +0000 (01:31 +0000)]
MFC r293821:
Integrate
tools/regression/geom_{concat,eli,gate,mirror,nop,raid3,shsec,stripe,uzip}
in to the FreeBSD test suite as
tests/sys/geom/class/{concat,eli,gate,mirror,nop,raid3,shsec,stripe,uzip}
The tools/regression/geom and tools/regression/geom_part testcases are being
left alone because both test sets are both currently broken.
The majority of this work was done on ^/user/ngie/more-tests2 . The differences
are as follows:
- tests/sys/geom/class/Makefile.inc is not present; it was
inlined into the class's Makefiles for explicitness.
- The testcases officially require root via kyua
- The geom_gate(4) tests don't use the pidfile changes proposed in
https://reviews.freebsd.org/D4836 .
ngie [Sun, 13 Mar 2016 23:29:11 +0000 (23:29 +0000)]
MFC r293621,r293622,r293815:
r293621:
- Delete non-TAP testcases
- Add a conf.sh file for executing common functions with geom_gate
- Use attach_md for attaching md(4) devices
- Don't hardcode /tmp for temporary files, which violates the kyua sandbox
- Add/increase sleeps to try and improve synchronization
- Add debug output for when checksums fail
test-1.t:
- Use pkill for killing ggated
r293622:
Remove Makefile now that the testcases are all TAP based and
prove -rv can be used on them
dim [Sun, 13 Mar 2016 18:32:10 +0000 (18:32 +0000)]
Pull in r219512 from upstream llvm trunk (by Hal Finkel):
[MiSched] Fix a logic error in tryPressure()
Fixes a logic error in the MachineScheduler found by Steve Montgomery
(and confirmed by Andy). This has gone unfixed for months because the
fix has been found to introduce some small performance regressions.
However, Andy has recommended that, at this point, we fix this to
avoid further dependence on the incorrect behavior (and then
follow-up separately on any regressions), and I agree.
Fixes PR18883.
This fixes a possible "ran out of registers" error when compiling
www/firefox 45.0 on i386.
Direct commit to stable/10, because head already has this fix since the
llvm/clang 3.6.0 import.
ngie [Sun, 13 Mar 2016 01:17:53 +0000 (01:17 +0000)]
MFC r293443:
- Make test-1.sh into a TAP testable testcase
- Delete test-2.sh as it was an incomplete testcase, and the contents were
basically a subset of test-1.sh
- Add a conf.sh file for executing common functions with geom_uzip
- Use attach_md for attaching md(4) devices
- Don't hardcode /tmp for temporary files, which violates the kyua sandbox
ngie [Sun, 13 Mar 2016 01:16:50 +0000 (01:16 +0000)]
MFC r293442:
- Add a geom_stripe specific cleanup function and trap on that function at
exit so things are cleaned up properly
- Use attach_md for attaching md(4) devices
- Don't hardcode /tmp for temporary files, which violates the kyua sandbox
ngie [Sun, 13 Mar 2016 01:15:34 +0000 (01:15 +0000)]
MFC r293441:
- Add a geom_shsec specific cleanup function and trap on that function at
exit so things are cleaned up properly
- Use attach_md for attaching md(4) devices
- Don't hardcode /tmp for temporary files, which violates the kyua sandbox
ngie [Sun, 13 Mar 2016 01:14:07 +0000 (01:14 +0000)]
MFC r293438:
- Add a geom_raid3 specific cleanup function and trap on that function at
exit so things are cleaned up properly
- Use attach_md for attaching md(4) devices
- Don't hardcode /tmp for temporary files, which violates the kyua sandbox
ngie [Sun, 13 Mar 2016 01:12:58 +0000 (01:12 +0000)]
MFC r293437:
- Add a conf.sh file for executing common functions with gnop
- Use attach_md for attaching md(4) devices
- Don't hardcode /tmp for temporary files, which violates the kyua sandbox
ngie [Sun, 13 Mar 2016 01:08:10 +0000 (01:08 +0000)]
MFC r293436:
- Add a conf.sh file for executing common functions with geli
-- Use linear probing to find the first unique md(4) device, unlike the other
code which uses attach_md, as geli(8) allocates the md(4) devices itself
- Don't hardcode /tmp for temporary files, which violates the kyua sandbox
ngie [Sat, 12 Mar 2016 23:11:08 +0000 (23:11 +0000)]
MFC r293434:
- Use attach_md for memory disks so they can be tracked.
- Add a geom_concat specific cleanup function and trap on that function at
exit so things are cleaned up properly
- Don't hardcode /tmp for temporary files, which violates the kyua sandbox
bdrewery [Sat, 12 Mar 2016 19:26:21 +0000 (19:26 +0000)]
MFC r268620,r294876,r294877:
r268620:
Make generation of nslexer.c more robust.
r294876:
nslexer.c does not depend on nsparser.h.
r294877:
Replace nslexer.l->nslexer.c custom rule with a -D CFLAG.
bdrewery [Sat, 12 Mar 2016 19:07:21 +0000 (19:07 +0000)]
MFC r296286,r296470,r296472,r296473,r296575:
r296286:
Remove filemon->lock wrappers.
r296470:
Only call bwillwrite() for logging to vnodes, as other fo_write() calls do.
r296472:
Require kldunload -f to unload.
r296473:
Add missing break for r296472.
r296575:
FILEMON_SET_FD: Disallow changing the fd.
ngie [Sat, 12 Mar 2016 19:05:49 +0000 (19:05 +0000)]
MFC r294894:
Adjust vm.max_wired in order to avoid hitting EAGAIN artificially
Set vm.max_wired to INT_MAX in :mlock_err, :mlock_mmap, and :mlock_nested to
avoid hitting EAGAIN artificially on the system when running the tests
Require root privileges in order to set the sysctl
Add allow_sysctl_side_effects to require.config as this test is now adjusting
sysctls that can affect the global system state
Unlike the version submitted by cem in OneFS, this version uses a scratch file
to save/restore the previous value of the sysctl. I _really_, _really_ wish
there were better hooks in atf/kyua for per test suite setup/teardown -- using
a file is kludgy, but it's the best I can do to avoid situations where (for
instance), sysctl(3) may fail and drop a core outside the kyua sandbox.
Based on a patch submitted by cem, but modified to take business logic out of
ATF_TP_ADD_TCS(3).
kib [Sat, 12 Mar 2016 17:25:33 +0000 (17:25 +0000)]
MFC r295352:
Do not call vn_fullpath(9) (through the pmc_getfilename() wrapper)
when its result is immediately ignored, i.e. for kernel processes
forked from the user process. Do not test for non-null before freeing
string.
kib [Wed, 9 Mar 2016 10:19:32 +0000 (10:19 +0000)]
MFC r296009:
In bpf_getdltlist(), do not call copyout(9) while holding bpf lock.
Copy the data into temprorary malloced buffer and drop the lock for
copyout.
hrs [Mon, 7 Mar 2016 10:56:38 +0000 (10:56 +0000)]
- Use FPI and catalog resolution instead of system entities. This change
fixes build with a non-standard DOC_PREFIX, but it is still a temporal
measure because some of them should be done by using XInclude,
not by entity reference.
hselasky [Mon, 7 Mar 2016 09:42:16 +0000 (09:42 +0000)]
MFC r295928:
Configure the correct bMaxPacketSize for control endpoints before
requesting the initial complete device descriptor and not as part of
the subsequent babble error recovery. Babble means that the received
USB packet was bigger than than configured maximum packet size. This
only affects enumeration of FULL speed USB devices which use a
bMaxPacketSize different from 8 bytes. This patch might help fix
enumeration of USB devices which exhibit USB I/O errors in dmesg
during boot.