Commit Graph

203555 Commits

Author SHA1 Message Date
Mark Johnston
d73ce4c698 Remove the v_cache_min and v_cache_max sysctls. They are unused and have
no effect.

Reviewed by:	alc
Sponsored by:	EMC / Isilon Storage Division
2015-09-11 03:00:20 +00:00
Warner Losh
ad8d57a99d dev_strategy and dev_strategy_csw are unused since r281825. Remove
them.

Differential Revision: https://reviews.freebsd.org/D3620
2015-09-11 00:38:58 +00:00
Simon J. Gerraty
5ab53989f4 Handle default MAKEOBJDIR for META_MODE.
If MAKEOBJDIRPREFIX is set, use it for default OBJROOT.
If MAKEOBJDIR is empty or not a suitable value (no '/')
set a default that works.

Reviewed by: bdrewery
2015-09-11 00:19:49 +00:00
Devin Teske
27065039bc Fix argument quoting and remove unnecessary braces
MFC after:	3 weeks
X-MFC-to:	stable/10
2015-09-10 22:47:26 +00:00
Xin LI
60b0aa6a8f login.c doesn't really need libutil.h, don't include it.
login_fbtab.c includes paths.h and pathnames.h, and pathnames.h includes
paths.h.  Eliminate the paths.h inclusion in login_fbtab.c.

MFC after:	2 weeks
2015-09-10 22:25:40 +00:00
Xin LI
1e902b3b7e - Avoid accessing window properties directly, instead, use accessors.
This should be no-op for now, but allows the code to work if we
   move to NCURSES_OPAQUE.
 - Use calloc() instead of malloc+bzero.

MFC after:	2 weeks
2015-09-10 22:07:52 +00:00
John Baldwin
8fb15ddb00 Add a comment that to clarify how to determine the amount of received DDP
data.

Reviewed by:	np
Differential Revision:	https://reviews.freebsd.org/D3619
2015-09-10 21:41:11 +00:00
Konstantin Belousov
1fa6712471 Do not hold the process around the vm_fault() call from the trap()s.
The only operation which is prevented by the hold is the kernel stack
swapout for the faulted thread, which should be fine to allow.

Remove useless checks for NULL curproc or curproc->p_vmspace from the
trap_pfault() wrappers on x86 and powerpc.

Reviewed by:	alc (previous version)
Sponsored by:	The FreeBSD Foundation
MFC after:	2 weeks
2015-09-10 17:46:48 +00:00
Alexander Motin
7ac58230ea Reimplement CTL High Availability.
CTL HA functionality was originally implemented by Copan many years ago,
but large part of the sources was never published.  This change includes
clean room implementation of the missing code and fixes for many bugs.

This code supports dual-node HA with ALUA in four modes:
 - Active/Unavailable without interlink between nodes;
 - Active/Standby with second node handling only basic LUN discovery and
reservation, synchronizing with the first node through the interlink;
 - Active/Active with both nodes processing commands and accessing the
backing storage, synchronizing with the first node through the interlink;
 - Active/Active with second node working as proxy, transfering all
commands to the first node for execution through the interlink.

Unlike original Copan's implementation, depending on specific hardware,
this code uses simple custom TCP-based protocol for interlink.  It has
no authentication, so it should never be enabled on public interfaces.

The code may still need some polishing, but generally it is functional.

Relnotes:	yes
Sponsored by:	iXsystems, Inc.
2015-09-10 12:40:31 +00:00
Alexander Motin
fb606ebabc Remove unused target and initiator IDs. 2015-09-10 10:46:21 +00:00
Michael Tuexen
14914827f0 Zero out a local variable also when PURIFY is not defined.
This silence a warning brought up by valgrind whenever if_nametoindex
is used. This was already discussed in PR 166483, but the code
committed in r234329 guards the initilization with #ifdef PURIFY.
Therefore, valgrind still complains. Since this code is not performance
critical, always zero out the local variable to silence valgrind.

PR:		166483
Discussed with:	eadler@
MFC after:	4 weeks
2015-09-10 10:23:23 +00:00
Alexander Motin
3f326305fc Disable CTL_IO_DELAY feature.
It is too developer-oriented to be enabled by default.
2015-09-10 09:27:22 +00:00
Hiroki Sato
120ff2d73d Remove SIOCGDRLST_IN6 and SIOCGPRLST_IN6 forgotten in the previous commit.
MFC after:	3 days
2015-09-10 08:37:03 +00:00
Hans Petter Selasky
8c626ca5dc Update USB quirk.
MFC after:	1 month
PR:		202968
2015-09-10 07:36:54 +00:00
Hiroki Sato
65e59735e7 Use read to parse a line instead of set.
MFC after:	3 days
2015-09-10 06:56:56 +00:00
Hiroki Sato
657bbe97c1 - Add uid check.
- Report delay<0 as a warning.

MFC after:	3 days
2015-09-10 06:55:28 +00:00
Hiroki Sato
900905fdef Update only static routes when an interface is specified. This fixed
a bad side-effect reported in PR 202144.

PR:		202144
MFC after:	3 days
2015-09-10 06:47:23 +00:00
Hiroki Sato
f74237f5b6 - Remove #ifdef HAVE_POLL_H.
- Use nitems().

MFC after:	3 days
2015-09-10 06:40:28 +00:00
Hiroki Sato
e3884653f6 - Remove SIOCGDRLST_IN6 and SIOCGPRLST_IN6. These are quite old APIs and
there is no consumer now.

MFC after:	3 days
2015-09-10 06:31:24 +00:00
Hiroki Sato
d0bec2c522 - Remove SIOCGDRLST_IN6 and SIOCGPRLST_IN6. These are quite old APIs and
there is no consumer now.

- Simplify first and duplicate LLA check.

MFC after:	3 days
2015-09-10 06:29:18 +00:00
Hiroki Sato
1fce58fc62 Do not add IN6_IFF_TENTATIVE when ND6_IFF_NO_DAD.
MFC after:	3 days
2015-09-10 06:10:30 +00:00
Hiroki Sato
3ba7e4ce9c Remove IN6_IFF_NOPFX. This flag was no longer used.
MFC after:	3 days
2015-09-10 06:08:42 +00:00
Hiroki Sato
b1c250ff3f - Remove GIF_{SEND,ACCEPT}_REVETHIP.
- Simplify EADDRNOTAVAIL and EAFNOSUPPORT conditions.

MFC after:	3 days
2015-09-10 05:59:39 +00:00
Adrian Chadd
32766cd281 Also make kern.maxfilesperproc a boot time tunable.
Auto-tuning threshold discussions aside, it turns out that if you want
to lower this on say, rather memory-packed machines, you either set maxusers
or kern.maxfiles, or you set it in sysctl.  The former is a non-exact
way to tune this; the latter doesn't actually affect anything in the
startup scripts.

This first occured because I wondered why the hell screen would take upwards
of 10 seconds to spawn a new screen.  I then found python doing the same
thing during fork/exec of child processes - it calls close() on each FD
up to the current openfiles limit.  On a 1TB machine this is like, 26 million
FDs per process.  Ugh.

So:

* This allows it to be set early in /boot/loader.conf;
* It can be used to work around the ridiculous situation of
  screen, python, etc doing a close() on potentially millions of FDs
  even though you only have four open.

Tested:

* 4GB, 32GB, 64GB, 128GB, 384GB, 1TB systems with autotune, ensuring
  screen and python forking doesn't result in some pretty hilariously
  bad behaviour.

TODO:

* Note that the default login.conf sets openfiles-cur to unlimited,
  effectively obeying kern.maxfilesperproc.  Perhaps we should fix
  this.

* .. and even if we do, we need to also ensure that daemons get
  a soft limit of something reasonable and capped - they can request
  more FDs themselves.

MFC after:	1 week
Sponsored by:	Norse Corp, Inc.
2015-09-10 04:05:58 +00:00
John Baldwin
b98cb919de Use _exit() instead of exit() in child processes created during tests.
Suggested by:	kib
2015-09-09 22:54:07 +00:00
John Baldwin
368b2b1c76 Add a test to verify that a traced process sees its original parent via
getppid() after a debugger process that is not the parent has attached.

Reviewed by:	kib (earlier version)
Differential Revision:	https://reviews.freebsd.org/D3615
2015-09-09 22:42:26 +00:00
John Baldwin
479b610db5 Properly size the children[] arrays in the follow fork tests. 2015-09-09 21:18:10 +00:00
Konstantin Belousov
9e18c9eb27 For open("name", O_DIRECTORY | O_CREAT), do not try to create the
named node, open(2) cannot create directories.  But do allow the flag
combination to succeed if the directory already exists.

Declare the open("name", O_DIRECTORY | O_CREAT | O_EXCL) always
invalid for the same reason, since open(2) cannot create directory.

Note that there is an argument that O_DIRECTORY | O_CREAT should be
invalid always, regardless of the target directory existence or
O_EXCL.  The current fix is conservative and allows the call to
succeed in the situation where it succeeded before the patch.

Reported by:	Tom Ridge <freebsd@tom-ridge.com>
Reviewed by:	rwatson
PR:	 202892
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
2015-09-09 19:31:08 +00:00
Takanori Watanabe
05e526fb5a fix compare argument for address type.
Submitted by: issei10193 (via Twitter)
2015-09-09 13:24:39 +00:00
Andrew Turner
8fe99e427f Rework copyinstr to:
* Fail when the length passed in is 0
 * Remove an unneeded increment of the count on success
 * Return ENAMETOOLONG when the input pointer is too long

Sponsored by:	ABT Systems Ltd
2015-09-09 11:51:14 +00:00
Hiroki Sato
f9f9625d18 - Fix SIGSEGV when sa == NULL. NULL check in getnameinfo_inet()
did not work as expected.

- Simplify afdl table lookup.

MFC after:	3 days
2015-09-09 09:19:07 +00:00
Hans Petter Selasky
b28014dd0b Add new USB ID.
MFC after:	1 month
PR:		202968
2015-09-09 07:04:00 +00:00
Konstantin Belousov
b8db977617 Remove a check which caused spurious SIGSEGV on usermode access to the
mapped address without valid pte installed, when parallel wiring of
the entry happen.  The entry must be copy on write.  If entry is COW
but was already copied, and parallel wiring set
MAP_ENTRY_IN_TRANSITION, vm_fault() would sleep waiting for the
MAP_ENTRY_IN_TRANSITION flag to clear.  After that, the fault handler
is restarted and vm_map_lookup() or vm_map_lookup_locked() trip over
the check.  Note that this is race, if the address is accessed after
the wiring is done, the entry does not fault at all.

There is no reason in the current kernel to disallow write access to
the COW wired entry if the entry permissions allow it.  Initially this
was done in r24666, since that kernel did not supported proper
copy-on-write for wired text, which was fixed in r199869.  The r251901
revision re-introduced the r24666 fix for the current VM.

Note that write access must clear MAP_ENTRY_NEEDS_COPY entry flag by
performing COW.  In reverse, when MAP_ENTRY_NEEDS_COPY is set in
vmspace_fork(), the MAP_ENTRY_USER_WIRED flag is cleared.  Put the
assert stating the invariant, instead of returning the error.

Reported and debugging help by:	peter
Reviewed by:	alc
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
2015-09-09 06:19:33 +00:00
Xin LI
ab9cee11d6 w(1) is not setgid binary since r53279, so remove the setgid() call.
Reviewed By:	wollman
MFC after:	2 weeks
Differential Revision: https://reviews.freebsd.org/D3541
2015-09-09 05:17:04 +00:00
Justin Hibbits
dbaeb0610b Add PVR identifier for E6500, from the reference. 2015-09-09 03:15:25 +00:00
Kevin Lo
b904ffbde5 Correct setting R92C_TDECTRL_BLK_DESC_NUM_M bit. 2015-09-09 01:51:38 +00:00
Jung-uk Kim
1db13cd689 Revert r287578. This patch requires more review.
Requested by:	adrian
2015-09-08 23:17:02 +00:00
Allan Jude
2f717d09f1 Correctly case FreeBSD in my entry in the tips file
Submitted by:	feld
Approved by:	wblock (mentor)
Differential Revision:	https://reviews.freebsd.org/D3601
2015-09-08 22:51:10 +00:00
Allan Jude
1289db4899 Add an additional check to service(8) -e incase rcvar is blank
Approved by:	bapt (mentor)
X-MFC-With:	287576
Differential Revision:	https://reviews.freebsd.org/D3604
2015-09-08 22:50:17 +00:00
Baptiste Daroussin
4c79e0d6c1 Remove extra debug that crept in 2015-09-08 22:24:20 +00:00
Baptiste Daroussin
61acb4582f Implement pubkey support for the bootstrap
Note that to not interfer with finger print it expects a signature on pkg itself
which is named pkg.txz.pubkeysign

To genrate it:
echo -n "$(sha256 -q pkg.txz)" | openssl dgst -sha256 -sign /thekey \
    -binary -out ./pkg.txz.pubkeysig

Note the "echo -n" which prevent signing the '\n' one would get otherwise

PR:		202622
MFC after:	1 week
2015-09-08 21:25:36 +00:00
Jung-uk Kim
6c2f0c65c8 Enable 802.11n support.
PR:		164102
2015-09-08 21:04:33 +00:00
Jung-uk Kim
c3eac7e2b4 Sort and remove duplicate compiler flags.
MFC after:	3 days
2015-09-08 20:41:47 +00:00
Allan Jude
32047ac5fb service(8) -e does not respect /etc/rc.conf.d/* entries
PR:		173454
Submitted by:	giantlock@gmail.com (original patch)
Approved by:	bapt (mentor)
MFC after:	1 week
Relnotes:	yes
Sponsored by:	ScaleEngine Inc.
Differential Revision:	https://reviews.freebsd.org/D3600
2015-09-08 20:22:51 +00:00
Renato Botelho
22a5bb4c2a Remove duplicate entry for Sierra Wireless Aircard 875
Approved by:	loos
MFC after:	3 days
Sponsored by:	Rubicon Communications (Netgate)
2015-09-08 20:07:32 +00:00
Renato Botelho
5effc557d5 - Fix Sierra MC7354 ID from a bad copy/paste, correct ID is 68C0
Approved by:	loos
Obtained from:	pfSense
MFC after:	3 days
Sponsored by:	Rubicon Communications (Netgate)
2015-09-08 19:57:02 +00:00
Jean-Sébastien Pédron
7bead7ac28 drm/ttm: Drain taskqueue if taskqueue_cancel_timeout() returned an error
Before, this was done if `pending` was true. This is not what the
manpage suggests and not what was done elsewhere in the same file.
2015-09-08 19:41:19 +00:00
Baptiste Daroussin
b50756c759 Fix indentation, no functional changes 2015-09-08 19:25:15 +00:00
Andrew Turner
b5e4c5c456 Enable mincore_test on arm64, we now have a working pmap_mincore.
PR:		202307
Obtained from:	ABT Systems Ltd
Sponsored by:	The FreeBSD Foundation
2015-09-08 18:44:12 +00:00
Andrew Turner
384dd3be15 Add support for pmap_mincore on arm64 by walking the page tables to find
the details for the requested address.

PR:		202307
Obtained from:	ABT Systems Ltd
Sponsored by:	The FreeBSD Foundation
2015-09-08 18:41:06 +00:00