]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
8 years agozfs: allow the lookup of extended attributes of an unlinked file
Andriy Gapon [Mon, 2 Nov 2015 10:07:21 +0000 (10:07 +0000)]
zfs: allow the lookup of extended attributes of an unlinked file

That's required for extattr_get_fd(2) and the like to work properly.

PR: 203201
MFC after: 17 days

8 years agoAdd testcases for -t cd9660 -o isolevel=[1-3]
Enji Cooper [Mon, 2 Nov 2015 09:16:51 +0000 (09:16 +0000)]
Add testcases for -t cd9660 -o isolevel=[1-3]

-- -o isolevel=1 currently fails because of path comparison issues,
   so mark it as an expected failure.
-- -o isolevel=3 is not implemented, so expect it to fail as an out
   of bounds value [*].

PR: 203645
MFC after: 1 week
X-MFC with: r290264
Sponsored by: EMC / Isilon Storage Division

8 years agoLimit isoLevel to 1 and 2 to avoid segfaulting when isoLevel is set to 3 by
Enji Cooper [Mon, 2 Nov 2015 08:43:15 +0000 (08:43 +0000)]
Limit isoLevel to 1 and 2 to avoid segfaulting when isoLevel is set to 3 by
dereferencing a NULL function pointer

Add some asserts to ensure that isolevel is always either 1 or 2.

PR: 203645
Reported by: Thomas Schmitt <scdbackup@gmx.net>
MFC after: 1 week
Sponsored by: EMC / Isilon Storage Division

8 years agoFix spelling of `isolevel` cd9660 option
Enji Cooper [Mon, 2 Nov 2015 07:46:47 +0000 (07:46 +0000)]
Fix spelling of `isolevel` cd9660 option

MFC after: 1 week
X-MFC with: r290260
Sponsored by: EMC / Isilon Storage Division

8 years agoBump .Dd for r290259 and r290260
Enji Cooper [Mon, 2 Nov 2015 07:42:42 +0000 (07:42 +0000)]
Bump .Dd for r290259 and r290260

8 years agoDocument undocumented long options for -t cd9660
Enji Cooper [Mon, 2 Nov 2015 07:40:18 +0000 (07:40 +0000)]
Document undocumented long options for -t cd9660

Note which options have been implemented and which options haven't
been implemented

Submitted as the following NetBSD PRs: bin/50390 and bin/50392

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

8 years agoSync makefs(8) content a bit with src/usr.sbin/makefs/makefs.8@1.53
Enji Cooper [Mon, 2 Nov 2015 07:36:42 +0000 (07:36 +0000)]
Sync makefs(8) content a bit with src/usr.sbin/makefs/makefs.8@1.53

Sections involving unimplemented filesystems (chfs, msdosfs, udf, v7fs) and
options have been omitted.

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

8 years agomips: rate limit the trap handler output; add pid/tid/program name.
Adrian Chadd [Mon, 2 Nov 2015 03:36:15 +0000 (03:36 +0000)]
mips: rate limit the trap handler output; add pid/tid/program name.

I discovered that we're logging each trap, which gets pretty spendy;
and there wasn't any further information on the pid/tid/progname involved.

I originally noticed this because I don't attach anything to /dev/log and so
the log() output stays going to the kernel.  That's an oops on my part, but
I'm glad I did it.

This commit adds the following:

* a rate limiter, which could do with some eyeballs/ideas on how to
  make it more predictable on SMP;
* log pid, tid, progname (comm) as part of the output.

I now get output like this:

Unaligned Load Word: pid=621 (pmcstat), tid=100060, pc=0xffffffff803ae898, badvaddr=0x40a10055
Unaligned Load Word: pid=621 (pmcstat), tid=100060, pc=0xffffffff803ae898, badvaddr=0x40a10051
Unaligned Load Word: pid=621 (pmcstat), tid=100060, pc=0xffffffff803ae898, badvaddr=0x40a1004d
Unaligned Load Word: pid=602 (login), tid=100042, pc=0xffffffff803ae898, badvaddr=0x401159
Unaligned Load Word: pid=602 (login), tid=100042, pc=0xffffffff803ae898, badvaddr=0x401155
Unaligned Load Word: pid=602 (login), tid=100042, pc=0xffffffff803ae898, badvaddr=0x401151

.. which makes it much easier to start figuring out what/where to fix.

The pc looks suss (it looks like it's in kernel space); I'll dig into that one next.

Tested:

* AR9331 SoC (Carambola2)

8 years agoDefine `fhard` in pps_event(..) only when PPS_SYNC is defined to mute
Enji Cooper [Mon, 2 Nov 2015 03:14:37 +0000 (03:14 +0000)]
Define `fhard` in pps_event(..) only when PPS_SYNC is defined to mute
an -Wunused-but-set-variable warning

Reported by: FreeBSD_HEAD_amd64_gcc4.9 jenkins job
Sponsored by: EMC / Isilon Storage Division

8 years agoDefine `compress` in `__elfN(coredump)` when #ifdef GZIO is true to mute
Enji Cooper [Mon, 2 Nov 2015 01:47:26 +0000 (01:47 +0000)]
Define `compress` in `__elfN(coredump)` when #ifdef GZIO is true to mute
an -Wunused-but-set-variable warning

Reported by: FreeBSD_HEAD_amd64_gcc4.9 jenkins job
Sponsored by: EMC / Isilon Storage Division

8 years agoAdd _test suffix to multiple tests in lib/libc to conform to the design noted
Enji Cooper [Mon, 2 Nov 2015 01:29:01 +0000 (01:29 +0000)]
Add _test suffix to multiple tests in lib/libc to conform to the design noted
in the FreeBSD Test Suite wiki

MFC after: 3 days
Sponsored by: EMC / Isilon Storage Division

8 years agoRemove unused variable (SRCDIR)
Enji Cooper [Mon, 2 Nov 2015 01:23:04 +0000 (01:23 +0000)]
Remove unused variable (SRCDIR)

MFC after: 3 days
Sponsored by: EMC / Isilon Storage Division

8 years agoRemove unnecessary `if (x)` tests before calling `free(x)`; free(3)
Enji Cooper [Mon, 2 Nov 2015 01:22:06 +0000 (01:22 +0000)]
Remove unnecessary `if (x)` tests before calling `free(x)`; free(3)
already employs this check

MFC after: 2 weeks
Sponsored by: EMC / Isilon Storage Division

8 years agoRename etc/periodic/daily/430.status-rwho to periodic/daily/430.status-uptime
Enji Cooper [Mon, 2 Nov 2015 01:05:34 +0000 (01:05 +0000)]
Rename etc/periodic/daily/430.status-rwho to periodic/daily/430.status-uptime

The command was checking local/remote system uptime, so rename the script to
match its function and to avoid confusion

The controlling variable in /etc/periodic.conf has been renamed from
daily_status_rwho_enable to daily_status_uptime_enable.

MFC after: 3 days
Reported by: Peter Jeremy <peter@rulingia.com>
Relnotes: yes
Sponsored by: EMC / Isilon Storage Division

8 years agoUse nitems(x) instead of sizeof(x)/sizeof(x[0])
Enji Cooper [Mon, 2 Nov 2015 00:42:31 +0000 (00:42 +0000)]
Use nitems(x) instead of sizeof(x)/sizeof(x[0])

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

8 years agoConditionally install (if_)?(otus|rsu).4, otusfw.4, rsufw.4, and urtwn.4 if
Enji Cooper [Mon, 2 Nov 2015 00:39:28 +0000 (00:39 +0000)]
Conditionally install (if_)?(otus|rsu).4, otusfw.4, rsufw.4, and urtwn.4 if
MK_USB != no

Add the manpages to OptionalObsoleteFiles.inc

As a side-effect, this also fixes installworld with MK_USB == no

X-MFC with: r290128
Sponsored by: EMC / Isilon Storage Division

8 years agoAdd mailbox tag/structure for touchscreen buffer address property
Oleksandr Tymoshenko [Sun, 1 Nov 2015 23:50:07 +0000 (23:50 +0000)]
Add mailbox tag/structure for touchscreen buffer address property

8 years agoSynchronize with latest upstream VCHI code:
Oleksandr Tymoshenko [Sun, 1 Nov 2015 22:17:39 +0000 (22:17 +0000)]
Synchronize with latest upstream VCHI code:

- Add LIB_VERSION ioctl
- Add CLOSE_DELIVERED ioctl
- Bump code version

Upstream version: 3782f2ad42c08f4d32f64138f8be7341afc380f5

8 years agosh: Avoid copying argv for simple commands.
Jilles Tjoelker [Sun, 1 Nov 2015 22:07:40 +0000 (22:07 +0000)]
sh: Avoid copying argv for simple commands.

Add dummy entries before and after so arglist's array is directly usable as
argv.

8 years agoTreat synchronous VFP exception just like aynchronous: as an FP exception,
Oleksandr Tymoshenko [Sun, 1 Nov 2015 21:59:56 +0000 (21:59 +0000)]
Treat synchronous VFP exception just like aynchronous: as an FP exception,
not as illegal instruction

8 years agoFix lladdr change propagation for on vlans on top of it.
Alexander V. Chernikov [Sun, 1 Nov 2015 19:59:04 +0000 (19:59 +0000)]
Fix lladdr change propagation for on vlans on top of it.
Fix lladdr update when setting mac address manually.
Fix lladdr_event for slave ports addition.

MFC after: 4 weeks
Sponsored by: Yandex LLC
Differential Revision: https://reviews.freebsd.org/D4004

8 years agodrm/i915: Reduce diff with Linux 3.8
Jean-Sébastien Pédron [Sun, 1 Nov 2015 19:55:32 +0000 (19:55 +0000)]
drm/i915: Reduce diff with Linux 3.8

There is no functional change. The goal is to ease the future update to
Linux 3.8's i915 driver.

MFC after: 2 months

8 years agopfctl: Fix uninitialised veriable
Kristof Provost [Sun, 1 Nov 2015 17:20:17 +0000 (17:20 +0000)]
pfctl: Fix uninitialised veriable

In pfctl_set_debug() we used 'level' without ever initialising it.
We correctly parsed the option, but them failed to actually assign the parsed
value to 'level' before performing to ioctl() to configure the debug level.

PR: 202996
Submitted by: Andrej Kolontai

8 years agoInstall myself as src committer.
Michal Meloun [Sun, 1 Nov 2015 16:54:55 +0000 (16:54 +0000)]
Install myself as src committer.

Approved by: kib (mentor)

8 years agoMicrooptimize.
Andrey A. Chernov [Sun, 1 Nov 2015 08:40:15 +0000 (08:40 +0000)]
Microoptimize.

8 years agoAddition to prev. commit.
Andrey A. Chernov [Sun, 1 Nov 2015 06:47:05 +0000 (06:47 +0000)]
Addition to prev. commit.
In some edge cases fp->_p can be changed in _sseek(), recalculate.

PR:     204156
MFC after:      1 week

8 years agoDon't seek to the end if write buffer is empty (in append modes).
Andrey A. Chernov [Sun, 1 Nov 2015 06:15:14 +0000 (06:15 +0000)]
Don't seek to the end if write buffer is empty (in append modes).

PR:             204156
MFC after:      1 week

8 years agoioat: Handle channel-fatal HW errors safely
Conrad Meyer [Sat, 31 Oct 2015 20:38:06 +0000 (20:38 +0000)]
ioat: Handle channel-fatal HW errors safely

Certain invalid operations trigger hardware error conditions.  Error
conditions that only halt one channel can be detected and recovered by
resetting the channel.  Error conditions that halt the whole device are
generally not recoverable.

Add a sysctl to inject channel-fatal HW errors,
'dev.ioat.<N>.force_hw_error=1'.

When a halt due to a channel error is detected, ioat(4) blocks new
operations from being queued on the channel, completes any outstanding
operations with an error status, and resets the channel before allowing
new operations to be queued again.

Update ioat.4 to document error recovery;  document blockfill introduced
in r290021 while we are here;  document ioat_put_dmaengine() added in
r289907;  document DMA_NO_WAIT added in r289982.

Sponsored by: EMC / Isilon Storage Division

8 years agodrm/i915: Reduce diff with Linux 3.8
Jean-Sébastien Pédron [Sat, 31 Oct 2015 15:09:31 +0000 (15:09 +0000)]
drm/i915: Reduce diff with Linux 3.8

There is no functional change. The goal is to ease the future update to
Linux 3.8's i915 driver.

MFC after: 2 months

8 years agoWe have long double on arm64, and the tests pass so enable them.
Andrew Turner [Sat, 31 Oct 2015 10:16:44 +0000 (10:16 +0000)]
We have long double on arm64, and the tests pass so enable them.

Sponsored by: ABT Systems Ltd

8 years agonewsyslog: treat 'c' flag in the config as 'C'
Baptiste Daroussin [Sat, 31 Oct 2015 09:45:11 +0000 (09:45 +0000)]
newsyslog: treat 'c' flag in the config as 'C'

When -C was introduced in r114137 the plan was to have -C and -c being used for
"create" due to a typo in FreeBSD <= 4.8 a temporary compatibility hack has been
added to make -c being like -G aka GLOB and a warning was issued for the user to
be aware of the futur change for -c.

12 years later it is more than time to remove that hack and finish the what was
intent in r114137

Submitted by: Alexandre Perrin <alex@kaworu.ch>
Relnotes: yes
Differential Revision: https://reviews.freebsd.org/D4000

8 years agoThe error classification from lower layers is a poor indicator of
Warner Losh [Sat, 31 Oct 2015 04:53:07 +0000 (04:53 +0000)]
The error classification from lower layers is a poor indicator of
whether an error is recoverable. Always re-dirty the buffer on errors
from write requests. The invalidation we used to do for errors not EIO
doesn't need to be done for a device that's really gone, since that's
done in a different path.

Reviewed by: mckusick@, kib@

8 years agoRather than using the #define for path names, indirect through a char *
Warner Losh [Sat, 31 Oct 2015 04:39:55 +0000 (04:39 +0000)]
Rather than using the #define for path names, indirect through a char *
variable that could change for different executable types detected.

8 years agoMove all the paths into a new path.h to centralize them.
Warner Losh [Sat, 31 Oct 2015 04:39:28 +0000 (04:39 +0000)]
Move all the paths into a new path.h to centralize them.

8 years agoPrint unsigned memory sizes, to handle >2GB RAM on 32-bit powerpc.
Justin Hibbits [Sat, 31 Oct 2015 02:08:39 +0000 (02:08 +0000)]
Print unsigned memory sizes, to handle >2GB RAM on 32-bit powerpc.

Sponsored by: Alex Perez/Intertial Computing

8 years agoDon't hide stderr when checking ${CC} --version.
Bryan Drewery [Sat, 31 Oct 2015 02:07:30 +0000 (02:07 +0000)]
Don't hide stderr when checking ${CC} --version.

This can have important debugging information such as 'cc: not found' or
'ccache: error: Could not find compiler "cc" in PATH'.

MFC after: 2 weeks
Sponsored by: EMC / Isilon Storage Division

8 years agomips: do mips_sync() on sync operations to uncachable memory.
Adrian Chadd [Sat, 31 Oct 2015 00:29:26 +0000 (00:29 +0000)]
mips: do mips_sync() on sync operations to uncachable memory.

mips24k/mips74k document that we need an explicit SYNC so to order
things correctly, even with access to uncachable memory.
We were doing calls to SYNC in the cache ops (inv, wbinv) but we
weren't doing it for uncachable memory.

8 years agomips74k: use cache-writeback for memory, not writethrough.
Adrian Chadd [Sat, 31 Oct 2015 00:04:44 +0000 (00:04 +0000)]
mips74k: use cache-writeback for memory, not writethrough.

When I ported this code from netbsd I was .. slightly mips74k greener.
I used writethrough because (a) it's what netbsd did, and (b) if I used
writethrough then things "didn't work."

Fast-forward a couple years, more MIPS hacking and a whole lot more
understanding of the bus APIs (the last few commits notwithstanding;
it's been a long week, ok?) and I have this working for arge,
argemdio, spi and ath.  Hans has it working for USB.  The ath barrier
code will come in a later commit.

This gets the routing throughput up from 220mbit -> 337mbit.
I'm sure the bridging throughput will be similarly improved.

Tested:

* QCA955x SoC, routing workload.

8 years agoarge_mdio: fix barriers; correctly check MII indicator register.
Adrian Chadd [Fri, 30 Oct 2015 23:59:52 +0000 (23:59 +0000)]
arge_mdio: fix barriers; correctly check MII indicator register.

* use barriers in a slightly better fashion.  You can blame this
  glass of whiskey on putting barriers in the wrong spot.  Grr adrian.

* steal/rewrite the mdio busy check from ag7100 from openwrt and
  refactor the existing code out.  This is .. more correct.

This seems to fix the boot-to-boot variation that I've been seeing
and it quietens the switch port status flapping.

Tested:

* QCA9558 SoC (AP135.)

Obtained from: Linux OpenWRT

8 years agoarge: fix barrier macro.
Adrian Chadd [Fri, 30 Oct 2015 23:57:20 +0000 (23:57 +0000)]
arge: fix barrier macro.

8 years agoarge: attempt to close a transmit race by only enabling the descriptor at the end...
Adrian Chadd [Fri, 30 Oct 2015 23:18:02 +0000 (23:18 +0000)]
arge: attempt to close a transmit race by only enabling the descriptor at the end of setup.

This driver and the linux ag71xx driver both treat the transmit ring
as a circular linked list of descriptors.  There's no "end" pointer
that is ever NULL - instead, it expects the MAC to hit a finished
descriptor (ARGE_DESC_EMPTY) and stop.

Now, since it's a circular buffer, we may end up with the hardware
hitting the beginning of our multi-descriptor frame before we've finished
setting it up. It then DMA's it in, starts sending it, and we finish
writing out the new descriptor.  The hardware may then write its
completion for the next descriptor out; then we do, and when we next
read it it'll show up as "not done" and transmit completion stops.

This unfortunately manifests itself as the transmit queue always
being active and a massive TX interrupt storm.  We need to actively
ACK packets back from the transmit engine and if we don't (eg because
we think the transmit isn't finished but it is) then the unit will
just keep generating interrupts.

I hit this finally with the below testing setup.  This fixed it for me.

Strictly speaking I should put in a sync in between writing out all of
the descriptors and writing out that final descriptor.

Tested:

* QCA9558 SoC (AP135 reference board) w/ arge1 + vlans acting as a
  router, and iperf -d (tcp, bidirectional traffic.)

Obtained from: Linux OpenWRT (ag71xx_main.c.)

8 years agoarge: just use 1U since it's a 32 bit unsigned destination value.
Adrian Chadd [Fri, 30 Oct 2015 23:09:08 +0000 (23:09 +0000)]
arge: just use 1U since it's a 32 bit unsigned destination value.

8 years agoarge: do an explicit flush between updating the TX ring and starting transmit.
Adrian Chadd [Fri, 30 Oct 2015 23:07:32 +0000 (23:07 +0000)]
arge: do an explicit flush between updating the TX ring and starting transmit.

The MIPS busdma sync operations currently are a big no-op on coherent memory.
This isn't strictly correct behaviour as we need a SYNC in here to ensure that
the writes have finished and are visible in main memory before the MMIO accesses
occur.  This will have to be addressed in a later commit.

But, before that happens, let's at least do a flush here to make things
more "correct".

This is required for even remotely sensible behaviour on mips74k with
write-through memory enabled.

8 years agoarge_mdio: add explicit read barriers for MDIO_READs.
Adrian Chadd [Fri, 30 Oct 2015 23:00:47 +0000 (23:00 +0000)]
arge_mdio: add explicit read barriers for MDIO_READs.

The mips74k programmers guide notes that reads can be re-ordered, even
uncached ones, so we need an explicit SYNC between them.

Yes, this is a case of a driver author actively doing a bus barrier
operation.

This ends up being necessary when the mips74k core is run in write-back
mode rather than write-through mode.  That's coming in an upcoming
commit.

Tested:

* mips74k, QCA9558 SoC (AP135 reference board), arge<->arge interface
  routing traffic tests.

8 years agoarge: ensure there's enough space in the TX ring before attempting to
Adrian Chadd [Fri, 30 Oct 2015 22:55:41 +0000 (22:55 +0000)]
arge: ensure there's enough space in the TX ring before attempting to
send frames.

This matches the other check for space.

"enough" is a misnomer, for "reasons".  The biggest reason is that
the TX ring is actually a circular linked list, with no head/tail pointers.
This is just a bit more headroom between head/tail so we have time to
schedule frames before we hit where the hardware is at.

Ideally this would be tunable and a little larger.

8 years agoarge: do a read-after-write on all arge register writes, not just MDIO writes.
Adrian Chadd [Fri, 30 Oct 2015 22:53:30 +0000 (22:53 +0000)]
arge: do a read-after-write on all arge register writes, not just MDIO writes.

This flushes out the write to the system before anything continues.

The mips74k guide, chapter 3.3.3 (write gathering) notes that writes
can be buffered in FIFOs - even uncached ones - so we can't guarantee
the device has felt its effects.  Now, since we're all lazy driver
authors and don't pepper read/write barriers everywhere, fake it here.

tested:

* mips74k - QCA9558 SoC (AP135 reference board)

8 years agoRemove unneeded _RECURSING_PROGS check.
Bryan Drewery [Fri, 30 Oct 2015 21:23:14 +0000 (21:23 +0000)]
Remove unneeded _RECURSING_PROGS check.

It is definitely not needed after r288158, and is a private variable as well
that should not be checked here.

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

8 years agoMerge OpenSSL 1.0.2d.
Jung-uk Kim [Fri, 30 Oct 2015 20:51:33 +0000 (20:51 +0000)]
Merge OpenSSL 1.0.2d.

8 years agoMinor (and incomplete) style cleanup.
Konstantin Belousov [Fri, 30 Oct 2015 20:47:42 +0000 (20:47 +0000)]
Minor (and incomplete) style cleanup.

Sponsored by: The FreeBSD Foundation
MFC after: 1 week

8 years agoUpdate ls -l tests to use mtime, not birthtime
Ed Maste [Fri, 30 Oct 2015 20:14:32 +0000 (20:14 +0000)]
Update ls -l tests to use mtime, not birthtime

PR: 204155
Reviewed by: ngie, rodrigc
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D4040

8 years agoAlso mark compat32 umtx op table as constant.
Konstantin Belousov [Fri, 30 Oct 2015 19:32:30 +0000 (19:32 +0000)]
Also mark compat32 umtx op table as constant.

Sponsored by: The FreeBSD Foundation
MFC after: 1 week

8 years agoUse C99 array initialization, which also makes the code
Konstantin Belousov [Fri, 30 Oct 2015 19:20:40 +0000 (19:20 +0000)]
Use C99 array initialization, which also makes the code
self-documented, and eases addition of new ops.

For the similar reasons, eliminate UMTX_OP_MAX.  nitems() handles the
only use of the symbol.

Sponsored by: The FreeBSD Foundation
MFC after: 1 week

8 years agoDo not FALLTHROUGH for SIOC{ADD,DEL}MULTI
Simon J. Gerraty [Fri, 30 Oct 2015 17:12:15 +0000 (17:12 +0000)]
Do not FALLTHROUGH for SIOC{ADD,DEL}MULTI

ifmedia_ioctl() returns EINVAL

Differential Revision: 3897
Submitted by: aronen@juniper.net
Reviewed by: marcel

8 years agoNot all targets support by clang have a tested or enabled ubsan yet.
Sean Bruno [Fri, 30 Oct 2015 17:05:52 +0000 (17:05 +0000)]
Not all targets support by clang have a tested or enabled ubsan yet.

Only enable h_raw on x86 targets for today so that a buildworld runs to
completion for clang enabled targets that are not x86.  This should be
removed when validation of the sanitizer has occured for all targets
supported by FreeBSD and clang.

8 years agonvd, nvme: report stripesize through GEOM disk layer
Jim Harris [Fri, 30 Oct 2015 16:35:18 +0000 (16:35 +0000)]
nvd, nvme: report stripesize through GEOM disk layer

MFC after: 3 days
Sponsored by: Intel

8 years agonvme: fix race condition in split bio completion path
Jim Harris [Fri, 30 Oct 2015 16:06:34 +0000 (16:06 +0000)]
nvme: fix race condition in split bio completion path

Fixes race condition observed under following circumstances:

1) I/O split on 128KB boundary with Intel NVMe controller.
   Current Intel controllers produce better latency when
   I/Os do not span a 128KB boundary - even if the I/O size
   itself is less than 128KB.
2) Per-CPU I/O queues are enabled.
3) Child I/Os are submitted on different submission queues.
4) Interrupts for child I/O completions occur almost
   simultaneously.
5) ithread for child I/O A increments bio_inbed, then
   immediately is preempted (rendezvous IPI, higher priority
   interrupt).
6) ithread for child I/O B increments bio_inbed, then completes
   parent bio since all children are now completed.
7) parent bio is freed, and immediately reallocated for a VFS
   or gpart bio (including setting bio_children to 1 and
   clearing bio_driver1).
8) ithread for child I/O A resumes processing.  bio_children
   for what it thinks is the parent bio is set to 1, so it
   thinks it needs to complete the parent bio.

Result is either calling a NULL callback function, or double freeing
the bio to its uma zone.

PR: 203746
Reported by: Drew Gallatin <gallatin@netflix.com>,
Marc Goroff <mgoroff@quorum.net>
Tested by: Drew Gallatin <gallatin@netflix.com>
MFC after: 3 days
Sponsored by: Intel

8 years agoAfter r290196, the kernel won't wait for stuff like gmirror nodes
Edward Tomasz Napierala [Fri, 30 Oct 2015 15:52:10 +0000 (15:52 +0000)]
After r290196, the kernel won't wait for stuff like gmirror nodes
if they are not required for mounting rootfs.  However, it's possible
that some setups try to mount them in mountcritlocal (ie from fstab).

Export the list of current root mount holds using a new sysctl,
vfs.root_mount_hold, and make mountcritlocal retry if "mount -a" fails
and the list is not empty.

MFC after: 1 month
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D3709

8 years agoMake root mount wait mechanism smarter, by making it wait only if the root
Edward Tomasz Napierala [Fri, 30 Oct 2015 15:35:04 +0000 (15:35 +0000)]
Make root mount wait mechanism smarter, by making it wait only if the root
device doesn't yet exist.

Reviewed by: kib@, marcel@
MFC after: 1 month
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D3709

8 years agoReduce the DWC OTG interrupt load by not reading all the host channel
Hans Petter Selasky [Fri, 30 Oct 2015 14:50:29 +0000 (14:50 +0000)]
Reduce the DWC OTG interrupt load by not reading all the host channel
status registers for every interrupt. Check a common host channel
status interrupt register first, then conditionally read the
individual host channel status registers.

Submitted by: Sebastian Huber <sebastian.huber@embedded-brains.de>
MFC after: 1 week

8 years agoUse PCB/LR from PCB rather from stack on armv7-gdb
Zbigniew Bodek [Fri, 30 Oct 2015 12:37:40 +0000 (12:37 +0000)]
Use PCB/LR from PCB rather from stack on armv7-gdb

The kernel dump does not store these values on the stack.
Use PCB structure to resolve PC and LR properly.

Submitted by:  Wojciech Macek <wma@semihalf.com>
Reviewed by:   jhb, kib
Obtained from: Semihalf
Sponsored by:  Juniper Networks Inc.
Differential Revision: https://reviews.freebsd.org/D4013

8 years agoWorkaround KGDB issues on ARM by ignoring ARM EABI version higher than 5
Zbigniew Bodek [Fri, 30 Oct 2015 12:21:37 +0000 (12:21 +0000)]
Workaround KGDB issues on ARM by ignoring ARM EABI version higher than 5

To make KGDB working, it needs to understand kernel ELF image.
By default it is compiled using EABI_5, which is not supported
on the gdb-6. As a workaround, treat these images as EABI_2 because
they share a lot of things in common.

This workaround does not guarantee ALL funtionalities
to work.

Submitted by:  Wojciech Macek <wma@semihalf.com>
Reviewed by:   jhb
Obtained from: Semihalf
Sponsored by:  Juniper Networks Inc.
Differential Revision: https://reviews.freebsd.org/D4012

8 years agol2arc: do not call trim_map_free() for blocks with zero b_asize
Andriy Gapon [Fri, 30 Oct 2015 12:00:34 +0000 (12:00 +0000)]
l2arc: do not call trim_map_free() for blocks with zero b_asize

b_asize can be zero if the block is compressed into an empty block
(ZIO_COMPRESS_EMPTY) and the trim code asserts that meaningless
zero-sized trimming is not attempted.
The logic for calling trim_map_free() is extracted into a new function
l2arc_trim() to minimize code duplication.

PR: 203473
Reported by: Willem Jan Withagen <wjw@digiware.nl>
Tested by: Willem Jan Withagen <wjw@digiware.nl>
MFC after: 11 days

8 years agoFix compiler warnings with open_to_operation.c
Enji Cooper [Fri, 30 Oct 2015 10:09:04 +0000 (10:09 +0000)]
Fix compiler warnings with open_to_operation.c

Other sidenotes:
- Remove unused variables with main(..)
- Convert errx/exit with -1 to errx/exit with 1
- Fix a bogus test in try_directory_open
  (expected_errno == expected_errno -> errno == expected_errno) [*]
- Fix some warnings related to discarded qualifiers
- Remove a bogus else-statement at the end of check_mmap_exec(..) in the
  successful case. mmap(2), POSIX, Linux, etc all don't state what the
  behavior is when mixing O_WRONLY + PROT_EXEC, so assume success for now to
  get the test program to pass again.

PR: 201286 [*]
MFC after: 1 week
Submitted by: David Binderman <dcb314@hotmail.com>
Sponsored by: EMC / Isilon Storage Division

8 years agoThe prefix for CLFLUSHOPT is 0x66. It was right on amd64.
Konstantin Belousov [Fri, 30 Oct 2015 09:53:33 +0000 (09:53 +0000)]
The prefix for CLFLUSHOPT is 0x66.  It was right on amd64.

Sponsored by: The FreeBSD Foundation

8 years agoMake truss work for CloudABI processes on aarch64.
Ed Schouten [Fri, 30 Oct 2015 08:11:37 +0000 (08:11 +0000)]
Make truss work for CloudABI processes on aarch64.

This change copies over amd64-cloudabi64.c to aarch64-cloudabi.c and
adjusts it to fetch the proper registers on aarch64. To reduce the
amount of shared code, the errno conversion function is moved into a
separate source file.

Reviewed by: jhb, andrew
Differential Revision: https://reviews.freebsd.org/D4023

8 years agoDisable h_raw/h_read with gcc
Enji Cooper [Fri, 30 Oct 2015 08:06:24 +0000 (08:06 +0000)]
Disable h_raw/h_read with gcc

I forgot that these testcases fail with gcc 4.2.1; add a note to that effect

MFC after: never
Sponsored by: EMC / Isilon Storage Division

8 years agoFix a set but not used variable warning flagged by gcc 4.9 with
Enji Cooper [Fri, 30 Oct 2015 08:01:53 +0000 (08:01 +0000)]
Fix a set but not used variable warning flagged by gcc 4.9 with
lib/libc/ssp/h_readlink

MFC after: 3 days
Sponsored by: EMC / Isilon Storage Division

8 years ago- Re-enable h_raw with clang 3.7.0+
Enji Cooper [Fri, 30 Oct 2015 07:48:03 +0000 (07:48 +0000)]
- Re-enable h_raw with clang 3.7.0+
- Fix the compiler check to allow the test to be compiled for gcc

PR: 196430
MFC after: never
Sponsored by: EMC / Isilon Storage Division

8 years agoFix rtsold's usage message
Enji Cooper [Fri, 30 Oct 2015 07:36:43 +0000 (07:36 +0000)]
Fix rtsold's usage message

- Remove -a from the usage message example dealing with specific
  interfaces. -a only makes sense when not specifying an interface,
  such that it's to be run on all interfaces
- Fix the pidfile option (it's -p, not -P)
- Change `interfaces` to `interface` to match the manpage

MFC after: 3 days
PR: 173744
Sponsored by: EMC / Isilon Storage Division

8 years agoUnbreak bsd.progs.mk with PROGS (but not PROGS_CXX) and when invoking the
Enji Cooper [Fri, 30 Oct 2015 06:07:41 +0000 (06:07 +0000)]
Unbreak bsd.progs.mk with PROGS (but not PROGS_CXX) and when invoking the
"one of many" targets, e.g. `make hello_world`, where hello_world is a C
program

Tested with: PROGS and PROGS_CXX
MFC after: 1 week
X-MFC with: r289289
Sponsored by: EMC / Isilon Storage Division

8 years agoFollow up to roundup feature addition in r289203
Enji Cooper [Fri, 30 Oct 2015 05:55:56 +0000 (05:55 +0000)]
Follow up to roundup feature addition in r289203

- Rename -r to -R to avoid the clash with makefs -r in NetBSD
- Note that -R is an FFS-specific option because it's not implemented
  in cd9660 today
- Rename the roundup variable to "roundup-size" in the manpage and help
  text for consistency with other variables.
- Bump .Dd (missed in r289203)

PR: 203707
MFC after: 1 week
X-MFC with: r289203
Differential Revision: https://reviews.freebsd.org/D3959
Reviewed by: adrian (earlier patch), emaste
Sponsored by: EMC / Isilon Storage Division

8 years agoRemove a set but unused variable in __getgroupmembership to fix a gcc 4.9+ warning
Enji Cooper [Fri, 30 Oct 2015 05:50:05 +0000 (05:50 +0000)]
Remove a set but unused variable in __getgroupmembership to fix a gcc 4.9+ warning

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

8 years agoFix GOST engine cipher linkage by adding e_gost_err.c to SRCS so it
Enji Cooper [Fri, 30 Oct 2015 05:33:38 +0000 (05:33 +0000)]
Fix GOST engine cipher linkage by adding e_gost_err.c to SRCS so it
picks up undefined symbols, like "ERR_load_GOST_strings"

MFC after: 3 days
PR: 184805
Submitted by: Ivan IvanZhdanov <ivan.zhdanov@gmail.com>
Sponsored by: EMC / Isilon Storage Division

8 years agoIntegrate contrib/netbsd-tests/lib/libc/rpc into the FreeBSD test suite
Enji Cooper [Fri, 30 Oct 2015 03:28:00 +0000 (03:28 +0000)]
Integrate contrib/netbsd-tests/lib/libc/rpc into the FreeBSD test suite
as lib/libc/rpc

This testcase requires rpcbind be up in running; otherwise the testcases
will time out and be skipped

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

8 years agoFix BULK read transfer if destination buffer is not cache line-aligned.
Oleksandr Tymoshenko [Fri, 30 Oct 2015 01:19:04 +0000 (01:19 +0000)]
Fix BULK read transfer if destination buffer is not cache line-aligned.

We can't use copyout because destination memory is userland address
in another process but we have reference to respective page so map
the page into kernel address space and copy fragments there

8 years agocxgbe/tom: decide whether to shove segments or not only if there is
Navdeep Parhar [Fri, 30 Oct 2015 01:18:07 +0000 (01:18 +0000)]
cxgbe/tom: decide whether to shove segments or not only if there is
payload to transmit.

MFC after: 1 week

8 years agoIn pw_userlock, set 'name' to NULL when we encounter an all number string
Xin LI [Fri, 30 Oct 2015 00:46:52 +0000 (00:46 +0000)]
In pw_userlock, set 'name' to NULL when we encounter an all number string
because it is also used as an indicator of whether a name or an UID is
being used and we may have undefined results as 'name' may contain
uninitialized stack contents.

MFC after: 2 weeks

8 years agoUse strlcpy().
Xin LI [Fri, 30 Oct 2015 00:33:03 +0000 (00:33 +0000)]
Use strlcpy().

MFC after: 2 weeks

8 years agoFix framebuffer compatibility with new RPi firmware. Framebuffer driver
Oleksandr Tymoshenko [Fri, 30 Oct 2015 00:24:37 +0000 (00:24 +0000)]
Fix framebuffer compatibility with new RPi firmware. Framebuffer driver
receives video memory address from VideoCore through property mailbox
channel. Older versions of firmware (and the one that is currently part
of sysutils/u-boot-rpi and sysutils/u-boot-rpi2) returned real physical
address, newer one returns VideoCore bus address, so we need to convert
it to actual physical address. this version works with both older and
newer interface.

8 years agoRemove unneeded NULL as this is initialized with M_ZERO.
Bryan Drewery [Thu, 29 Oct 2015 23:56:34 +0000 (23:56 +0000)]
Remove unneeded NULL as this is initialized with M_ZERO.

MFC after: 2 weeks
Sponsored by: EMC / Isilon Storage Division

8 years agoUse memmove(3) to avoid overlapping copy.
Bryan Drewery [Thu, 29 Oct 2015 23:06:33 +0000 (23:06 +0000)]
Use memmove(3) to avoid overlapping copy.

Reported by: valgrind
MFC after: 2 weeks
X-MFC-With: r290168

8 years agoFix several memory leaks, and crashes, in iconvlist(3).
Bryan Drewery [Thu, 29 Oct 2015 23:02:34 +0000 (23:02 +0000)]
Fix several memory leaks, and crashes, in iconvlist(3).

- Both curitem and curitem (via the names list) was always leaked.
- malloc(3) failures lead to some leaks.
- __bsd___iconv_get_list() failure lead to a crash since its error was not
  handles and __bsd___iconv_free_list() is not NULL-safe.

I have slightly refactored this to avoid extra malloc and free logic in cases
of malloc(3) failing.

There are still bad assumptions here that I did not deal with.  One of which is
that the data will always have a '/' so the strchr(3) will not return NULL.

Coverity CID: 1130055 1130054 1130053

8 years agoFix LEAVE_HYP macro: spsr is not guaranteed to contain valid value at this
Oleksandr Tymoshenko [Thu, 29 Oct 2015 22:12:03 +0000 (22:12 +0000)]
Fix LEAVE_HYP macro: spsr is not guaranteed to contain valid value at this
point, e.g. on RaspberryPi 2 when control is passed from loader to kernel
it contains garbage. So we use cpsr as a base for new cpsr value: if we
have reached this point it means current value is OK

Reviewed by: andrew

8 years agoInstall myself as src committer.
Svatopluk Kraus [Thu, 29 Oct 2015 21:40:32 +0000 (21:40 +0000)]
Install myself as src committer.

Approved by: kib (mentor)

8 years agoSet the proper direction to check for policies in this one case.
George V. Neville-Neil [Thu, 29 Oct 2015 21:26:32 +0000 (21:26 +0000)]
Set the proper direction to check for policies in this one case.

Pointed out by: eri
Sponsored by: Rubicon Communications (Netgate)

8 years agoUse movw instead of movl (or plain mov) when moving segment registers
John Baldwin [Thu, 29 Oct 2015 21:25:46 +0000 (21:25 +0000)]
Use movw instead of movl (or plain mov) when moving segment registers
into memory.  This is a nop on clang's assembler, but some assemblers
complain if the size suffix is incorrect.

Submitted by: bde

8 years agoIgnore per-mdN settings in mdconfig[2] startup
Devin Teske [Thu, 29 Oct 2015 21:12:57 +0000 (21:12 +0000)]
Ignore per-mdN settings in mdconfig[2] startup

PR: base/189696
Submitted by: ganael.laplanche@martymac.org
MFC after: 3 days
X-MFC-to: stable/10 stable/9

8 years agoAdd myself (jtl) and my mentor to the committers-src.dot file.
Jonathan T. Looney [Thu, 29 Oct 2015 21:00:11 +0000 (21:00 +0000)]
Add myself (jtl) and my mentor to the committers-src.dot file.

Approved by: gnn (mentor)
Differential Revision: https://reviews.freebsd.org/D4029

8 years agopf: Fix IPv6 checksums with route-to.
Kristof Provost [Thu, 29 Oct 2015 20:45:53 +0000 (20:45 +0000)]
pf: Fix IPv6 checksums with route-to.

When using route-to (or reply-to) pf sends the packet directly to the output
interface. If that interface doesn't support checksum offloading the checksum
has to be calculated in software.
That was already done in the IPv4 case, but not for the IPv6 case. As a result
we'd emit packets with pseudo-header checksums (i.e. incorrect checksums).

This issue was exposed by the changes in r289316 when pf stopped performing full
checksum calculations for all packets.

Submitted by: Luoqi Chen
MFC after: 1 week

8 years agoRemove some unneeded code.
Alexander Motin [Thu, 29 Oct 2015 20:43:13 +0000 (20:43 +0000)]
Remove some unneeded code.

8 years agoRemove reset delays for which I see neither explanation nor need.
Alexander Motin [Thu, 29 Oct 2015 20:34:01 +0000 (20:34 +0000)]
Remove reset delays for which I see neither explanation nor need.

8 years agontb: Revert r290130 now that r290156 has landed
Conrad Meyer [Thu, 29 Oct 2015 19:35:01 +0000 (19:35 +0000)]
ntb: Revert r290130 now that r290156 has landed

Nagged by: vangyzen
Sponsored by: EMC / Isilon Storage Division

8 years agoCheck archive_entry_new() result.
Bryan Drewery [Thu, 29 Oct 2015 19:28:21 +0000 (19:28 +0000)]
Check archive_entry_new() result.

Coverity CID: 1331341

8 years agopmap_change_attr: Only fixup DMAP for DMAPed ranges
Conrad Meyer [Thu, 29 Oct 2015 19:07:00 +0000 (19:07 +0000)]
pmap_change_attr: Only fixup DMAP for DMAPed ranges

pmap_change_attr must change the memory type of both the requested KVA
and the corresponding DMAP mappings (if such mappings exist), to satisfy
an Intel requirement that two or more mappings to the same physical
pages must have the same memory type.

However, not all kernel mapped pages have corresponding DMAP mappings --
for example, 64-bit BARs.  Skip fixing up the DMAP for out-of-bounds
addresses.

Submitted by: Steve Wahl <steve_wahl@dell.com>
Reviewed by: alc, jhb
Sponsored by: Dell Compellent
Differential Revision: https://reviews.freebsd.org/D4030

8 years agogetnewbuf: Initialize bp to avoid uninitialized pointer dereference and brelse().
Bryan Drewery [Thu, 29 Oct 2015 19:02:24 +0000 (19:02 +0000)]
getnewbuf: Initialize bp to avoid uninitialized pointer dereference and brelse().

This came in recently in r289279.

Coverity CID: 1331561

8 years agoAvoid passing an uninitialized 'i'. Currently nothing was depending on it
Bryan Drewery [Thu, 29 Oct 2015 18:58:18 +0000 (18:58 +0000)]
Avoid passing an uninitialized 'i'.  Currently nothing was depending on it
anyhow.

Coverity CID: 1331562

8 years agoFix unlikely memory leak.
Bryan Drewery [Thu, 29 Oct 2015 18:29:28 +0000 (18:29 +0000)]
Fix unlikely memory leak.

It is unlikely since the first check in the function is that dir[0] is '/',
but later code changes may make it real.

Coverity CID: 1332104

8 years agoPC Card and Cardbus are now in extended maintenance mode. No need to
Warner Losh [Thu, 29 Oct 2015 16:50:28 +0000 (16:50 +0000)]
PC Card and Cardbus are now in extended maintenance mode. No need to
have them cluttering up MAINTAINERS.

8 years agoFix and improve error masking and reporting.
Alexander Motin [Thu, 29 Oct 2015 16:48:12 +0000 (16:48 +0000)]
Fix and improve error masking and reporting.

8 years agoUpdate for LINUX32 rename. The assembler didn't complain about undefined
John Baldwin [Thu, 29 Oct 2015 15:20:47 +0000 (15:20 +0000)]
Update for LINUX32 rename.  The assembler didn't complain about undefined
symbols but just used 0 after the rename.