]> CyberLeo.Net >> Repos - FreeBSD/stable/10.git/log
FreeBSD/stable/10.git
7 years agoMFC r304162
asomers [Mon, 12 Sep 2016 16:55:16 +0000 (16:55 +0000)]
MFC r304162

Decrease the anti-congestion sleep in 480.leapfile-ntpd to 1 hour

24 hours is too long. Periodic scripts are executed serially, so when
combined with the sleep in 410.pkg-audit periodic could actually take more
than 24 hours and block the next invocation.

git-svn-id: svn://svn.freebsd.org/base/stable/10@305746 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r305421:
hselasky [Mon, 12 Sep 2016 10:17:25 +0000 (10:17 +0000)]
MFC r305421:
Resolve deadlock between device_detach() and usbd_do_request_flags()
by reviving the SX control request lock and refining which lock
protects the common scratch area in "struct usb_device".

The SX control request lock was removed by r246759 because it caused a
lock order reversal with the USB enumeration lock inside
usbd_transfer_setup() as a function of r246616. It was thought that
reducing the number of locks would resolve the LOR, but because some
USB device drivers use usbd_do_request_flags() inside callback
functions, like in taskqueues, a deadlock may occur when these are
drained from device_detach(). By restoring the SX control request
lock usbd_do_request_flags() is allowed to complete its execution
when a USB device driver is detaching. By using the SX control request
lock to protect the scratch area, the LOR introduced by r246616 is
also resolved.

Bump the FreeBSD version while at it to force recompilation of all USB
kernel modules.

Found by: avos@

git-svn-id: svn://svn.freebsd.org/base/stable/10@305734 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC 305177
sephe [Mon, 12 Sep 2016 08:32:06 +0000 (08:32 +0000)]
MFC 305177
    net/vlan: Shift for pri is 13 (pri mask 0xe000) not 1.

    Reviewed by:    araujo, hps
    Sponsored by:   Microsoft
    Differential Revision:  https://reviews.freebsd.org/D7710

git-svn-id: svn://svn.freebsd.org/base/stable/10@305732 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r305430:
dim [Sun, 11 Sep 2016 14:19:06 +0000 (14:19 +0000)]
MFC r305430:

Define libcpp's HAVE_DESIGNATED_INITIALIZERS in a defined and portable
way.

git-svn-id: svn://svn.freebsd.org/base/stable/10@305693 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC 303720: Apply the fix from r232612 to fixed function counters.
jhb [Fri, 9 Sep 2016 21:19:31 +0000 (21:19 +0000)]
MFC 303720: Apply the fix from r232612 to fixed function counters.

git-svn-id: svn://svn.freebsd.org/base/stable/10@305675 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC 303713: Correct assertion on vcpuid argument to vm_gpa_hold().
jhb [Fri, 9 Sep 2016 20:30:36 +0000 (20:30 +0000)]
MFC 303713: Correct assertion on vcpuid argument to vm_gpa_hold().

PR: 208168

git-svn-id: svn://svn.freebsd.org/base/stable/10@305673 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC 304637: Fix build for !SMP kernels after the Xen MSIX workaround.
jhb [Fri, 9 Sep 2016 19:57:32 +0000 (19:57 +0000)]
MFC 304637: Fix build for !SMP kernels after the Xen MSIX workaround.

Move msix_disable_migration under #ifdef SMP since it doesn't make sense
for !SMP kernels.

PR: 212014

git-svn-id: svn://svn.freebsd.org/base/stable/10@305672 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r305469:
delphij [Fri, 9 Sep 2016 06:59:49 +0000 (06:59 +0000)]
MFC r305469:

Ensure that we always open only files that is named by explicitly
using shell redirections instead of having gzip(1) to decide what
file to open.

Issue reported in the "non-cryptanalytic attacks against freebsd
update components" anonymous gist.

Reviewed by: allanjude, emaste

git-svn-id: svn://svn.freebsd.org/base/stable/10@305649 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r304571:
hselasky [Fri, 9 Sep 2016 06:38:13 +0000 (06:38 +0000)]
MFC r304571:
Make the UKBD USB transfers double buffered and set them up one by one,
so they are memory independent which allows for handling panics
triggered by the keyboard driver itself, typically via CTRL+ALT+ESC
sequences. Or if the USB keyboard driver was processing a key at the
moment of panic. Allow UKBD to be attached while keyboard polling is active.

git-svn-id: svn://svn.freebsd.org/base/stable/10@305645 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r305284:
hselasky [Fri, 9 Sep 2016 06:27:25 +0000 (06:27 +0000)]
MFC r305284:
Fix array size issue when using the pre-scaling feature for
ISOCHRONOUS USB transfers. Make sure enough length and buffer pointers
are allocated when setting up the libusb transfer structure to support
the maximum number of frames the kernel can handle.

git-svn-id: svn://svn.freebsd.org/base/stable/10@305641 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r303893, r303894:
pfg [Thu, 8 Sep 2016 15:27:42 +0000 (15:27 +0000)]
MFC r303893, r303894:
misc replacements of comma with semicolon when pertinent.

Uses of commas instead of a semicolons can easily go undetected. The comma
can serve as a statement separator but this shouldn't be abused when
statements are meant to be standalone.

git-svn-id: svn://svn.freebsd.org/base/stable/10@305619 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r303889:
pfg [Thu, 8 Sep 2016 15:12:55 +0000 (15:12 +0000)]
MFC r303889:
libc/rpc: replace comma with semicolon when pertinent.

Uses of commas instead of a semicolons can easily go undetected. The comma
can serve as a statement separator but this shouldn't be abused when
statements are meant to be standalone.

git-svn-id: svn://svn.freebsd.org/base/stable/10@305617 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r303891, r303892:
pfg [Thu, 8 Sep 2016 15:06:28 +0000 (15:06 +0000)]
MFC r303891, r303892:
sys: replace comma with semicolon when pertinent.

Uses of commas instead of a semicolons can easily go undetected. The comma
can serve as a statement separator but this shouldn't be abused when
statements are meant to be standalone.

git-svn-id: svn://svn.freebsd.org/base/stable/10@305615 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r281499:
hselasky [Thu, 8 Sep 2016 09:50:03 +0000 (09:50 +0000)]
MFC r281499:
Modify the return value of the uhci/ehci/xhci PCI probe routines to
'BUS_PROBE_DEFAULT'. This allows bhyve's 'ppt' driver to claim ownership
of the device and pass it through to the guest.

In the common case where there are no competing drivers for USB controllers
this change is a no-op.

PR: 212256

git-svn-id: svn://svn.freebsd.org/base/stable/10@305589 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r305413
ache [Thu, 8 Sep 2016 07:14:48 +0000 (07:14 +0000)]
MFC r305413

Fix error handling.

git-svn-id: svn://svn.freebsd.org/base/stable/10@305583 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r305406,r305409,r305412
ache [Thu, 8 Sep 2016 05:13:50 +0000 (05:13 +0000)]
MFC r305406,r305409,r305412

1) Fix errors handling.

2) Prevent out of bounds access to ws[-1] (passed buffer) which happens
when the first mb sequence is incomplete and there are not enougn chars in
the read buffer. ws[-1] may lead to memory faults or false results, in
case the memory here contains '\n'.

3) Fix n == 1 case. Here should be no physical read (fill buffer) attempt
(we read n - 1 chars with the room for NUL, see fgets()),
and no NULL return.

git-svn-id: svn://svn.freebsd.org/base/stable/10@305577 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r305154: directory(3): Deprecate readdir_r(). Clarify dirent buffers.
jilles [Wed, 7 Sep 2016 21:09:44 +0000 (21:09 +0000)]
MFC r305154: directory(3): Deprecate readdir_r(). Clarify dirent buffers.

In existing implementations including FreeBSD, there is no reason to use
readdir_r() in the common case where potentially multiple threads each list
their own directory. Code using readdir() is simpler.

What's more, although readdir_r() can safely be used on FreeBSD because
NAME_MAX is forced to 255, it cannot be used safely on systems where
{NAME_MAX} is not fixed. As a concrete example, FAT/NTFS filenames can be up
to 255 UTF-16 code units long, which can be up to 765 UTF-8 bytes.

Deprecating readdir_r() in POSIX has been proposed in
http://www.austingroupbugs.net/view.php?id=696
and glibc wants to deprecate it as well.

git-svn-id: svn://svn.freebsd.org/base/stable/10@305569 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r305090: getvfsbyname(3): Remove [EFAULT] error.
jilles [Wed, 7 Sep 2016 21:04:39 +0000 (21:04 +0000)]
MFC r305090: getvfsbyname(3): Remove [EFAULT] error.

Since r101651 in 2002, getvfsbyname() has written *vfc using userland
memcpy(), so the [EFAULT] error no longer occurs.

git-svn-id: svn://svn.freebsd.org/base/stable/10@305568 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r305389:
dim [Wed, 7 Sep 2016 19:25:08 +0000 (19:25 +0000)]
MFC r305389:

With clang 3.9.0, compiling sys/netinet/igmp.c results in the following
warning:

sys/netinet/igmp.c:546:21: error: implicit conversion from 'int' to 'char' changes value from 148 to -108 [-Werror,-Wconstant-conversion]
        p->ipopt_list[0] = IPOPT_RA;    /* Router Alert Option */
                         ~ ^~~~~~~~
sys/netinet/ip.h:153:19: note: expanded from macro 'IPOPT_RA'
#define IPOPT_RA                148             /* router alert */
                                ^~~

This is because ipopt_list is an array of char, so IPOPT_RA is wrapped
to a negative value.  It would be nice to change ipopt_list to an array
of u_char, but it changes the signature of the public struct ipoption,
so add an explicit cast to suppress the warning.

Reviewed by: imp
Differential Revision: https://reviews.freebsd.org/D7777

git-svn-id: svn://svn.freebsd.org/base/stable/10@305558 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r305388:
dim [Wed, 7 Sep 2016 19:21:52 +0000 (19:21 +0000)]
MFC r305388:

With clang 3.9.0, compiling uplcom results in the following warnings:

sys/dev/usb/serial/uplcom.c:543:29: error: implicit conversion from 'int' to 'int8_t' (aka 'signed char') changes value from 192 to -64 [-Werror,-Wconstant-conversion]
        if (uplcom_pl2303_do(udev, UT_READ_VENDOR_DEVICE, UPLCOM_SET_REQUEST, 0x8484, 0, 1)
            ~~~~~~~~~~~~~~~~       ^~~~~~~~~~~~~~~~~~~~~
sys/dev/usb/usb.h:179:53: note: expanded from macro 'UT_READ_VENDOR_DEVICE'
#define UT_READ_VENDOR_DEVICE   (UT_READ  | UT_VENDOR | UT_DEVICE)
                                 ~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~

This is because UT_READ is 0x80, so the int8_t argument is wrapped to a
negative value.  Fix this by using uint8_t instead.

Reviewed by: imp, hselasky
Differential Revision: https://reviews.freebsd.org/D7776

git-svn-id: svn://svn.freebsd.org/base/stable/10@305557 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r305360:
dim [Wed, 7 Sep 2016 19:17:03 +0000 (19:17 +0000)]
MFC r305360:

With clang 3.9.0, compiling cxgb results in the following warning:

sys/dev/cxgb/cxgb_sge.c:2873:44: error: implicit conversion from 'int'
to 'char' changes value from 128 to -128 [-Werror,-Wconstant-conversion]
                        *mtod(m, char *) = CPL_ASYNC_NOTIF;
                                         ~ ^~~~~~~~~~~~~~~

This is because CPL_ASYNC_NOTIF is 0x80, so the plain char argument is
wrapped to a negative value.  Fix this by using uint8_t instead.

Reviewed by: np
Differential Revision: https://reviews.freebsd.org/D7772

git-svn-id: svn://svn.freebsd.org/base/stable/10@305556 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r305345:
dim [Wed, 7 Sep 2016 19:02:47 +0000 (19:02 +0000)]
MFC r305345:

With clang 3.9.0, compiling ppbus(4) results in the following warnings:

sys/dev/ppbus/ppb_1284.c:296:46: error: implicit conversion from 'int'
to 'char' changes value from 144 to -112 [-Werror,-Wconstant-conversion]
if ((error = do_peripheral_wait(bus, SELECT | nBUSY, 0))) {
     ~~~~~~~~~~~~~~~~~~      ~~~~~~~^~~~~~~
sys/dev/ppbus/ppb_1284.c:785:48: error: implicit conversion from 'int'
to 'char' changes value from 240 to -16 [-Werror,-Wconstant-conversion]
if (do_1284_wait(bus, nACK | SELECT | PERROR | nBUSY,
    ~~~~~~~~~~~~      ~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~
sys/dev/ppbus/ppb_1284.c:786:29: error: implicit conversion from 'int'
to 'char' changes value from 240 to -16 [-Werror,-Wconstant-conversion]
nACK | SELECT | PERROR | nBUSY)) {
~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~

This is because nBUSY is 0x80, so the plain char argument is wrapped to
a negative value.  Fix this in a minimal fashion, by using uint8_t in a
few places.

Reviewed by: emaste
Differential Revision: https://reviews.freebsd.org/D7771

git-svn-id: svn://svn.freebsd.org/base/stable/10@305555 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r305344:
dim [Wed, 7 Sep 2016 18:53:46 +0000 (18:53 +0000)]
MFC r305344:

Define drmP.h's __OS_HAS_AGP and __OS_HAS_MTRR macros in a defined and
portable way.

Reviewed by: dumbbell
Differential Revision: https://reviews.freebsd.org/D7770

git-svn-id: svn://svn.freebsd.org/base/stable/10@305554 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r305085:
dim [Wed, 7 Sep 2016 18:33:18 +0000 (18:33 +0000)]
MFC r305085:

Fix warnings in tnftp about invalid constant conversions, e.g.:

contrib/tnftp/src/ftp.c:2067:11: error: implicit conversion from 'int'
to 'char' changes value from 255 to -1 [-Werror,-Wconstant-conversion]
        buf[0] = IAC;
               ~ ^~~
/usr/include/arpa/telnet.h:39:13: note: expanded from macro 'IAC'
#define IAC     255             /* interpret as command: */
                ^~~
contrib/tnftp/src/ftp.c:2068:11: error: implicit conversion from 'int'
to 'char' changes value from 244 to -12 [-Werror,-Wconstant-conversion]
        buf[1] = IP;
               ~ ^~
/usr/include/arpa/telnet.h:50:12: note: expanded from macro 'IP'
#define IP      244             /* interrupt process--permanently */
                ^~~

Use an unsigned char buffer instead.

git-svn-id: svn://svn.freebsd.org/base/stable/10@305553 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r305077:
dim [Wed, 7 Sep 2016 18:22:08 +0000 (18:22 +0000)]
MFC r305077:

Squelch clang 3.9.0 warnings about BASE (which is 32768) being converted
to -32768 when it is used as an argument to mp_itom(), in both libtelnet
and newkey.  This code has been wrong since r26238 (!), so after almost
20 years it is rather useless to try to correct it.

MFC r305086:

Fix warnings in telnet about invalid constant conversions, e.g.:

contrib/telnet/telnet/commands.c:2914:13: error: implicit conversion
from 'int' to 'char' changes value from 137 to -119
[-Werror,-Wconstant-conversion]
*lsrp++ = IPOPT_SSRR;
~ ^~~~~~~~~~
/usr/include/netinet/ip.h:152:21: note: expanded from macro 'IPOPT_SSRR'
#define IPOPT_SSRR              137             /* strict source route */
^~~
contrib/telnet/telnet/commands.c:2916:13: error: implicit conversion
from 'int' to 'char' changes value from 131 to -125
[-Werror,-Wconstant-conversion]
*lsrp++ = IPOPT_LSRR;
~ ^~~~~~~~~~
/usr/include/netinet/ip.h:148:21: note: expanded from macro 'IPOPT_LSRR'
#define IPOPT_LSRR              131             /* loose source route */
^~~

Use unsigned char buffers instead.

git-svn-id: svn://svn.freebsd.org/base/stable/10@305552 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoRegen after r305518: Allow getdtablesize in capability mode
emaste [Wed, 7 Sep 2016 04:07:43 +0000 (04:07 +0000)]
Regen after r305518: Allow getdtablesize in capability mode

git-svn-id: svn://svn.freebsd.org/base/stable/10@305519 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r305140: Allow getdtablesize in capability mode
emaste [Wed, 7 Sep 2016 04:06:25 +0000 (04:06 +0000)]
MFC r305140: Allow getdtablesize in capability mode

git-svn-id: svn://svn.freebsd.org/base/stable/10@305518 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r303799, r303800:
pfg [Tue, 6 Sep 2016 19:53:05 +0000 (19:53 +0000)]
MFC r303799, r303800:
ext2fs: Add defines for some missing ext4 features and inode flags.

These are currently unused in our implementation and some even appear to
have not been implemented yet on linux but it is good to keep them for
reference.

Obtained from: NetBSD

git-svn-id: svn://svn.freebsd.org/base/stable/10@305494 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC 304249
davidcs [Tue, 6 Sep 2016 19:29:14 +0000 (19:29 +0000)]
MFC 304249
    Add support for set/get cam search mode

git-svn-id: svn://svn.freebsd.org/base/stable/10@305491 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r394247
davidcs [Tue, 6 Sep 2016 19:27:00 +0000 (19:27 +0000)]
MFC r394247
    Upgrade fw, bootloader and minidump template to version 5.4.58
    Add minidump retrieval code

MFC r394248
    Add ql_minidump.h

git-svn-id: svn://svn.freebsd.org/base/stable/10@305490 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r304674: intpm: add support for SB800
avg [Tue, 6 Sep 2016 06:25:10 +0000 (06:25 +0000)]
MFC r304674: intpm: add support for SB800

git-svn-id: svn://svn.freebsd.org/base/stable/10@305463 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r304520: fix bug introduced in r297521, set canmount=on doesn't
avg [Tue, 6 Sep 2016 06:17:39 +0000 (06:17 +0000)]
MFC r304520: fix bug introduced in r297521, set canmount=on doesn't
mount filesystem

git-svn-id: svn://svn.freebsd.org/base/stable/10@305461 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r303738: report sector size and number of sectors in lsdev output
avg [Tue, 6 Sep 2016 06:13:47 +0000 (06:13 +0000)]
MFC r303738: report sector size and number of sectors in lsdev output
for bios disks

git-svn-id: svn://svn.freebsd.org/base/stable/10@305458 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r305365
ache [Tue, 6 Sep 2016 00:32:33 +0000 (00:32 +0000)]
MFC r305365

The bug:
$ echo x | awk '/[[:cntrl:]]/'
x

The NUL character in cntrl class truncates the pattern, and an empty
pattern matches anything. The patch skips NUL as a quick fix.

PR:     195792
Submitted by:   kdrakehp@zoho.com
Approved by:    bwk@cs.princeton.edu (the author)

git-svn-id: svn://svn.freebsd.org/base/stable/10@305447 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r305269: cron: use existing maximum username constant MAXLOGNAME
emaste [Mon, 5 Sep 2016 15:50:40 +0000 (15:50 +0000)]
MFC r305269: cron: use existing maximum username constant MAXLOGNAME

Previously cron had its own maximum username length limit, which was
smaller than the system's MAXLOGNAME. This could lead to crontab -u
updating the wrong user's crontab (if the name was truncated, and
matched another user).

PR: 212305
Reported by: Andrii Kuzik

git-svn-id: svn://svn.freebsd.org/base/stable/10@305424 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r305241
ache [Mon, 5 Sep 2016 01:57:32 +0000 (01:57 +0000)]
MFC r305241

fgetwc(3) may set both __SEOF and __SERR at once (in case of incomplete
sequence near EOF), so we can't just check for
(wc == WEOF && !__sfeof(fp)) and must relay on __sferror(fp) with
__SERR clearing/restoring.

git-svn-id: svn://svn.freebsd.org/base/stable/10@305403 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r305144
ache [Mon, 5 Sep 2016 00:36:52 +0000 (00:36 +0000)]
MFC r305144

'addrlen' does not matter when we need to find the first non-zero bit in
the byte from the left and 'addrlen' already counted in 'lim'.

PR:     212121
Submitted by:   Herbie.Robinson@stratus.com

git-svn-id: svn://svn.freebsd.org/base/stable/10@305401 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r305219
ache [Sun, 4 Sep 2016 00:34:15 +0000 (00:34 +0000)]
MFC r305219

If error happens, don't overwrite original errno comes from __mbrtowc()
and __srefill().

git-svn-id: svn://svn.freebsd.org/base/stable/10@305369 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r304928:
kib [Sat, 3 Sep 2016 11:09:47 +0000 (11:09 +0000)]
MFC r304928:
Do not obliterate errno value in the main thread during ptrace(2) call on x86.

MFC r304931:
Follow ABI when calling __error from the ptrace(2) wrapper.

MFC r305012:
Rewrite ptrace(2) wrappers in C.

MFC r305022:
Restore the requirement of setting errno to zero before calling ptrace(2).

git-svn-id: svn://svn.freebsd.org/base/stable/10@305341 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r305133
ache [Sat, 3 Sep 2016 01:08:52 +0000 (01:08 +0000)]
MFC r305133

Apply the same qsort() usage fix as in r304911 getaddrinfo.c
qsort() can't be stabilized with just return(-1) alone.

git-svn-id: svn://svn.freebsd.org/base/stable/10@305316 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r305023:
dim [Fri, 2 Sep 2016 17:24:16 +0000 (17:24 +0000)]
MFC r305023:

Avoid undefined behavior when calling va_start() in bnep_send_control(),
by making the 'type' parameter a plain unsigned.

git-svn-id: svn://svn.freebsd.org/base/stable/10@305287 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFstable/11 r304951:
ngie [Fri, 2 Sep 2016 04:27:02 +0000 (04:27 +0000)]
MFstable/11 r304951:

MFC r303804:

Fix building usr.bin/tar/tests with PIE symbol building enabled by
removing CFLAGS+= -static

`CFLAGS+= -static` was a carryover from pre-r289195 with
usr.bin/tar/test/Makefile that should have been specified in LDFLAGS
There doesn't seem to be an apparent need for static compilation
of the test binaries.

Obtained-from: opBSD (418a491eed20d2603ddd1f1bd92c2c0d95094002)

git-svn-id: svn://svn.freebsd.org/base/stable/10@305275 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r286321:
ngie [Fri, 2 Sep 2016 04:23:26 +0000 (04:23 +0000)]
MFC r286321:
r286321 (by lwhsu):

Fix `make depend` in sys/modules

git-svn-id: svn://svn.freebsd.org/base/stable/10@305274 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFstable/11 r305271:
ngie [Fri, 2 Sep 2016 04:21:40 +0000 (04:21 +0000)]
MFstable/11 r305271:

MFC r303576:

Conditionalize code which defines sysctls per _KERNEL #ifdef guard

This resolves several issues when compiling libzpool (userspace library), i.e.
-Wimplicit-function-declaration and -Wmissing-declarations issues.

Tested with: clang 3.8.1, gcc 4.2.1, gcc 5.3.0

git-svn-id: svn://svn.freebsd.org/base/stable/10@305273 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFstable/11 r304950:
ngie [Fri, 2 Sep 2016 04:12:36 +0000 (04:12 +0000)]
MFstable/11 r304950:

MFC r304033:

Increase timeout from 10 minutes to 20 minutes for all tests

On particular slow networks, it can (on average) take longer to
resolve hosts to IP* addresses. 20 minutes seemed reasonable for
my work network

This will be solved in a more meaningful way (if possible) using
concurrency in the near future

git-svn-id: svn://svn.freebsd.org/base/stable/10@305272 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r285522:
markj [Fri, 2 Sep 2016 00:14:28 +0000 (00:14 +0000)]
MFC r285522:
Fix cleanup race between unp_dispose and unp_gc.

This change modifies the original commit to avoid changing the
domain_dispose KPI.

Tested by: Oliver Pinter

git-svn-id: svn://svn.freebsd.org/base/stable/10@305261 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFstable/11 r305225:
ngie [Thu, 1 Sep 2016 19:31:47 +0000 (19:31 +0000)]
MFstable/11 r305225:

MFC r303573:

Cast result from third parameter to int instead of promoting it to size_t

This resolves a -Wformat issue when the value is used as a format width
precision specifier, i.e. %*s

git-svn-id: svn://svn.freebsd.org/base/stable/10@305233 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFstable/11 r304949,r305226:
ngie [Thu, 1 Sep 2016 19:10:42 +0000 (19:10 +0000)]
MFstable/11 r304949,r305226:

r304949:

MFC r303830,r304693,r304694,r304698:

r303830:

Remove vestigal references to __alpha__

Replace alpha reference in getconf(1) with amd64 [*]

PR:   211300 [*]

r304693:

Clean up trailing whitespace

r304694:

Add `MIN_HOLE_SIZE` pathconf(2) support to getconf

This allows shell programs to programmatically determine whether
or not a filesystem supports sparse files

r304698:

Add support for _PC_ACL_NFS4 as TRUSTEDBSD_ACL_NFS4

The TRUSTEDBSD prefix was chosen for consistency with the other
related `_PC_ACL*` prefixed variables.

r305226:

MFC r304809:

Add non-TRUSTEDBSD prefixed knobs for the _PC_ACL* and {CAP,INF,MAC}_PRESENT knobs

It's not necessarily intuitive that the variables to query contain TRUSTEDBSD
in the prefix. Add non-TRUSTEDBSD prefixed knobs for querying things like
"_PC_ACL_NFS4".

Relnotes: yes

git-svn-id: svn://svn.freebsd.org/base/stable/10@305229 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFstable/11 r304947:
ngie [Thu, 1 Sep 2016 19:08:07 +0000 (19:08 +0000)]
MFstable/11 r304947:

MFC r304238:

Only expect :encode_tv_random_million to fail on 64-bit platforms

It passes on i386

git-svn-id: svn://svn.freebsd.org/base/stable/10@305228 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r304040:
ngie [Thu, 1 Sep 2016 19:05:23 +0000 (19:05 +0000)]
MFC r304040:

Redirect the output of the testcases to stderr instead of
redirecting it to /dev/null

This will aid in debugging failures

git-svn-id: svn://svn.freebsd.org/base/stable/10@305227 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r304075,r304989:
mm [Thu, 1 Sep 2016 12:01:23 +0000 (12:01 +0000)]
MFC r304075,r304989:
Sync libarchive with vendor including security fixes

Vendor issues fixed:
Issue #731: Reject tar entries >= INT64_MAX
Issue #744: Very long pathnames evade symlink checks
Issue #748: libarchive can compress, but cannot decompress zip some files
PR #750: ustar: fix out of bounds read on empty string ("") filename
PR #755: fix use of acl_get_flagset_np() on FreeBSD
Issue #767: Buffer overflow printing a filename
Issue #770: Zip read: be more careful about extra_length

MFC r304874:
Temporarily disable two libarchive tests that have not yet been fixed by
vendor. Tests will be re-enabled after a fix has been merged.

git-svn-id: svn://svn.freebsd.org/base/stable/10@305192 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r301752:
ngie [Thu, 1 Sep 2016 08:34:31 +0000 (08:34 +0000)]
MFC r301752:

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

Tested with: amd64, i386

git-svn-id: svn://svn.freebsd.org/base/stable/10@305190 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC 304202
sephe [Thu, 1 Sep 2016 08:01:13 +0000 (08:01 +0000)]
MFC 304202
    tcp/lro: Make # of LRO entries tunable

    Reviewed by:    hps, gallatin
    Obtained from:  rrs, gallatin
    Sponsored by:   Netflix (rrs, gallatin), Microsoft (sephe)
    Differential Revision:  https://reviews.freebsd.org/D7499

git-svn-id: svn://svn.freebsd.org/base/stable/10@305189 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r305024:
kib [Thu, 1 Sep 2016 07:23:47 +0000 (07:23 +0000)]
MFC r305024:
Typesetting fixes.

git-svn-id: svn://svn.freebsd.org/base/stable/10@305186 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r304812:
kib [Thu, 1 Sep 2016 07:21:42 +0000 (07:21 +0000)]
MFC r304812:
In both do_rw_wrlock() and do_rw_rdlock(), do not obliterate possible
error from sleep.

git-svn-id: svn://svn.freebsd.org/base/stable/10@305185 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r304808:
kib [Thu, 1 Sep 2016 07:20:50 +0000 (07:20 +0000)]
MFC r304808:
Prevent leak of URWLOCK_READ_WAITERS flag for urwlocks.

PR: 211947

git-svn-id: svn://svn.freebsd.org/base/stable/10@305184 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r304652:
badger [Wed, 31 Aug 2016 22:18:50 +0000 (22:18 +0000)]
MFC r304652:

Fix missing substitution of @SBINDIR@ in resolvconf scripts

Certain features, such as resolv_conf_passthrough=NULL, do not work
correctly due to this missing substitution.

Also remove the @PREFIX@ substitution, which is no longer needed.

Approved by: vangyzen (mentor)
Sponsored by: Dell Inc.

git-svn-id: svn://svn.freebsd.org/base/stable/10@305165 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC 303855:
markj [Wed, 31 Aug 2016 21:35:51 +0000 (21:35 +0000)]
MFC 303855:
Handle races with listening socket close when connecting a unix socket.

PR: 211531

git-svn-id: svn://svn.freebsd.org/base/stable/10@305161 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r304969:
dim [Wed, 31 Aug 2016 18:37:04 +0000 (18:37 +0000)]
MFC r304969:

Define hastd's STRICT_ALIGN macro in a defined and portable way.

git-svn-id: svn://svn.freebsd.org/base/stable/10@305142 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r304953:
dim [Wed, 31 Aug 2016 18:00:41 +0000 (18:00 +0000)]
MFC r304953:

Define ipfilter's SOLARIS macro in a defined and portable way.

Reviewed by: cy
Differential Revision: https://reviews.freebsd.org/D7671

MFC r304959 (by kib):

Complete r304953.

Sponsored by: The FreeBSD Foundation

MFC r304964:

Follow-up to r304953, in which I broke the build: apparently the SOLARIS
macro is defined in lots of different places in ipfilter, so replace all
of the nonportable definitions with portable ones.

Pointy hat to: dim

git-svn-id: svn://svn.freebsd.org/base/stable/10@305138 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r304751: Fix minor copy/paste bug.
mav [Wed, 31 Aug 2016 09:50:02 +0000 (09:50 +0000)]
MFC r304751:  Fix minor copy/paste bug.

git-svn-id: svn://svn.freebsd.org/base/stable/10@305118 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r304055:
markj [Wed, 31 Aug 2016 01:27:30 +0000 (01:27 +0000)]
MFC r304055:
Fix handling of forward enum declarations in the CTF tools.

git-svn-id: svn://svn.freebsd.org/base/stable/10@305106 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r304184:
badger [Tue, 30 Aug 2016 13:39:42 +0000 (13:39 +0000)]
MFC r304184:

sem_post(): wake up the sleeper only after adjusting has_waiters

If the caller of sem_post() wakes up a thread sleeping via sem_wait()
before it clears the has_waiters flag, the caller of sem_wait() has no way of
knowing when it is safe to destroy the semaphore and reuse the memory. This is
because the caller of sem_post() may be interrupted between the wake step and
the clearing of has_waiters. It will then write into the has_waiters flag in
userspace after being preempted for some unknown amount of time.

Approved by: vangyzen (mentor)
Sponsored by: Dell Inc.

git-svn-id: svn://svn.freebsd.org/base/stable/10@305063 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r304911
ache [Tue, 30 Aug 2016 00:57:57 +0000 (00:57 +0000)]
MFC r304911

The formal behavior of qsort is unstable with regard to objects that
are equal. Unfortunately, RFC 3484 requires that otherwise equal objects
remain in the order supplied by the DNS server. The present code attempts
to deal with this by returning -1 for objects that are equal (i.e.,
returns that the first parameter is less then the second parameter).
Unfortunately, the qsort API does not state that the first parameter
passed in is in any particular position in the list.

PR:     212122
Submitted by:   Herbie.Robinson@stratus.com

git-svn-id: svn://svn.freebsd.org/base/stable/10@305037 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r304747:
cy [Mon, 29 Aug 2016 12:57:28 +0000 (12:57 +0000)]
MFC r304747:

Update from sqlite3-3.12.1 (3120100) to sqlite3-3.14.1 (3140100).

This commit addresses the tmpdir selection vulnerability fixed in
sqlite3-1.13.0.  See VuXML entry 546deeea-3fc6-11e6-a671-60a44ce6887b.

This MFC was suggested by kib@ in the abandoned D7651.

Security: VuXML 546deeea-3fc6-11e6-a671-60a44ce6887b
Security: CVE-2016-6153

git-svn-id: svn://svn.freebsd.org/base/stable/10@305003 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r304629:
hselasky [Mon, 29 Aug 2016 08:51:27 +0000 (08:51 +0000)]
MFC r304629:
Don't separate the status stage of the XHCI USB control transfers into
its own job because this breaks the simplified QEMU XHCI TRB parser,
which expects the complete USB control transfer as a series of back to
back TRBs. The old behaviour is kept under #ifdef in case this change
breaks enumeration of any USB devices.

PR: 212021

git-svn-id: svn://svn.freebsd.org/base/stable/10@304998 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r304601:
hselasky [Mon, 29 Aug 2016 08:49:38 +0000 (08:49 +0000)]
MFC r304601:
Increase the maximum RX/TX queue size. This allows for a RX/TX queue
size of 16384 mbufs. Previously the limit was 8192.

Sponsored by: Mellanox Technologies

git-svn-id: svn://svn.freebsd.org/base/stable/10@304997 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r304597:
hselasky [Mon, 29 Aug 2016 08:42:37 +0000 (08:42 +0000)]
MFC r304597:
Fix for invalid use of bits in input context. Basically split
configuring of EP0 and non-EP0 into xhci_cmd_evaluate_ctx() and
xhci_cmd_configure_ep() respectivly. This resolves some errors when
using XHCI under QEMU and gets is more in line with the XHCI
specification.

PR: 212021

git-svn-id: svn://svn.freebsd.org/base/stable/10@304993 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFstable/11 r304945:
ngie [Mon, 29 Aug 2016 05:46:35 +0000 (05:46 +0000)]
MFstable/11 r304945:

MFC r304034:

Initialize `ai` to NULL and test for `ai` with type-appropriate values

Depending on the address family and ai_flags containing AI_V4MAPPED,
it might not do a proper DNS lookup on the provided DNS address

Convert some `ai` boolean true/false checks to NULL/non-NULL while here.

PR: 211790

git-svn-id: svn://svn.freebsd.org/base/stable/10@304982 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r303982
alc [Sun, 28 Aug 2016 05:07:13 +0000 (05:07 +0000)]
MFC r303982
  Correct errors and clean up the comments on the active queue scan.

  Eliminate some unnecessary blank lines.

git-svn-id: svn://svn.freebsd.org/base/stable/10@304942 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r303426:
kib [Sat, 27 Aug 2016 11:45:05 +0000 (11:45 +0000)]
MFC r303426:
Rewrite subr_sleepqueue.c use of callouts to not depend on the
specifics of callout KPI.

git-svn-id: svn://svn.freebsd.org/base/stable/10@304905 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r303425:
kib [Sat, 27 Aug 2016 11:38:37 +0000 (11:38 +0000)]
MFC r303425:
Add callout_when(9).

MFC r303919:
Fix indentation.

git-svn-id: svn://svn.freebsd.org/base/stable/10@304900 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r264388 (by davide):
kib [Sat, 27 Aug 2016 10:56:04 +0000 (10:56 +0000)]
MFC r264388 (by davide):
Define SBT_MAX.

MFC r267896 (by davide):
Improve r264388.

MFC note.  The SBT_MAX definition already existed on stable/10, but without
the refinement from r267896.  Also, consumers of SBT_MAX were not converted,
since r264388 was not merged properly.

Reviewed by: mav

git-svn-id: svn://svn.freebsd.org/base/stable/10@304894 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r304607,r304641,r304819,r304811
ache [Sat, 27 Aug 2016 10:34:01 +0000 (10:34 +0000)]
MFC r304607,r304641,r304819,r304811

1) Don't forget to set __SERR on __slbexpand() error.

2) Remove "Fast path" from fgetwc()/fputwc() since it can't detect
encoding errors and ignores them all.
One of affected encoding example: US-ASCII

3)  Original fgetln() from 44lite return success for line tail errors,
i.e. partial line, but set __SERR and errno in the same time, which
is inconsistent.
Now both OpenBSD and NetBSD return failure, i.e. no line and set error
indicators for such case, so make our fgetln() and fgetwln()
(as its wide version) compatible with the rest of *BSD.

PR:     212033

git-svn-id: svn://svn.freebsd.org/base/stable/10@304893 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r304810
ache [Sat, 27 Aug 2016 09:58:06 +0000 (09:58 +0000)]
MFC r304810

Don't check for __SERR which may stick from one of any previous stdio
functions.
__SERR is for user and the rest of stdio code do not check it
for error sensing internally, only set it.
In vf(w)printf.c here it is more easy to save __SERR, clear and restore it.

git-svn-id: svn://svn.freebsd.org/base/stable/10@304888 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r304779, r304780, r304781, r304782, r304802
cy [Sat, 27 Aug 2016 02:53:21 +0000 (02:53 +0000)]
MFC r304779, r304780, r304781, r304782, r304802

r304779:

  Revert r298887 (spelling fix) and remove $FreeBSD$ because text changes
  to leap-seconds invaldidates validation hash at the end of the file.

  Remove svn:keywords and replace with fbsd:nokeywords=yes to
  support this change.

r304780:

  Change the algorithm by which /var/db/leap-seconds is updated.

  1. Use the leap-seconds version number (update time) to determine
     whether to update the file or not.

  2. If the version numbers of the files is the same, use the later
     expiry date to determine which file to use.

  Suggested by: ian@

r304781:

  Add logic to replace the working ntp leap-seconds file in /var/db
  if it contains a $FreeBSD$ header. The header will cause the file
  to fail checksum of the hash causing ntpd to ignore the file.

r304782:

  Make validation of the leap-seconds file unconditional.

r304802:

  Remove the gratuitous check for $FreeBSD$ and rename the function
  to ntpd_init_leapfile, to ensure a copy exists in /var/db if a copy
  isn't already there.

  Reported by: ache@

git-svn-id: svn://svn.freebsd.org/base/stable/10@304879 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r304721:
cy [Sat, 27 Aug 2016 02:27:29 +0000 (02:27 +0000)]
MFC r304721:

Fixup man page formatting.

Submitted by: Steve Kargl <sgk@troutmask.apl.washington.edu>
Discussed with: bjk@

git-svn-id: svn://svn.freebsd.org/base/stable/10@304878 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoBump __FreeBSD_version after LC_*_MASK fix
ache [Fri, 26 Aug 2016 21:26:33 +0000 (21:26 +0000)]
Bump __FreeBSD_version after LC_*_MASK fix

git-svn-id: svn://svn.freebsd.org/base/stable/10@304864 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r304703, r304755
ache [Fri, 26 Aug 2016 21:19:23 +0000 (21:19 +0000)]
MFC r304703, r304755

1) _locale.h
LC_*_MASK bit shifting order was partially broken from the initial commit
time at year 2012. Only LC_COLLATE_MASK and LC_CTYPE_MASK are in the
right order.

The order here should match XLC_* from "xlocale_private.h" which, in turn,
match LC_* publicly visible order from <locale.h> which determines how
locale components are stored in the structure.
LC_*_MASK -> XLC_* translation done as "ffs(mask) - 1" in the querylocale()
and equivalent shift loop in the newlocale(), so mapped to some wrong
components (excluding two mentioned above).

Formally the fix is ABI breakage, but old code using those masks
never works properly in any case.
Only newlocale() and querylocale() are affected.

2) msgcat.c
Use current locale (f.e. set by thread). It was global locale always
previously.

PR:     211743

git-svn-id: svn://svn.freebsd.org/base/stable/10@304862 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r304342:
hselasky [Fri, 26 Aug 2016 12:06:43 +0000 (12:06 +0000)]
MFC r304342:
Add support for setting blocking and non-blocking mode on /dev/rdma_cm
by returning success on FIONBIO and FIOASYNC IOCTLs. The actual flags
handling is done by the kern_ioctl() function.

Reported by: Alex Bowden <alex.bowden@outlook.com>
Sponsored by: Mellanox Technologies

git-svn-id: svn://svn.freebsd.org/base/stable/10@304846 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC 303766
sephe [Fri, 26 Aug 2016 06:19:12 +0000 (06:19 +0000)]
MFC 303766
    tcp/lro: If timestamps mismatch or it's a FIN, force flush.

    This keeps the segments/ACK/FIN delivery order.

    Before this patch, it was observed: if A sent FIN immediately after
    an ACK, B would deliver FIN first to the TCP stack, then the ACK.
    This out-of-order delivery causes one unnecessary ACK sent from B.

    Reviewed by:    gallatin, hps
    Obtained from:  rrs, gallatin
    Sponsored by:   Netflix (rrs, gallatin), Microsoft (sephe)
    Differential Revision:  https://reviews.freebsd.org/D7415

git-svn-id: svn://svn.freebsd.org/base/stable/10@304836 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r295632
ache [Thu, 25 Aug 2016 19:55:31 +0000 (19:55 +0000)]
MFC r295632

getln: We cannot expand the buffer beyond INT_MAX (_size overflows).

In such cases return ENOMEM. This is a limitation of our
implementation, alternatively you may consider getline(3).

Differential Revision:  https://reviews.freebsd.org/D442 (Partial)
Obtained from:  Apple Inc. (Libc 997.90.3)

git-svn-id: svn://svn.freebsd.org/base/stable/10@304816 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r304286:
kib [Wed, 24 Aug 2016 09:20:27 +0000 (09:20 +0000)]
MFC r304286:
Remove duplicated code.

git-svn-id: svn://svn.freebsd.org/base/stable/10@304739 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoFix HA mode configuration on FreeBSD 10.x.
mav [Wed, 24 Aug 2016 07:50:28 +0000 (07:50 +0000)]
Fix HA mode configuration on FreeBSD 10.x.

This is direct commit, compensating CTLFLAG_RDTUN difference between
FreeBSD 10.x and 11.x branches.

git-svn-id: svn://svn.freebsd.org/base/stable/10@304737 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r301724
arybchik [Tue, 23 Aug 2016 13:51:55 +0000 (13:51 +0000)]
MFC r301724

sfxge(4): handle negative ticks difference correctly

ticks are signed int and if statistics is not updated for a long time
(more than INT_MAX ticks, but less than UINT_MAX) difference becomes
negative and less than hz for a long time.

Other option to repeat is simply load driver (which initializes
timestamps to 0) when ticks are negative.

Sponsored by:   Solarflare Communications, Inc.

git-svn-id: svn://svn.freebsd.org/base/stable/10@304679 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r304232:
kib [Tue, 23 Aug 2016 07:55:32 +0000 (07:55 +0000)]
MFC r304232:
In UFS_BALLOC(), invalidate pages of indirect buffers on failed block
allocation unwinding.

git-svn-id: svn://svn.freebsd.org/base/stable/10@304672 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r303763,303791,303869: zfs: honour and make use of vfs vnode locking protocol
avg [Tue, 23 Aug 2016 07:55:05 +0000 (07:55 +0000)]
MFC r303763,303791,303869: zfs: honour and make use of vfs vnode locking protocol

PR: 209158

git-svn-id: svn://svn.freebsd.org/base/stable/10@304671 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r304231:
kib [Tue, 23 Aug 2016 07:54:14 +0000 (07:54 +0000)]
MFC r304231:
On unwind after failed block allocation in ffs_balloc_ufs{1,2}, assert
that recorded allocated blocks numbers match the physical block numbers
of dandling buffers which are released.
When finally freeing the blocks during unwind, assert that dandling
buffers where not re-allocated.

git-svn-id: svn://svn.freebsd.org/base/stable/10@304670 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r304229:
kib [Tue, 23 Aug 2016 07:53:09 +0000 (07:53 +0000)]
MFC r304229:
When looking up dandling buffers for unwing after failing block
allocation in UFS_BALLOC(), there is no need to map them.

git-svn-id: svn://svn.freebsd.org/base/stable/10@304669 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r304228:
kib [Tue, 23 Aug 2016 07:52:07 +0000 (07:52 +0000)]
MFC r304228:
When block allocation fails in UFS_BALLOC(), and the volume does not
have SU enabled, there is no point in calling softdep_request_cleanup().

git-svn-id: svn://svn.freebsd.org/base/stable/10@304668 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r304227:
kib [Tue, 23 Aug 2016 07:51:00 +0000 (07:51 +0000)]
MFC r304227:
In ffs_balloc_ufs{1,2} routines, assert that unwind records do not
overflow local arrays.

git-svn-id: svn://svn.freebsd.org/base/stable/10@304667 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r304521: JMicron JMB361 has only a single SATA port
avg [Tue, 23 Aug 2016 07:03:17 +0000 (07:03 +0000)]
MFC r304521: JMicron JMB361 has only a single SATA port

git-svn-id: svn://svn.freebsd.org/base/stable/10@304659 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoDirect commit, equal to MFC part of r295632 which is not planned for
ache [Tue, 23 Aug 2016 00:00:06 +0000 (00:00 +0000)]
Direct commit, equal to MFC part of r295632 which is not planned for
MFC at whole.
Set __SERR on  __slbexpand() errors.

git-svn-id: svn://svn.freebsd.org/base/stable/10@304648 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC 302379: Correct locking annotation for p_comm.
jhb [Mon, 22 Aug 2016 18:12:24 +0000 (18:12 +0000)]
MFC 302379: Correct locking annotation for p_comm.

p_comm is changed during exec, it is not read-only after fork.

git-svn-id: svn://svn.freebsd.org/base/stable/10@304619 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC 304476: Fix various nits in the aio operation manpages.
jhb [Mon, 22 Aug 2016 17:52:10 +0000 (17:52 +0000)]
MFC 304476: Fix various nits in the aio operation manpages.

- Avoid double use of "request" in a single sentence.  Instead, describe
  aio_sigevent as being used to request notification of the associated
  operation's completion.  This matches the language used to describe
  aio_sigevent in aio(4).
- Simplify the prohibition on modifying buffers while requests are in
  flight.
- Fix case mismatch.
- Drop note about not using stack variables. C programmers should be able
  to figure out if a stack variable is safe based on the later warning
  about the life cycle requirements of control blocks.
- Remove prohibition on modifying the I/O buffer for aio_fsync() since
  it does not use an I/O buffer.  For aio_mlock(), prohibit modifications
  to the mapping (e.g. due to mprotect, munmap, mmap, etc.) but do not
  prohibit modifications to the memory backing the buffer (stores into
  the pages backing the buffer).

git-svn-id: svn://svn.freebsd.org/base/stable/10@304617 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r304440, r304487:
markj [Mon, 22 Aug 2016 17:21:45 +0000 (17:21 +0000)]
MFC r304440, r304487:
Fix some handling of P2_PTRACE_FSTP.

git-svn-id: svn://svn.freebsd.org/base/stable/10@304613 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r304608:
bdrewery [Mon, 22 Aug 2016 16:35:50 +0000 (16:35 +0000)]
MFC r304608:

  Bump __FreeBSD_version for C++11 thread_local support in r303795.

PR:         192320

git-svn-id: svn://svn.freebsd.org/base/stable/10@304611 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r304174:
kib [Mon, 22 Aug 2016 07:26:43 +0000 (07:26 +0000)]
MFC r304174:
VOP_FSYNC() does not take cred as an argument.  Correct comment.

git-svn-id: svn://svn.freebsd.org/base/stable/10@304590 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC 304251
sephe [Mon, 22 Aug 2016 02:11:30 +0000 (02:11 +0000)]
MFC 304251

    hyperv/storvsc: Deliver CAM_SEL_TIMEOUT upon SRB status error.

    SRB status is set to 0x20 by the hypervisor, if the specified LUN is
    unaccessible, and even worse the INQUIRY response will not be set by
    the hypervisor at all under this situation.  Additionally, SRB status
    is 0x20 too, for TUR on an unaccessible LUN.

    Deliver CAM_SEL_TIMEOUT to CAM upon SRB status errors as suggested by
    Scott Long, other values seems improper.

    This commit fixes the Hyper-V disk hotplug support.

    Submitted by:   Hongjiang Zhang <honzhan microsoft com>
    Sponsored by:   Microsoft
    Differential Revision:  https://reviews.freebsd.org/D7521

git-svn-id: svn://svn.freebsd.org/base/stable/10@304581 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r298355:
mav [Sun, 21 Aug 2016 17:57:32 +0000 (17:57 +0000)]
MFC r298355:
Don't use SYSDIR to avoid conflicts with existing usage.
Also, use SRCTOP to locate the top of the source tree
instead of a relative path.

PR: 208856

git-svn-id: svn://svn.freebsd.org/base/stable/10@304569 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f