kevans [Wed, 27 Jun 2018 21:11:28 +0000 (21:11 +0000)]
MFC r335404: sort(1): Fix -m when only implicit stdin is used for input
Observe:
printf "a\nb\nc\n" > /tmp/foo
# Next command results in no output
cat /tmp/foo | sort -m
# Next command results in proper output
cat /tmp/foo | sort -m -
# Also works:
sort -m /tmp/foo
Some const'ification was done to simplify the actual solution of adding "-"
explicitly to the file list if we didn't have any file arguments left over.
kevans [Wed, 27 Jun 2018 21:03:05 +0000 (21:03 +0000)]
MFC r330086, r333155: seq(1) improvements
MFC r330086 (cem): seq(1): Consistently include 'last' for non-integers
The source of error is a rounded increment being too large and thus the loop
steps slightly past 'last'. Perform a final comparison using the formatted
string values (truncated precision) to determine if we still need to print
the 'last' value.
MFC r333155: seq(1): Move long_opts up with globals
kevans [Wed, 27 Jun 2018 21:00:09 +0000 (21:00 +0000)]
MFC r333157: cmp(1): Provide some long options
These match GNU cmp(1) for compatibility where applicable.
Future work might implement the -i option from GNU cmp(1) to express skip
either in terms of both files or of the form "SKIP1:SKIP2" rather than
specifying them as additional arguments to cmp(1).
araujo [Wed, 27 Jun 2018 03:58:02 +0000 (03:58 +0000)]
MFC r333622, r334019, r334084
r333622:
vq_getchain() can return -1 if some descriptor(s) are invalid and prints
a diagnostic message. So we do a sanity checking on the return value
of vq_getchain().
r334019:
Include atkbdc header where there are declared the prototype functions
atkbdc_event and atkbdc_init.
Sponsored by: iXsystems Inc.
r334084:
pthread_rwlock_unlock(3) returns 0 if successful, otherwise an error number
will be returned to indicate the error, so I'm applying an assert(3) to do
a sanity check of the return value.
Reported by: Coverity CID: 1391235, 1193654 and 1193651
Reviewed by: grehan
Sponsored by: iXsystems Inc.
Differential Revision: https://reviews.freebsd.org/D15533
np [Fri, 22 Jun 2018 20:19:33 +0000 (20:19 +0000)]
cxgbe(4): Determine early in the ioctl whether it is allowed to sleep or
not, instead of always starting a non-sleepable operation and
re-adjusting later. This ensures that an operation that is allowed to
sleep (ifconfig up/down) never fails with EBUSY on the initial attempt
to start a synchronized operation.
This is a direct commit to stable/11. The driver ioctl is always
allowed to sleep in head.
avg [Fri, 22 Jun 2018 10:49:21 +0000 (10:49 +0000)]
MFC r333667: followup to r332730/r332752: set kdb_why to "trap" for fatal traps
This change updates arm, arm64 and mips achitectures. Additionally, it
removes redundant checks for kdb_active where it already results in
kdb_reenter() and adds kdb_reenter() calls where they were missing.
Some architectures check the return value of kdb_trap(), but some don't.
I haven't changed any of that.
Some trap handling routines have a return code. I am not sure if I
provided correct ones for returns after kdb_reenter(). kdb_reenter
should never return unless kdb_jmpbufp is NULL for some reason.
avg [Fri, 22 Jun 2018 10:44:33 +0000 (10:44 +0000)]
MFC r333321,r333707: x86 cpususpend_handler: call wbinvd after setting suspend state bits
Without a subsequent wbinvd the changes to suspended_cpus (and
resuming_cpus) can be lost at least on AMD systems that use MOESI cache
coherency protocol. That can happen because one of APs ends up as an
Owner of the corresponding cache line(s) and the changes may never reach
the main memory before the AP is reset.
This change fixed suspend to RAM a previously broken AMD-based system.
avg [Fri, 22 Jun 2018 10:39:22 +0000 (10:39 +0000)]
MFC r332918, r333222: go deeper for ACPI suspend bounce test
debug.acpi.suspend_bounce sysctl now allows a deeper dive into the sleep
abyss. The system will execute the suspend sequence up to the call to
AcpiEnterSleepState(). That includes saving processor contexts and
parking APs. Then, instead of actually entering the sleep state, the
BSP will call resumectx() to emulate the wakeup. The APs should get
restarted by the sequence of Init and Startup IPIs that BSP sends to
them.
AcpiOsEnterSleep() is used to implement this feature.
avg [Fri, 22 Jun 2018 09:37:26 +0000 (09:37 +0000)]
MFC r333630: Fix 'zpool create -t <tempname>'
Creating a pool with a temporary name fails when we also specify custom
dataset properties: this is because we mistakenly call
zfs_set_prop_nvlist() on the "real" pool name which, as expected,
cannot be found because the SPA is present in the namespace with the
temporary name.
eadler [Fri, 22 Jun 2018 04:54:51 +0000 (04:54 +0000)]
MFC r334472:
service(1): Improve manual page
* Sort options..
* Fix some typos.
* Use one Bd macro for code blocks instead of a bunch of Dl
* macros.
* Improve formatting.
* Clarify 'jail' argument
emaste [Fri, 22 Jun 2018 00:30:24 +0000 (00:30 +0000)]
MFC r335213: ldd: reference readelf instead of objdump in warning message
We have an obsolete GNU objdump 2.17.50 in the base system, which will
be removed in the future. Suggest readelf(1) for examining ELF files
instead; for most use cases it is the preferred tool anyhow.
emaste [Fri, 22 Jun 2018 00:29:29 +0000 (00:29 +0000)]
MFC r335209: elf.5: add readelf cross-reference
objdump is sometimes used in cases where readelf is more appropriate,
but the obsolete GNU objdump we have in the base system will be removed
in the future.
.Xr readelf from elf.5 to improve the odds the more appropriate tool
will be found.
ed [Thu, 21 Jun 2018 16:12:30 +0000 (16:12 +0000)]
MFC r335314:
Fix bad logic in iovlist_truncate().
To conform to RFC 5426, this function is intended to truncate messages
if they exceed the message size limits. Unfortunately, the amount of
space was computed the wrong way around, causing messages to be
truncated entirely.
dteske [Thu, 21 Jun 2018 14:55:26 +0000 (14:55 +0000)]
MFC r335308: bsdconfig: Fix a bug when editing users
The usermgmt API was stomping on a global ($user_gid to be specific)
so things would appear to work fine until you tried to make a second
pass into the API with the now-tainted variable contents.
Fixed by localizing menu-specific contents as to not leak outside API.
PR: bin/208774
Reported by: Martin Waschbuesch <martin@waschbuesch.de>
Sponsored by: Smule, Inc.
ae [Thu, 21 Jun 2018 10:51:25 +0000 (10:51 +0000)]
MFC r335133:
In m_megapullup() use m_getjcl() to allocate 9k or 16k mbuf when requested.
It is better to try allocate a big mbuf, than just silently drop a big
packet. A better solution could be reworking of libalias modules to be
able use m_copydata()/m_copyback() instead of requiring the single
contiguous buffer.
dim [Thu, 21 Jun 2018 09:45:03 +0000 (09:45 +0000)]
MFC r335297:
Fix build of ndis with base gcc on i386
Casting from rman_res_t to a pointer results in "cast to pointer from
integer of different size" warnings with base gcc on i386, so use an
intermediate cast to uintptr_t to suppress it. In this case, the I/O
port range is effectively limited to the range of 0..65535.
dim [Thu, 21 Jun 2018 09:41:44 +0000 (09:41 +0000)]
MFC r335296:
Fix build of aibs with base gcc on i386
Add a few intermediate casts to intptr_t to suppress "cast to pointer
from integer of different size" warnings from gcc. In this case, the
'arg2' part of SYSCTL_HANDLER_ARGS is used to pass in a pointer, via an
intermediate intmax_t, so no information is lost.
hselasky [Wed, 20 Jun 2018 06:48:41 +0000 (06:48 +0000)]
MFC r334714:
Rename two structure field members while keeping backwards compatibility in
the LinuxKPI. Add a comment saying in which Linux version this change was made.
hselasky [Wed, 20 Jun 2018 06:39:32 +0000 (06:39 +0000)]
MFC r334660:
Add "access" function pointer to the "vm_operations_struct" structure
in the LinuxKPI. While at it document when to use the "virtual_address" or
the "address" field in the "vm_fault" structure.
r330878: Fix typo and lint/igor warnings
r330879: Fix lint/igor warnings
r330939: Use full month in dpv(3), figpar(3), and bsdconfig(8) manuals
r330948: Bump copyright following recent changes