]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
7 years agoWITH_META_MODE: Don't expect a .meta file for side-effect generated files.
bdrewery [Wed, 15 Jun 2016 23:57:53 +0000 (23:57 +0000)]
WITH_META_MODE: Don't expect a .meta file for side-effect generated files.

This is the same as r301285.

Approved by: re (implicit)
Sponsored by: EMC / Isilon Storage Division

7 years agoWITH_META_MODE: Do include headers for specific guessed dependencies
bdrewery [Wed, 15 Jun 2016 23:57:50 +0000 (23:57 +0000)]
WITH_META_MODE: Do include headers for specific guessed dependencies

This is a follow-up to r300343.

This is important for the OBJS_DEPEND_GUESS usage in
gnu/usr.bin/cc/cc_tools.

See comments for more details.

Approved by: re (implicit)
Sponsored by: EMC / Isilon Storage Division

7 years agoConvert to new FAST_DEPEND syntax for guessed dependencies.
bdrewery [Wed, 15 Jun 2016 23:57:46 +0000 (23:57 +0000)]
Convert to new FAST_DEPEND syntax for guessed dependencies.

This OBJS_DEPEND_GUESS is needed since each target gets its
own .depend.target.o file but also because it is spelled
.meta.target.o with WITH_META_MODE.  The OBJS_DEPEND_GUESS
will apply the dependency if the required file is missing.

Also remove redundant .c files while here to avoid prolems with
targets using .ALLSRC and getting multiple source files.

Approved by: re (implicit)
Sponsored by: EMC / Isilon Storage Division

7 years agoDon't truncate OBJS_DEPEND_GUESS.target from Makefile
bdrewery [Wed, 15 Jun 2016 23:57:32 +0000 (23:57 +0000)]
Don't truncate OBJS_DEPEND_GUESS.target from Makefile

This is important to allow a Makefile to override OBJS_DEPEND_GUESS for
handling in META_MODE when its depend files are missing.

Approved by: re (implicit)
Sponsored by: EMC / Isilon Storage Division

7 years agoUse sbused() instead of sbspace() to avoid signed issues.
jhb [Wed, 15 Jun 2016 21:08:51 +0000 (21:08 +0000)]
Use sbused() instead of sbspace() to avoid signed issues.

Inserting a full mbuf with an external cluster into the socket buffer
resulted in sbspace() returning -MLEN.  However, since sb_hiwat is
unsigned, the -MLEN value was converted to unsigned in comparisons.  As a
result, the socket buffer was never autosized.  Note that sb_lowat is signed
to permit direct comparisons with sbspace(), but sb_hiwat is unsigned.
Follow suit with what tcp_output() does and compare the value of sbused()
with sb_hiwat instead.

Approved by: re (gjb)
Sponsored by: Chelsio Communications

7 years agoAdd a tool to decode ioctl commands.
jhb [Wed, 15 Jun 2016 21:01:53 +0000 (21:01 +0000)]
Add a tool to decode ioctl commands.

One or more ioctl command values can be passed as arguments on the command
line.  For each value, the command is broken down into it's components
(direction, group, number, and length).  In addition, if a command has a
known name it is output via sysdecode_ioctlname().

Reviewed by: kib, emaste, avg
Approved by: re (gjb)
Differential Revision: https://reviews.freebsd.org/D6851

7 years agoMove backend-specific fields of kaiocb into a union.
jhb [Wed, 15 Jun 2016 20:56:45 +0000 (20:56 +0000)]
Move backend-specific fields of kaiocb into a union.

This reduces the size of kaiocb slightly. I've also added some generic
fields that other backends can use in place of the BIO-specific fields.

Change the socket and Chelsio DDP backends to use 'backend3' instead of
abusing _aiocb_private.status directly. This confines the use of
_aiocb_private to the AIO internals in vfs_aio.c.

Reviewed by: kib (earlier version)
Approved by: re (gjb)
Sponsored by: Chelsio Communications
Differential Revision: https://reviews.freebsd.org/D6547

7 years agoDo not assume that we own the use reference on the covered vnode until
kib [Wed, 15 Jun 2016 15:56:03 +0000 (15:56 +0000)]
Do not assume that we own the use reference on the covered vnode until
we set MNTK_UNMOUNT flag on the mp.  Otherwise parallel unmount which
wins race with us could dereference the covered vnode, and we are
left with the locked freed memory.

Reported and tested by: pho
Sponsored by: The FreeBSD Foundation
Approved by: re (gjb)
MFC after: 1 week

7 years agoAnother follow-up to r291460. Only access vp->v_rdev for VCHR vnodes
kib [Wed, 15 Jun 2016 15:55:14 +0000 (15:55 +0000)]
Another follow-up to r291460. Only access vp->v_rdev for VCHR vnodes
in devfs_reclaim().

Reported and tested by: pho
Sponsored by: The FreeBSD Foundation
Approved by: re (gjb)
MFC after: 1 week

7 years agosdt: annotate the probe test as likely to fail
mjg [Wed, 15 Jun 2016 08:34:36 +0000 (08:34 +0000)]
sdt: annotate the probe test as likely to fail

This saves a jump in plenty of cases.

Approved by: re (kib)
MFC after: 1 week

7 years agometa_oodate: set needOODATE if oodate due to missing .meta file.
sjg [Tue, 14 Jun 2016 23:52:32 +0000 (23:52 +0000)]
meta_oodate: set needOODATE if oodate due to missing .meta file.

Reviewed by: bdrewery
Approved by: re

7 years agocxgbe/t4_tom: Fix inverted assertion in r300895. It is RDMA
np [Tue, 14 Jun 2016 21:09:00 +0000 (21:09 +0000)]
cxgbe/t4_tom:  Fix inverted assertion in r300895.  It is RDMA
connections and not others that are allowed to fail the receive window
check.

Approved by: re (gjb@)

7 years agoiw_cxgbe: Make sure that send_abort results in a TCP RST and not a FIN.
np [Tue, 14 Jun 2016 21:02:36 +0000 (21:02 +0000)]
iw_cxgbe: Make sure that send_abort results in a TCP RST and not a FIN.
Release the hold on ep->com immediately after sending the RST.  This
fixes a bug that sometimes leaves userspace iWARP tools hung when the
user presses ^C.

Submitted by: Krishnamraju Eraparaju @ Chelsio
Approved by: re (gjb@)
Sponsored by: Chelsio Communications

7 years agoFix bug in iwcm that caused a panic in iw_cm_wq when krping is run
np [Tue, 14 Jun 2016 20:58:05 +0000 (20:58 +0000)]
Fix bug in iwcm that caused a panic in iw_cm_wq when krping is run
repeatedly in a tight loop.

Approved by: re (gjb@)
Obtained from: hselasky@ (part of larger changes in D5791)

7 years agoRenegerate for WITH_META_MODE updates.
bdrewery [Tue, 14 Jun 2016 18:41:18 +0000 (18:41 +0000)]
Renegerate for WITH_META_MODE updates.

Approved by: re (implicit)
Sponsored by: EMC / Isilon Storage Division

7 years agoFix makeman showing dependency of DIRDEPS_BUILD->META_MODE.
bdrewery [Tue, 14 Jun 2016 18:37:33 +0000 (18:37 +0000)]
Fix makeman showing dependency of DIRDEPS_BUILD->META_MODE.

This broke in r301887 with the meta mode whitelist.  'make showconfig'
still needs WITH_META_MODE support.

Approved by: re (implicit)
Sponsored by: EMC / Isilon Storage Division

7 years agoFix build from stable/10 with fmake.
bdrewery [Tue, 14 Jun 2016 17:23:22 +0000 (17:23 +0000)]
Fix build from stable/10 with fmake.

This was broken in r301888.

fmake does not look in share/mk by default and thus does not yet
have MK_META_MODE set with default.

Pointyhat to: bdrewery
Approved by: re (implicit)
Sponsored by: EMC / Isilon Storage Division

7 years agoBump __FreeBSD_version for r301602.
bdrewery [Tue, 14 Jun 2016 17:15:36 +0000 (17:15 +0000)]
Bump __FreeBSD_version for r301602.

Reported by: ngie, Ben Lavery
PR: 210229
Approved by: re (gjb)

7 years agoDIRDEPS_BUILD: Update dependencies
bdrewery [Tue, 14 Jun 2016 16:55:05 +0000 (16:55 +0000)]
DIRDEPS_BUILD: Update dependencies

Approved by: re (gjb)
Sponsored by: EMC / Isilon Storage Division

7 years agoMove the arm call to intr_pic_init_secondary earlier in the secondary CPU
andrew [Tue, 14 Jun 2016 16:41:39 +0000 (16:41 +0000)]
Move the arm call to intr_pic_init_secondary earlier in the secondary CPU
initialisation. This ensures it will complete before signalling to the boot
CPU it has booted. This fixes a race with the GIC where the arm_gic_map may
not be populated before it is used to bind interrupts leading to some
interrupts becoming bound to no CPUs.

Approved by: re (kib)
Sponsored by: ABT Systems Ltd

7 years agoWITH_META_MODE: Enable printing of some of make's environment on error.
bdrewery [Tue, 14 Jun 2016 16:20:25 +0000 (16:20 +0000)]
WITH_META_MODE: Enable printing of some of make's environment on error.

This will print a set of variables from make on error using
MAKE_PRINT_VAR_ON_ERROR.  It is already enabled for the DIRDEPS_BUILD.
It may make sense to enable this in the non-meta mode as well once
people are more used to its more verbose error output.

This makes it much simpler to see which .meta file is used when a
command files so that it may be inspected for the build command.

Suggested by: sjg
Approved by: re (implicit)
Sponsored by: EMC / Isilon Storage Division

7 years agoWITH_META_MODE: Lessen the filemon(4) requirement scope.
bdrewery [Tue, 14 Jun 2016 16:20:19 +0000 (16:20 +0000)]
WITH_META_MODE: Lessen the filemon(4) requirement scope.

- Move the sys.mk filemon requirement to bsd.init.mk as a warning.
  This is intended only to show when building directly in a subdirectory
  without filemon loaded.
- Move the error into Makefile and only apply it when building
  from the META_TGT_WHITELIST target list.

-DNO_FILEMON can be used to suppress both the warning and the error but
makes WITH_META_MODE less useful.  It will only compare build commands
in this mode rather than track all dependencies.

This fixes installing from a jail which doesn't need filemon in this
phase [1].

Reported by: Nikolai Lifanov <lifanov@mail.lifanov.com> [1]
Approved by: re (implicit)
Sponsored by: EMC / Isilon Storage Division

7 years agoWITH_META_MODE: Whitelist targets that are meta-mode-safe.
bdrewery [Tue, 14 Jun 2016 16:20:14 +0000 (16:20 +0000)]
WITH_META_MODE: Whitelist targets that are meta-mode-safe.

META_TGT_WHITELIST is added to define which build targets are safe for
meta mode.  See comments for more details.

This fixes 'make delete-old-libs' to properly show the interactive
prompt.

Approved by: re (implicit)
Sponsored by: EMC / Isilon Storage Division

7 years agoWITH_META_MODE: Set MK_META_MODE=no with -B.
bdrewery [Tue, 14 Jun 2016 16:20:11 +0000 (16:20 +0000)]
WITH_META_MODE: Set MK_META_MODE=no with -B.

Using -B already sets .MAKE.MODE=compat but it was leaving
MK_META_MODE set which could still cause other MK_META_MODE==yes
checks to trigger.

Approved by: re (implicit)
Sponsored by: EMC / Isilon Storage Division

7 years agoAdd more missing .PHONY
bdrewery [Tue, 14 Jun 2016 16:20:08 +0000 (16:20 +0000)]
Add more missing .PHONY

Approved by: re (implicit)
Sponsored by: EMC / Isilon Storage Division

7 years agoWITH_META_MODE: Fix rebuilding maketab outside of build-tools.
bdrewery [Tue, 14 Jun 2016 16:20:05 +0000 (16:20 +0000)]
WITH_META_MODE: Fix rebuilding maketab outside of build-tools.

The bsd.dep.mk yacc targets rely on only the .c file getting a .meta
file.  However the previous code here relying on only the .h file meant
that it would be generated with a .meta file.  r301285 made it so that
the .h file is never expected to get a .meta file.  To keep this
restriction in place add in an extra dependency on the .c file so that
it is generated at this time.  It's a hack but the best for the patterns
we have at the moment for handling build-tools and side-effect-generated
files.

Reported by: Mark Millard
Approved by: re (implicit)
Sponsored by: EMC / Isilon Storage Division

7 years agoDefine targets in same order as .ORDER
bdrewery [Tue, 14 Jun 2016 16:19:59 +0000 (16:19 +0000)]
Define targets in same order as .ORDER

This is a NOP but is done for style and to reduce confusion.

Approved by: re (implicit)
Sponsored by: EMC / Isilon Storage Division

7 years agoWITH_META_MODE: Fix rescue rebuilding build-tools.
bdrewery [Tue, 14 Jun 2016 16:19:54 +0000 (16:19 +0000)]
WITH_META_MODE: Fix rescue rebuilding build-tools.

This is the same issue as r297997.

Approved by: re (implicit)
Sponsored by: EMC / Isilon Storage Division

7 years agoWITH_META_MODE: Fix bin/csh rebuilding tc.const.h
bdrewery [Tue, 14 Jun 2016 16:19:49 +0000 (16:19 +0000)]
WITH_META_MODE: Fix bin/csh rebuilding tc.const.h

This is the same issue as r297997, but was missed in it.

The WARNS value changes between 'build-tools' (MK_WARNS=no) and
'everything' resulting in a rebuild of this file.

Approved by: re (implicit)
Sponsored by: EMC / Isilon Storage Division

7 years agoWITH_META_MODE+WITH_DEBUG_FILES: Fix library symlinks causing bogus rebuilds.
bdrewery [Tue, 14 Jun 2016 16:19:44 +0000 (16:19 +0000)]
WITH_META_MODE+WITH_DEBUG_FILES: Fix library symlinks causing bogus rebuilds.

A simplified example of the library targets with WITH_DEBUG_FILES is:

  libgeom.so.5: libgeom.so.5.full
     cp libgeom.so.5.full libgeom.so.5

  libgeom.so.5.full:
     ln -s libgeom.so.5 libgeom.so
     cc -o libgeom.so.5.full *.o

Before, or without, WITH_DEBUG_FILES it is:

  libgeom.so.5:
     ln -s libgeom.so.5 libgeom.so
     cc -o libgeom.so.5 *.o

The problem is that bmake considers the link source for the libgeom.so
link in the libgeom.so.5.full target as being a dependency for
libgeom.so.5.full.  That resolves to libgeom.so.5.  Thus a cyclic
dependency is created.  The result of this is that if libgeom.so.5 is
created with a newer timestamp than libgeom.so.5.full, then
libgeom.so.5.full will be rebuilt on the next build.  This causes a
chain reaction of everything in the build relinking, or hitting the
problem itself.

Moving the link creation to the target that actually creates
libgeom.so.5 fixes the problem.  The simplest fix here is to just
duplicate the logic.

Submitted by: sjg
Approved by: re (implicit)

7 years agomakefs: Provide a -T option to set timestamps to a consistent value
emaste [Tue, 14 Jun 2016 14:03:28 +0000 (14:03 +0000)]
makefs: Provide a -T option to set timestamps to a consistent value

This is taken from the NetBSD versions listed below and adapted to the
makefs version in FreeBSD, along with a bug fix from cem@ that will be
sent to NetBSD.

Reviewed by: pfg
Approved by: re (gjb)
Obtained from: NetBSD
MFC after: 1 month
Differential Revision: https://reviews.freebsd.org/D6835

7 years ago[mips] Tidy up setting/clearing the hardfloat flag.
adrian [Tue, 14 Jun 2016 06:21:51 +0000 (06:21 +0000)]
[mips] Tidy up setting/clearing the hardfloat flag.

Submitted by: kan
Approved by: re (delphij)

7 years agoAdd a missing error check for a malloc() call in idr_get().
markj [Tue, 14 Jun 2016 03:57:00 +0000 (03:57 +0000)]
Add a missing error check for a malloc() call in idr_get().

Submitted by: Matt Joras <mjoras@isilon.com>
Approved by: re (gjb)
MFC after: 1 week
Sponsored by: EMC / Isilon Storage Division

7 years agoAdd myself (mahrens) to calendar.freebsd
mahrens [Mon, 13 Jun 2016 23:36:15 +0000 (23:36 +0000)]
Add myself (mahrens) to calendar.freebsd

Approved by: mckusick
Approved by: re (gjb)

7 years agoRemove the SIOCSIFALIFETIME_IN6 ioctl.
pfg [Mon, 13 Jun 2016 22:31:16 +0000 (22:31 +0000)]
Remove the SIOCSIFALIFETIME_IN6 ioctl.

The SIOCSIFALIFETIME_IN6 provided by the kame project is unused,
it can't really be used safely and has been completely removed from
NetBSD and OpenBSD.

Obtained from: NetBSD (kern/35897)
PR: 210148 (exp-run)
Reviewed by: ae, hrs
Relnotes: yes
Approved by: re (glebius)
Differential Revision: https://reviews.freebsd.org/D5491

7 years agoFix usr.sbin/extattr testcases on tmpfs
asomers [Mon, 13 Jun 2016 22:00:44 +0000 (22:00 +0000)]
Fix usr.sbin/extattr testcases on tmpfs

Skip the usr.sbin/extattr testscases if $TMPDIR is tmpfs, which doesn't
support extended attributes

PR: 210184
Reported by: ngie
Reviewed by: ngie
Approved by: re (glebius)
MFC after: 4 weeks
Differential Revision: https://reviews.freebsd.org/D6802
Sponsored by: Spectra Logic Corp

7 years agol2arc: reset b_tmp_cdata to NULL in the case of unset b_daddr
avg [Mon, 13 Jun 2016 18:39:13 +0000 (18:39 +0000)]
l2arc: reset b_tmp_cdata to NULL in the case of unset b_daddr

The change is in arc_buf_l2_cdata_free().
Without this we can trip the assertion in arc_hdr_realloc()
if INVARIANTS option is enabled.

Approved by: re (kib)
MFC after: 1 week

7 years agoDo not define __NO_STRICT_ALIGNMENT for armv6. While the requirements
ian [Mon, 13 Jun 2016 16:48:27 +0000 (16:48 +0000)]
Do not define __NO_STRICT_ALIGNMENT for armv6.  While the requirements
are no longer natural-alignment strict, there are still some restrictions.

FreeBSD network code assumes data is naturally-aligned or is running
on a platform with no restrictions; pointers are not annotated to
indicate the data pointed to may be packed or unaligned.  The clang
optimizer can sometimes combine the load or store of a pair of adjacent
32-bit values into a single doubleword load/store, and that operation
requires at least 4-byte alignment.  __NO_STRICT_ALIGNMENT can lead
to tcp headers being only 2-byte aligned.

Note that alignment faults remain disabled on armv6, this change reverts
only the defining of the symbol which leads to some overly-agressive code
shortcuts when building common/shared drivers and network code for arm.

Approved by: re(kib)

7 years agoAdd missing break in lock_partialfilelock(..) with NFS_RESERR
ngie [Mon, 13 Jun 2016 11:19:06 +0000 (11:19 +0000)]
Add missing break in lock_partialfilelock(..) with NFS_RESERR

This will help ensure that the right error is trickled up when the
function is called if the lock status is NFS_RESERR

Differential Revision: https://reviews.freebsd.org/D6622
Reviewed by: rmacklem
Approved by: re (gjb)
Tested with: fsx; svn info/svnversion (uses bdb locking); locktests from Bull http://nfsv4.bullopensource.org/tools/tests/locktest.php
MFC after: 2 weeks
Reported by: Coverity
CID: 10081611304956
Sponsored by: EMC / Isilon Storage Division

7 years agozfs_vptocnp: check for an invalid znode
avg [Mon, 13 Jun 2016 10:53:34 +0000 (10:53 +0000)]
zfs_vptocnp: check for an invalid znode

... which can arise after the receive or rollback
and failed zfs_rezget().

Approved by: re (kib)
MFC after: 1 week

7 years agoChange my given name from "Garrett" to "Ngie"
ngie [Mon, 13 Jun 2016 10:35:11 +0000 (10:35 +0000)]
Change my given name from "Garrett" to "Ngie"

A legal name change from "Garrett" to "Ngie", as well as a FreeBSD
account name change, is pending.

Approved by: re (hrs)

7 years agoImplement AUE_PREAD and AUE_PWRITE BSM conversion support, eliminating
rwatson [Mon, 13 Jun 2016 09:22:20 +0000 (09:22 +0000)]
Implement AUE_PREAD and AUE_PWRITE BSM conversion support, eliminating
console warnings when pread(2) and pwrite(2) are used with full
system-call auditing enabled.  We audit the same file-descriptor data
for these calls as we do read(2) and write(2).

Approved by: re (kib)
MFC after: 3 days
Sponsored by: DARPA, AFRL

7 years agoDo not access pv_table array for fictitious pages, since the array
kib [Mon, 13 Jun 2016 03:45:08 +0000 (03:45 +0000)]
Do not access pv_table array for fictitious pages, since the array
does not cover the dynamically registered ficititious ranges, and
fictitious pages mappings are not promoted.  Offer a dummy struct
md_page to fetch constant superpage pv list generation to satisfy
logic.  Also, by initializing the pv_dummy pv_list to empty, we can
remove several explicit PG_FICTITIOUS tests.

Reported and tested by: Michael Butler <imb@protected-networks.net>
(previous version)
Reviewed by: alc
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D6728
Approved by: re (hrs)

7 years agoFix inconsistent locking of the swap pager named objects list.
kib [Mon, 13 Jun 2016 03:42:46 +0000 (03:42 +0000)]
Fix inconsistent locking of the swap pager named objects list.

Right now, all modifications of the list are locked by sw_alloc_mtx.
But initial lookup of the object by the handle in swap_pager_alloc()
is not protected by sw_alloc_mtx, which means that
vm_pager_object_lookup() could follow freed pointer.

Create a new named swap object with the OBJT_SWAP type, instead
of OBJT_DEFAULT.  With this change, swp_pager_meta_build() never need
to upgrade named OBJT_DEFAULT to OBJT_SWAP (in the other place, we do
not forbid for client code to create named OBJT_DEFAULT objects at
all).

That change allows to remove sw_alloc_mtx and make the list locked by
sw_alloc_sx lock.  Update swap_pager_copy() to new locking mode.

Create helper swap_pager_alloc_init() to consolidate named and
anonymous swap objects creation, while a caller ensures that the
neccesary locks are held around the helper.

Reviewed by: alc
Sponsored by: The FreeBSD Foundation
MFC after: 2 weeks
Approved by: re (hrs)

7 years agoExplicitely initialize sw_alloc_sx. Currently it is not initialized
kib [Mon, 13 Jun 2016 03:39:16 +0000 (03:39 +0000)]
Explicitely initialize sw_alloc_sx.  Currently it is not initialized
but works due to zeroed out bss on startup.

Reviewed by: alc
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Approved by: re (hrs)

7 years ago[mips] set hardfloat for fpu instruction generation for gcc/binutils 5.x
adrian [Mon, 13 Jun 2016 03:17:00 +0000 (03:17 +0000)]
[mips] set hardfloat for fpu instruction generation for gcc/binutils 5.x

This allows -HEAD to be compiled again using the gcc-5 mips port compiler.

Reviewed by: imp
Approved by: re@

7 years agoFix compile warning.
hselasky [Mon, 13 Jun 2016 01:33:02 +0000 (01:33 +0000)]
Fix compile warning.

Approved by: re (delphij)
MFC after: 1 week

7 years ago[iwm] Fix up busdma use in the RX path
adrian [Mon, 13 Jun 2016 00:13:20 +0000 (00:13 +0000)]
[iwm] Fix up busdma use in the RX path

When allocating a new mbuf or bus_dmamap_load()-ing it fails,
we can just keep the old mbuf since we are dropping that packet anyway.
Instead of doing bus_dmamap_create() and bus_dmamap_destroy() all the time,
create an extra bus_dmamap_t which we can use to safely try
bus_dmamap_load()-ing the new mbuf. On success we just swap the spare
bus_dmamap_t with the data->map of that ring entry.

Tested:

Tested with Intel AC7260, verified with vmstat -m that new kernel no
longer visibly leaks memory from the M_DEVBUF malloc type.
Before, leakage was 1KB every few seconds while ping(8)-ing over the wlan
connection.

Submitted by: Imre Vadasz <imre@vdsz.com>
Approved by: re@
Obtained from: DragonflyBSD.git cc440b26818b5dfdd9af504d71c1b0e6522b53ef
Differential Revision: https://reviews.freebsd.org/D6742

7 years agoDon't close fd if it's lower then stderr, otherwise we can close
oshogbo [Mon, 13 Jun 2016 00:03:55 +0000 (00:03 +0000)]
Don't close fd if it's lower then stderr, otherwise we can close
one of the descriptor which we just set.

Pointed out by: jilles
Approved by: re (hrs)

7 years agoAdd ipfilter support to blacklistd-helper
lidl [Sun, 12 Jun 2016 23:34:48 +0000 (23:34 +0000)]
Add ipfilter support to blacklistd-helper

In addition to adding initial support for the ipfilter
packet filtering system, wrap a few long lines, perform
whitespace cleanup and sync with upstream changes made
in NetBSD.

Submitted by: cy
Reviewed by: cy
Approved by: re (hrs)
Relnotes: YES
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D6823

7 years agoImplement code to stop all USB endpoints before executing a USB device
hselasky [Sun, 12 Jun 2016 23:26:38 +0000 (23:26 +0000)]
Implement code to stop all USB endpoints before executing a USB device
reset command, alternate setting command or set configuration
command. Else LibUSB v1.0 will not re-open the endpoints which the
kernel closes and the USB application might wait infinitely for
transfers to complete.

Approved by: re (hrs)
MFC after: 3 days

7 years agoFix an issue with multicast hash filters on Amlogic and Allwinner boards.
jmcneill [Sun, 12 Jun 2016 22:55:50 +0000 (22:55 +0000)]
Fix an issue with multicast hash filters on Amlogic and Allwinner boards.

For DWC_GMAC_ALT_DESC implementations, the multicast hash table has only
64 entries. Instead of 8 registers starting at 0x500, a pair of registers
at 0x08 and 0x0c are used instead.

Approved by: re (hrs)
Submitted by: Guy Yur <guyyur@gmail.com>

7 years agoswap_dev_info() does not require Giant, so Giant locking around
kib [Sun, 12 Jun 2016 11:13:38 +0000 (11:13 +0000)]
swap_dev_info() does not require Giant, so Giant locking around
the loop in linprocfs_doswaps() is useless.
List of the registered filesystems is protected by vfsconf_sx,
not by the Giant.  Adjust linprocfs_dofilesystems() correspondingly.

Approved by: re (delphij), des (linprocfs maintainer)
Sponsored by: The FreeBSD Foundation
MFC after: 1 week

7 years agoUpdate 11.0 to ALPHA3 in preparation for new snapshot builds.
gjb [Fri, 10 Jun 2016 19:29:55 +0000 (19:29 +0000)]
Update 11.0 to ALPHA3 in preparation for new snapshot builds.

Approved by: re (implicit)
Sponsored by: The FreeBSD Foundation

7 years agoChange the default build behavior so we don't compile extra TCP modules by
jtl [Fri, 10 Jun 2016 19:06:11 +0000 (19:06 +0000)]
Change the default build behavior so we don't compile extra TCP modules by
default. At least initially, the feature to support multiple TCP stacks is
aimed at supporting advanced use cases and TCP development, but it is not
necessarily aimed at a wide audience. Therefore, there is no need to build
and install the extra TCP stacks by default. Instead, the people who are
using or developing this functionality can add the extra option to build/
install the extra TCP stacks.

However, we do want to build the extra TCP stacks as part of test builds
(e.g. LINT or tinderbox) to ensure that developers who are testing their
changes will know that their changes do not break the additional TCP
stack modules.

After this change, a user will need to add WITH_EXTRA_TCP_STACKS=1 to
make.conf or the kernel config in order to build the extra TCP modules.

Differential Revision: https://reviews.freebsd.org/D6795
Reviewed by: sjg
Approved by: re (kib)

7 years agoDeobfuscate cleanup path in clnt_bck_create(..)
ngie [Fri, 10 Jun 2016 17:53:28 +0000 (17:53 +0000)]
Deobfuscate cleanup path in clnt_bck_create(..)

Similar to r300836, cl and ct will always be non-NULL as they're allocated
using the mem_alloc routines, which always use `malloc(..., M_WAITOK)`.

Deobfuscating the cleanup path fixes a leak where if cl was NULL and
ct was not, ct would not be free'd, and also removes a duplicate test for
cl not being NULL.

Approved by: re (gjb)
Differential Revision: https://reviews.freebsd.org/D6801
MFC after: 1 week
Reported by: Coverity
CID: 1229999
Reviewed by: cem
Sponsored by: EMC / Isilon Storage Division

7 years agoRelnotes entries for blacklist project
lidl [Fri, 10 Jun 2016 15:05:35 +0000 (15:05 +0000)]
Relnotes entries for blacklist project

Approved by: re (gjb)
Sponsored by: The FreeBSD Foundation

7 years agoFix a miss merge in the services_mkdb(8) man page
allanjude [Fri, 10 Jun 2016 14:59:11 +0000 (14:59 +0000)]
Fix a miss merge in the services_mkdb(8) man page

Restore the cross reference to getservent(3) to the correct line

Approved by: re (gjb)
Sponsored by: BSDCan Hacker Lounge

7 years agoFix bsdinstall for root-on-zfs with MBR partitioning
allanjude [Fri, 10 Jun 2016 14:31:59 +0000 (14:31 +0000)]
Fix bsdinstall for root-on-zfs with MBR partitioning

Fix an error where vfs.root.mountfrom was not always set as required
when creating a bootpool. After the recent geliboot changes, it was only
set if the main pool was encrypted.

Also resolve an error where the bootpool was unmounted twice causing
bsdinstall to stop with an error message about the failed command.

Approved by: re (gjb)
Sponsored by: BSDCan Hacker Lounge

7 years ago- Add myself (tz / Torsten Zuehlsdorff) to ports commiters
tz [Fri, 10 Jun 2016 08:33:15 +0000 (08:33 +0000)]
- Add myself (tz / Torsten Zuehlsdorff) to ports commiters
- Add mentors junovitch, pi, swills

Approved by: re (gjb), junovitch (mentor)

7 years agoCommit the bits of nda that were missed. This should fix the build.
imp [Fri, 10 Jun 2016 06:04:53 +0000 (06:04 +0000)]
Commit the bits of nda that were missed. This should fix the build.

Approved by: re@

7 years agoFix regression from r301461.
pfg [Fri, 10 Jun 2016 05:21:52 +0000 (05:21 +0000)]
Fix regression from r301461.

The fix to the __collate_range_cmp() ABI breakage missed some replacements
in libc's vfscanf().  Replace them with __wcollate_range_cmp() which
does what is expected.

This was breaking applications like xterm and pidgin when using wide
characters.

Reported by: Vitalij Satanivskij
Approved by: re

7 years agoClarify the wording to be more accurate.
cy [Fri, 10 Jun 2016 01:10:48 +0000 (01:10 +0000)]
Clarify the wording to be more accurate.

Approved by: re@ (gjb)
MFC after: 1 week
X-MFC with: r301773

7 years agoUpdate the man ipf.8 man page to accurately reflect that the -6
cy [Fri, 10 Jun 2016 00:06:58 +0000 (00:06 +0000)]
Update the man ipf.8 man page to accurately reflect that the -6
option is a noop and only here for backward compatibility.

MFC after: 1 week

7 years agoNew NVMe front end (nda).
imp [Thu, 9 Jun 2016 22:39:02 +0000 (22:39 +0000)]
New NVMe front end (nda).

7 years agorpcbind(8): Make use of some xdr_* macros.
pfg [Thu, 9 Jun 2016 22:25:00 +0000 (22:25 +0000)]
rpcbind(8): Make use of some xdr_* macros.

xdr_rpcproc, xdr_rpcprog and xdr_rpcvers were broken in older
versions of FreeBSD but fixed in r296394.  Give them some use
hoping they help make the code somewhat more readable.

7 years agolibc/rpc: Make use of some xdr_* macros. (part 2)
pfg [Thu, 9 Jun 2016 22:18:25 +0000 (22:18 +0000)]
libc/rpc: Make use of some xdr_* macros. (part 2)

xdr_rpcproc, xdr_rpcprog and xdr_rpcvers were broken in older
versions of FreeBSD but fixed in r296394.  Give them some use
hoping they help make the code somewhat more readable.

7 years agoutimes(2),utime(3): Add deprecation in favour of utimensat(2) and futimens(2).
jilles [Thu, 9 Jun 2016 22:14:58 +0000 (22:14 +0000)]
utimes(2),utime(3): Add deprecation in favour of utimensat(2) and futimens(2).

Setting time by seconds or microseconds may cause unexpected effects
especially if sysctl vfs.timestamp_precision=3 (not default).

Calling the obsolete functions with NULL timestamps is acceptable.

7 years ago[ath] add a placeholder event for debuggin EDMA TX FIFO push events.
adrian [Thu, 9 Jun 2016 22:01:05 +0000 (22:01 +0000)]
[ath] add a placeholder event for debuggin EDMA TX FIFO push events.

Some later code I'll commit pushes lists of frames into the EDMA TX
FIFO, rather than a single frame at a time.  The CABQ code already
pushes frame lists, but it turns out we should actually be doing it
in general or performance tanks. :(

7 years ago[ath] report node queue overflows.
adrian [Thu, 9 Jun 2016 21:59:36 +0000 (21:59 +0000)]
[ath] report node queue overflows.

I need to also update athstats to report this too.

7 years agoinstall: When preserving timestamps, also copy the nanoseconds part.
jilles [Thu, 9 Jun 2016 21:59:35 +0000 (21:59 +0000)]
install: When preserving timestamps, also copy the nanoseconds part.

Now that we have utimensat in -legacy, install(1) can use it.

This is a revert of r299942 which is itself a revert of r299850.

7 years agoFix a vnode leak when giving a child jail a too-long path when
jamie [Thu, 9 Jun 2016 21:59:11 +0000 (21:59 +0000)]
Fix a vnode leak when giving a child jail a too-long path when
debug.disablefullpath=1.

7 years agobuild: Add legacy support for futimens() and utimensat().
jilles [Thu, 9 Jun 2016 21:57:34 +0000 (21:57 +0000)]
build: Add legacy support for futimens() and utimensat().

In order to allow using utimensat() in install(1), add futimens() and
utimensat() to -legacy.

The files futimens.c and utimensat.c are modified copies of the files under
lib/libc/sys/ since the libc versions use symbols that do not exist in the
libc on the build system (sys_futimens and sys_utimensat) . I expect the
next non-sweeping change to both sets of files to be to delete them, anyway.

This will allow reverting r299942 (which is a revert of r299850) enabling
nanosecond timestamps in install(1).

Reviewed by: bdrewery

7 years agourtwn: reinstall group keys on every device startup.
avos [Thu, 9 Jun 2016 21:19:46 +0000 (21:19 +0000)]
urtwn: reinstall group keys on every device startup.

Since key table is cleared on every device shutdown,
static WEP keys (which are set only once) need to be
reinstalled manually every time when device starts running.

Tested with RTL8188EU, STA (all ciphers) / IBSS (WPA-none) modes.

7 years agoFix frexpl() declaration to not include the field name.
trasz [Thu, 9 Jun 2016 20:49:26 +0000 (20:49 +0000)]
Fix frexpl() declaration to not include the field name.

MFC after: 1 month

7 years agoRe-order some jail parameter reading to prevent a vnode leak.
jamie [Thu, 9 Jun 2016 20:43:14 +0000 (20:43 +0000)]
Re-order some jail parameter reading to prevent a vnode leak.

7 years agoUpdate to latest upstream version
des [Thu, 9 Jun 2016 20:40:12 +0000 (20:40 +0000)]
Update to latest upstream version

PR: 209177
Reported by: Vitaly Magerya
MFC after: 1 week

7 years agoClean up some logic in jail error messages, replacing a missing test and
jamie [Thu, 9 Jun 2016 20:39:57 +0000 (20:39 +0000)]
Clean up some logic in jail error messages, replacing a missing test and
a redundant test with a single correct test.

7 years agoDefine tunable instead of using CTLFLAG_RWTUN flag with kern.corefile.
oshogbo [Thu, 9 Jun 2016 20:23:30 +0000 (20:23 +0000)]
Define tunable instead of using CTLFLAG_RWTUN flag with kern.corefile.

The allproc_lock lock used in the sysctl_kern_corefile function is initialized
in the procinit function which is called after setting sysctl values at boot.
That means if we set kern.corefile at boot we will be trying to use
lock with is uninitialized and machine will crash.

If we define kern.corefile as tunable instead of using CTFLAG_RWTUN we will
not call the sysctl_kern_corefile function and we will not use an uninitialized
lock. When machine will boot then we will start using function depending on
the lock.

Reviewed by: pjd

7 years agolibc/rpc: Make use of some xdr_* macros.
pfg [Thu, 9 Jun 2016 19:44:47 +0000 (19:44 +0000)]
libc/rpc: Make use of some xdr_* macros.

xdr_rpcprog and xdr_rpcvers were broken in older versions of FreeBSD
but were fixed in r296394. Give them some use hoping they help make
the code somewhat more readable.

7 years agoFix up r274061
ngie [Thu, 9 Jun 2016 19:12:51 +0000 (19:12 +0000)]
Fix up r274061

Detect /usr/share/dict/words the "right way" by using require.files instead of
the hacked up attempt in the dict(..) function, which didn't work properly on
systems where MK_DICT == no.

MFC after: 1 week
Sponsored by: EMC / Isilon Storage Division

7 years agoUpdate `goodResult` after recent changes made to the PRNG in libc
ngie [Thu, 9 Jun 2016 18:35:37 +0000 (18:35 +0000)]
Update `goodResult` after recent changes made to the PRNG in libc

The PRNG was changed in r300953/r300956, and subsequently, the numbers
generated have changed. This is expected ABI breakage per ache

X-MFC with: r300953, r300956
Tested with: amd64, i386
Sponsored by: EMC / Isilon Storage Division

7 years agoAdd DDB command "kldstat"
cem [Thu, 9 Jun 2016 18:27:41 +0000 (18:27 +0000)]
Add DDB command "kldstat"

It prints much the same information as kldstat(8) without any arguments.

Suggested by: jhibbits
Sponsored by: EMC / Isilon Storage Division

7 years agokvprintf: Pad %*c to width, like %*s
cem [Thu, 9 Jun 2016 18:24:51 +0000 (18:24 +0000)]
kvprintf: Pad %*c to width, like %*s

Sponsored by: EMC / Isilon Storage Division

7 years agoAdd debug output to aid in determining why `goodResult` != `result`
ngie [Thu, 9 Jun 2016 18:11:42 +0000 (18:11 +0000)]
Add debug output to aid in determining why `goodResult` != `result`

MFC after: 1 week
PR: 210619 (for diagnosis)
Sponsored by: EMC / Isilon Storage Division

7 years agourtwn(4): refresh manpage.
avos [Thu, 9 Jun 2016 17:26:54 +0000 (17:26 +0000)]
urtwn(4): refresh manpage.

Mention URTWN_WITHOUT_UCODE option (r295871), hardware encryption support
(r292175), IBSS (r290651) and HOSTAP (r290631) mode support;
cleanup CAVEATS section (some 11n support was added in r297175 + add a
note about current rate control issues).

7 years agoAdd PCDuino3b dts. It uses the pcduino3 dts from upstream and adds the hdmi node...
manu [Thu, 9 Jun 2016 17:10:19 +0000 (17:10 +0000)]
Add PCDuino3b dts. It uses the pcduino3 dts from upstream and adds the hdmi node, axp gpio and changes the phy mode to rgmii.

Approved by: andrew (mentor)
Differential Revision: https://reviews.freebsd.org/D6775

7 years agoUse -L to specify compat32 library paths instead of -Y
emaste [Thu, 9 Jun 2016 17:03:03 +0000 (17:03 +0000)]
Use -L to specify compat32 library paths instead of -Y

-Y is an uncommon linker option that is rather similar to -L.  In
discussion with Peter it seems early amd64 development might have
required the -Y-specific behaviour, but it is no longer necessary.

Switch to -L which is more widely supported and much more commonly
used, to make it easier to link the FreeBSD base system with linkers
other than ld.bfd.

Submitted by: Rafael Ávila de Espíndola
Differential Revision: https://reviews.freebsd.org/D6681

7 years agoMake sure the OSD methods for jail set and remove can't run concurrently,
jamie [Thu, 9 Jun 2016 16:41:41 +0000 (16:41 +0000)]
Make sure the OSD methods for jail set and remove can't run concurrently,
by holding allprison_lock exclusively (even if only for a moment before
downgrading) on all paths that call PR_METHOD_REMOVE.  Since they may run
on a downgraded lock, it's still possible for them to run concurrently
with PR_METHOD_GET, which will need to use the prison lock.

7 years agoxen/timer: re-introduce the inittodr call in the resume path
royger [Thu, 9 Jun 2016 16:15:01 +0000 (16:15 +0000)]
xen/timer: re-introduce the inittodr call in the resume path

r298930 removed the inittodr call, but it seems like this prevents
"calcru: runtime went backwards ..." messages from occasionally appearing
when resuming from migration.

Reported by: Karl Pielorz <kpielorz@tdx.co.uk>
Sponsored by: Citrix Systems R&D

7 years agoAdd place holder for SDIO CAM stuff for CCB XPT type.
imp [Thu, 9 Jun 2016 16:05:56 +0000 (16:05 +0000)]
Add place holder for SDIO CAM stuff for CCB XPT type.

Sponsored by: Netflix

7 years agoAdd NVME IO type.
imp [Thu, 9 Jun 2016 16:05:49 +0000 (16:05 +0000)]
Add NVME IO type.

7 years agoImprove debugging of xpt.
imp [Thu, 9 Jun 2016 16:05:40 +0000 (16:05 +0000)]
Improve debugging of xpt.

Sponsored by: Netflix

7 years agoRemove a comment that was part of copied code, and is misleading in
jamie [Thu, 9 Jun 2016 15:34:33 +0000 (15:34 +0000)]
Remove a comment that was part of copied code, and is misleading in
the new location.

7 years agoAdd IPFW support to blacklistd-helper
lidl [Thu, 9 Jun 2016 15:19:48 +0000 (15:19 +0000)]
Add IPFW support to blacklistd-helper

Relnotes: YES
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D6753

7 years agoRevert previous commit, until issue with sparc64 resolved.
sjg [Thu, 9 Jun 2016 14:44:05 +0000 (14:44 +0000)]
Revert previous commit, until issue with sparc64 resolved.

Approved by: so (implicit)

7 years agoFix the rpcb_getaddr() definition to match its declaration.
kevlo [Thu, 9 Jun 2016 14:33:00 +0000 (14:33 +0000)]
Fix the rpcb_getaddr() definition to match its declaration.

Submitted by: Sebastian Huber <sebastian dot huber at embedded-brains dot de>

7 years agorum(4): refresh manpage.
avos [Thu, 9 Jun 2016 14:18:12 +0000 (14:18 +0000)]
rum(4): refresh manpage.

Add a note about hardware encryption support (r288633),
adhoc-demo mode (r288622) and remove BUGS section (fixed in r288632).

7 years agoSwitch from console="comconsole" to boot_multicons="YES" in EC2.
cperciva [Thu, 9 Jun 2016 13:58:31 +0000 (13:58 +0000)]
Switch from console="comconsole" to boot_multicons="YES" in EC2.

Amazon recently introduced an API for capturing screenshots of an
emulated VGA device; this commit makes that (somewhat) useful.

MFC after: 3 weeks

7 years agonet80211: discard an injected frame if it is smaller than header length.
avos [Thu, 9 Jun 2016 13:42:18 +0000 (13:42 +0000)]
net80211: discard an injected frame if it is smaller than header length.

Do not try to pass such frames; a correct frame cannot be smaller than
(the corresponding) header size.
(for wpi(4) an additional check was added in r289012).

PR: 144987