ed [Sat, 29 Oct 2016 14:41:22 +0000 (14:41 +0000)]
MFC r307227 and r307343:
Improve typing of POSIX search tree functions.
Back in 2015 when I reimplemented these functions to use an AVL tree, I
was annoyed by the weakness of the typing of these functions. Both tree
nodes and keys are represented by 'void *', meaning that things like the
documentation for these functions are an absolute train wreck.
To make things worse, users of these functions need to cast the return
value of tfind()/tsearch() from 'void *' to 'type_of_key **' in order to
access the key. Technically speaking such casts violate aliasing rules.
I've observed actual breakages as a result of this by enabling features
like LTO.
I've filed a bug report at the Austin Group. Looking at the way the bug
got resolved, they made a pretty good step in the right direction. A new
type 'posix_tnode' has been added to correspond to tree nodes. It is
still defined as 'void' for source-level compatibility, but in the very
far future it could be replaced by a proper structure type containing a
key pointer.
Until we can resolve the numerous hole_birth bugs that have cropped up
recently, and come up with a way going forwards to protect users from
corruption, we should disable the hole_birth feature. Using a tunable
allows those who are confident that their data is correct to continue to
take advantage of the feature.
Closes #188
Reviewed by: Matthew Ahrens <mahrens@delphix.com>
Author: Paul Dagnelie <pcd@delphix.com>
dsl_dataset_space is looking at the ds_bp's fill count while
dmu_objset_write_ready() is concurrently modifying it. This fix adds an
rrwlock to protect the ds_bp.
Closes #180
Reviewed by: George Wilson <george.wilson@delphix.com>
Reviewed by: Prakash Surya <prakash.surya@delphix.com>
Reviewed by: Matthew Ahrens <mahrens@delphix.com>
Reviewed by: Steve Gonczi <steve.gonczi@delphix.com>
Author: Paul Dagnelie <pcd@delphix.com>
mav [Sat, 29 Oct 2016 08:47:23 +0000 (08:47 +0000)]
MFC r307507, r307509, r307515:
Consider device as clean even if SYNCHRONIZE CACHE failed.
If device reservation was preempted by other initiator, our sync request
will always fail. Without this change CAM tried to sync cache on every
following device close, including numerous GEOM tasting opens/closes,
causing lots of useless noise in logs.
mav [Sat, 29 Oct 2016 08:43:34 +0000 (08:43 +0000)]
MFC r307350: Add LUN options to limit UNMAP and WRITE SAME sizes.
CTL itself has no limits on on UNMAP and WRITE SAME sizes. But depending
on backends large requests may take too much time. To avoid that new
configuration options allow to hint initiator maximal sizes it should not
exceed.
kib [Fri, 28 Oct 2016 12:55:14 +0000 (12:55 +0000)]
MFC r306807:
When making a pause after detecting hard kill of the single-user
shell, ensure that we do sleep for at least the specified time, in
presence of signals.
jhb [Fri, 28 Oct 2016 03:54:19 +0000 (03:54 +0000)]
MFC 303002: Include process IDs in core dumps.
When threads were added to the kernel, the pr_pid member of the
NT_PRSTATUS note was repurposed to store LWP IDs instead of process
IDs. However, the process ID was no longer recorded in core dumps.
This change adds a pr_pid field to prpsinfo (NT_PRSINFO). Rather than
bumping the prpsinfo version number, note parsers can use the note's
payload size to determine if pr_pid is present.
davidcs [Wed, 26 Oct 2016 17:53:12 +0000 (17:53 +0000)]
MFC r307578
1. Use taskqueue_create() instead of taskqueue_create_fast() for both
fastpath and slowpath taskqueues.
2. Service all transmits in taskqueue threads.
3. additional stats counters for keeping track of
- bd availability
- tx buf ring not emptied in the fp task queue.
These are drained via timeout taskqueue.
- tx attempts during link down.
gahr [Wed, 26 Oct 2016 08:39:33 +0000 (08:39 +0000)]
MFC r307638:
Chase a cornercase in printenv and sync its behaviour with builtin's
The cornercase is when printenv is passed a parameter in the form
VAR=val, where VAR=val exists in the environment. In this case, printenv would
print a spurious newline and returns 0.
jch [Tue, 25 Oct 2016 12:53:14 +0000 (12:53 +0000)]
MFC r307551:
Fix a double-free when an inp transitions to INP_TIMEWAIT state
after having been dropped.
This change enforces in_pcbdrop() logic in tcp_input():
"in_pcbdrop() is used by TCP to mark an inpcb as unused and avoid future packet
delivery or event notification when a socket remains open but TCP has closed."
Now that etcupdate does not depend on rcs anymore there is no need to
conditionnally install it
r305620: (by vangyzen )
etcupdate: preserve the metadata of the destination file
When using diff3 to perform a three-way merge, etcupdate lost the destination
file's metadata. The metadata from the temporary file were used instead.
This was unpleasant for rc.d scripts, which require execute permission.
Use "cat >" to overwrite the destination file's contents while preserving its
metadata.
gonzo [Sat, 22 Oct 2016 16:42:49 +0000 (16:42 +0000)]
MFC r306860:
Add multitouch support for RPi's FT5406
- Add multitouch support (protocol B)
- Report physical size of the screen
- Switch from using busy loop to callbacks
- Enable callbacks only when there is active listener on /dev/input/eventX
Submitted by: Vladimir Kondratiev <wulf@cicgroup.ru>
gonzo [Sat, 22 Oct 2016 16:38:39 +0000 (16:38 +0000)]
MFC r306647, r306855, r306857
r306647:
const-ify struct evdev_methods
Submitted by: Vladimir Kondratiev <wulf@cicgroup.ru>
Suggested by: hselasky
r306855:
Allow using of driver's mutex instead internal one for evdev locking.
Add new API call: evdev_register_mtx which takes lock argument that
should be used instead of internal one for evdev locking. Useful for
cases if evdev_push_event() is always called with driver's lock taken
and reduces amount of lock aquisitions. This allows to avoid LOR
between ev_open/ev_close invocations and evdev_push_event() Such LOR
can happen when ev_open/ev_close methods acquire driver lock and
evdev_push_event() is called with this lock taken.
Submitted by: Vladimir Kondratiev <wulf@cicgroup.ru>
r306857:
Implement EVDEV_FLAG_MT_AUTOREL flag (autorelease touchpoints)
Automaticaly release (send ABS_MT_TRACKING_ID = -1) MT-slots
that has not been listed in current MT protocol type B report.
Slot is counted as listed if corresponding ABS_MT_SLOT event
has been sent regardless of other MT events.
Events are sent on SYN_REPORT event.
Submitted by: Vladimir Kondratiev <wulf@cicgroup.ru>
gonzo [Sat, 22 Oct 2016 16:24:12 +0000 (16:24 +0000)]
MFC r306618, r306619
r306618:
Fix attach/detach methods
- Initialize lock before starting worker process
- Do not hold lock when destroying evdev. By that time ther should be no
other active code pathes that can access softc
r306619:
Add rpi_ft5406 module and add it to extra modules in Raspberry Pi configs
gonzo [Sat, 22 Oct 2016 15:26:32 +0000 (15:26 +0000)]
MFC r306530, r306531, r306532, r306579:
r306530:
Declare a module for evdev and add dependency to ukbd(4) and ums(4)
Prepare for making evdev a module. "Pure" evdev device drivers (like
touchscreen) and evdev itself can be built as a modules regardless of
"options EVDEV" in kernel config. So if people does not require evdev
functionality in hybrid drivers like ums and ukbd they can, for instance,
kldload evdev and utouchscreen to run FreeBSD in kiosk mode.
r306531:
Add dependency to evdev module (if required)
r306532:
Add dependency to evdev module
r306579:
Modularize evdev
- Convert "options EVDEV" to "device evdev" and "device uinput", add
modules for both new devices. They are isolated subsystems and do not
require any compile-time changes to general kernel subsytems
- For hybrid drivers that have evdev as an optional way to deliver input
events add option EVDEV_SUPPORT. Update all existing hybrid drivers
to use it instead of EVDEV
- Remove no-op DECLARE_MODULE in evdev, it's not required, MODULE_VERSION
is enough
- Add evdev module dependency to uinput
Submitted by: Vladimir Kondratiev <wulf@cicgroup.ru>
bapt [Sat, 22 Oct 2016 13:15:19 +0000 (13:15 +0000)]
MFC: 307368,307369,307372,307381
Remove the common.h include which is actually not used in sdiff.c
Turn editit into a static function
Move cleanup() into the edit.c file which is the only users of that function
Remove common.{c,h}
Fix typos in sdiff(1) message and improve display
gonzo [Sat, 22 Oct 2016 02:37:59 +0000 (02:37 +0000)]
MFC r306430
Add touchscreen support for the official 7" RPi touch display
Technically touchscreen chip is FT5406 but all hardware
communication is performed by VideCore and only final results
are presented to ARM part through memory region shared between
VC and ARM.
evdev is used as userland interface. FT5406 supports up to
10 touchpoints, but for now driver emulates single touch device
because I do not have GUI bits to test this functionality.
Driver is not enabled in default config for RPI and RPI2
gonzo [Sat, 22 Oct 2016 02:26:33 +0000 (02:26 +0000)]
MFC r306134:
Add evdev support to ums(4)
event generation is disabled by default in favour of sysmouse. This
behavoiur is controlled by kern.evdev.rcpt_mask sysctl, bit 2 should
be set to give priority to hw over sysmouse
Submitted by: Vladimir Kondratiev <wulf@cicgroup.ru>
Reviewed by: hans
Differential Revision: https://reviews.freebsd.org/D7863
gonzo [Sat, 22 Oct 2016 02:15:39 +0000 (02:15 +0000)]
MFC r306132, r306275:
r306132:
Add evdev support to ukbd driver
event generation is disabled by default in favour of kbdmux. This
behavoiur is controlled by kern.evdev.rcpt_mask sysctl, bit 3 should
be set to give priority to hw over mux
Submitted by: Vladimir Kondratiev <wulf@cicgroup.ru>
Reviewed by: hans
Differential Revision: https://reviews.freebsd.org/D7957
r306275:
Do not perform extra check for NULL, evdev_free can handle NULL value
Submitted by: Vladimir Kondratiev <wulf@cicgroup.ru>
gonzo [Sat, 22 Oct 2016 01:58:21 +0000 (01:58 +0000)]
MFC r305708, r305719
r305708:
Add evdev support to TI ADC/touchscreen driver
Add generic evdev support to touchscreen part of ti_adc: two absolute
coordinates + button touch to indicate pen position. Pressure value
reporting is not implemented yet.
Tested on: Beaglebone Black + 4DCAPE-43T + tslib
r305719:
Cleanup evdev support for TI ADC/TS
- evdev_set_methods call is not required if actual methods are no-ops
- evdev_set_serial is also optional if there is no meaningful input device
identifier
- evdev_set_id on the other hand is mandatory, so set virtual bus with
dummy vendor/product/version
gonzo [Sat, 22 Oct 2016 01:38:21 +0000 (01:38 +0000)]
MFC r305706, r305749, r306274
r305706:
Add evdev protocol implementation
evdev is a generic input event interface compatible with Linux
evdev API at ioctl level. It allows using unmodified (apart from
header name) input evdev drivers in Xorg, Wayland, Qt.
This commit has only generic kernel API. evdev support for individual
hardware drivers like ukbd, ums, atkbd, etc. will be committed later.
Project was started by Jakub Klama as part of GSoC 2014. Jakub's
evdev implementation was later used as a base, updated and finished
by Vladimir Kondratiev.
Submitted by: Vladimir Kondratiev <wulf@cicgroup.ru>
Reviewed by: adrian, hans
Differential Revision: https://reviews.freebsd.org/D6998
r305749:
Remove semicolon from the end of the macro definition
Reported by: hans
r306274:
Handle NULL argument in evdev_free
Add check for evdev argument of evdev_free being NULL. This is valid
value and should not cause crash. In this case evdev_free does nothing
Submitted by: Vladimir Kondratiev <wulf@cicgroup.ru>
rmacklem [Thu, 20 Oct 2016 02:03:19 +0000 (02:03 +0000)]
MFC: r306559
r297225 broke udp_output() for the case where the "addr" argument
is NULL and the function jumps to the "release:" label.
For this case, the "inp" was write locked, but the code attempted to
read unlock it. This patch fixes the problem.
This case could occur for NFS over UDP mounts, where the server was
down for a few minutes under certain circumstances.
emaste [Wed, 19 Oct 2016 13:36:52 +0000 (13:36 +0000)]
MFC r307152: Add COMPAT_FREEBSD10 to the MIPS ERL kernel config
As of r302092, pipe is a wrapper around pipe2 and the pipe syscall is no
longer used. It is included only with the COMPAT_FREEBSD10 kernel option.
Add the compat option to support upgrades from systems with an earlier
userland.
bapt [Wed, 19 Oct 2016 13:26:07 +0000 (13:26 +0000)]
MFC: 304677, 304680, 305125, 305770, 305769
r304677:
Add tftpfs support for the EFI loader
Allow netbooting on efi without having to setup any NFS server by rebuilding the
loader with LOADER_TFTP_SUPPORT like for the i386 pxeloader
r305125:
Netboot: allow both tftpfs and nfs in both pxeboot and loader.efi
Add a new 'netproto' variable which can be set for now to
NET_TFTP or NET_NFS (default to NET_NONE)
From the dhcp options if one sets the root-path option to:
"ip:path", the loader will consider it is booting over NFS
(meaning same behaviour as the default current behaviour)
if the dhcp option "tftp server address" is set (option 150)
the loader will consider it is booting over tftpfs, it will then
consider the root-path options with 2 possible case
1. "path" then the IP of the tftp server will be the one passed by
the option 150, and the files will be retrieved under "path" on the tftp
server
2. "ip:path" then the IP of the tftp server will be the one passed in
the option "overwritting the IP from the option 150.
We could not "abuse" the rootpath option in the form or tftp://ip:path because
this is already used for other purpose by iPXE preventing any chainload from
iPXE to the FreeBSD loader.
Given at each open(), the loader loops over all available filesystems and keep
the "best" error, we needed to prevent tftpfs to fallback on nfs and vice versa.
the tftpfs and nfs implementation in libstand now return EINVAL early if
'netproto' for that purpose.
emaste [Wed, 19 Oct 2016 13:19:45 +0000 (13:19 +0000)]
MFC r306740, r307150: groff: use changelog date in man pages
r306740:
groff: use changelog date rather than file modification date in man pages
The source checkout date is not particularly relevant, and this makes
groff man pages build reproducibly.
r307150:
Avoid using 'head' in generating groff doc date
It may not be available in certain cross build cases.
Note that this is a slight change in functionality, in that now only the
first line of the source ChangeLog file is processed. This is acceptable
as groff will be retired and we won't encounter a possibly-different
ChangeLog format.
sephe [Wed, 19 Oct 2016 07:43:39 +0000 (07:43 +0000)]
MFC 307261
hyperv/stor: Fix off-by-one bug; this brings back TRIM support.
Submitted by: Hongjiang Zhang <honzhan microsoft com>
Reported by: Lili Deng <v-lide microsoft com>
Sponsored by: Microsoft
Differential Revision: https://reviews.freebsd.org/D8238