Commit Graph

194807 Commits

Author SHA1 Message Date
Konstantin Belousov
389a25c716 For posix_fallocate(2) and posix_fadvise(2), return ESPIPE when
underlying file does not have DFLAG_SEEKABLE set [1].

For posix_fallocate(2), simplify error handling logic.  Do return when
fp is not yet referenced.

Noted by:	bde [1]
Reviewed by:	jhb
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
2014-11-12 17:31:38 +00:00
Pedro F. Giffuni
33587684a6 ifdef ext2_print_inode which is not really used.
ext2_print_inode is not really used but it was nice to
have for initial development work. #ifdef it under a
new EXT2FS_DEBUG knob so that we don't spend time
compiling it.

MFC after:	3 days
2014-11-12 16:23:56 +00:00
Dag-Erling Smørgrav
7ce14e216e Fix spelling and wording. 2014-11-12 16:07:33 +00:00
Hans Petter Selasky
5bd38bcab8 Decode more fields when dumping USB descriptors.
- Some minor style changes while at it.

Submitted by:	Dmitry Luhtionov <dmitryluhtionov@gmail.com>
MFC after:	1 week
2014-11-12 14:52:44 +00:00
Andrey V. Elsukov
f3c93842bf Fix ips_out_nosa errors accounting.
MFC after:	1 week
Sponsored by:	Yandex LLC
2014-11-12 14:00:49 +00:00
Gleb Smirnoff
2b21d0e883 Merge from projects/sendfile:
- Use KASSERT()s instead of panic().
- Use sbavail() instead of sb_cc.

Sponsored by:	Nginx, Inc.
Sponsored by:	Netflix
2014-11-12 10:17:46 +00:00
Gleb Smirnoff
cfa6009e36 In preparation of merging projects/sendfile, transform bare access to
sb_cc member of struct sockbuf to a couple of inline functions:

sbavail() and sbused()

Right now they are equal, but once notion of "not ready socket buffer data",
will be checked in, they are going to be different.

Sponsored by:	Netflix
Sponsored by:	Nginx, Inc.
2014-11-12 09:57:15 +00:00
Glen Barber
b10cc05cf5 Fix an mdoc(7) macro that is not an option in the provided
description.

Bump Dd.

As CDDL License dictates, update the Copyright accordingly.

Sponsored by:	The FreeBSD Foundation
2014-11-12 08:36:42 +00:00
Luiz Otavio O Souza
82a2ce4062 Fix a few cases of use of uninitialized variables. Found with -Wall.
MFC after:	1 week
2014-11-12 03:59:26 +00:00
Luiz Otavio O Souza
0a39cc71f8 Fix the error checking, broken on r273337, to _not_ ignore controller
errors.

Without this fix you can't even scan the bus (all operations will always
succeed).

MFC with:	r273337
Pointy hat to:	loos
2014-11-12 03:07:46 +00:00
Ian Lepore
6eef1a334d Fix the reversed sense of the PADCONF_NONE test. 2014-11-12 02:44:27 +00:00
Ian Lepore
f088768b98 Remove an #ifdef DEBUG wrapper, and instead use if (bootverbose). 2014-11-12 02:38:25 +00:00
Ian Lepore
3a8af166a2 Bugfixes for the imx5/imx6 iomux fdt_pinctrl driver.
I originally overlooked a couple flag bits defined in the fdt binding docs.
One flag suppresses the pad configuration (pullup/pulldown/etc).  The other
one requires that the SION (set input on) flag be set in the mux register.

Also, it appears from the data involved that if the input register
address in the config tuple is zero, there is no input configuration.  The
old code was writing to register zero, which contains a collection of misc
control bits (having nothing to do with input configuration) that probably
shouldn't get overwritten arbitrarily.  The bindings doc doesn't explictly
mention this.
2014-11-12 02:37:27 +00:00
Alexander Motin
aec66495b4 Improve CAM's reaction on asymmetric access errors.
MFC after:	1 month
2014-11-12 01:28:28 +00:00
Marcel Moolenaar
9ba57342c9 SEEK_DATA has interesting behaviour for sparse files on ZFS. A sparse file
with 128K of random data and truncated to 800K can have SEEK_DATA return -1
when given an offset of 128K. On UFS, the SEEK_DATA returns 800K (the size
of the file). SEEK_HOLE on ZFS seems to behave the same as UFS.

To handle this, map -1 to the size of the file (`end') when lseek returns
this for either SEEK_HOLE or SEEK_DATA. When sparse files are not supported
by the file system both `hole' and `data' will now be equal to `end' and we
will treat the entire file as data. This way, the -1 return for SEEK_DATA
on ZFS will end up doing the right thing.

Reported by: gjb@

MFC after:	3 days
2014-11-12 00:10:27 +00:00
Luiz Otavio O Souza
bea71143ed Since r273264 the SD card detection on Raspberry Pi is reliably working and
that expose new bugs with HS mode.

When the old code could not do the proper card detection it would boot with
lower defaults (and no HS mode) and this makes some HS cards boots.

Now, with the card always identified as HS capable, the sdhci controller
tries to run the card at HS speeds and makes the boot always fail.

Disable the HS mode for now (which still can be enabled with the tunable)
until it is properly fixed.

MFC with:	r273264
Requested by:	many
2014-11-11 23:55:37 +00:00
Gleb Smirnoff
efe28398f5 Fix build. 2014-11-11 22:08:18 +00:00
Peter Grehan
d971cd47f6 Fix incorrect reading of 32-bit modinfo by 64-bit loaders.
The various structures in the mod_metadata set of a FreeBSD kernel and
modules contain pointers. The FreeBSD loader correctly deals with a
mismatch in loader and kernel pointer size (e.g. 32-bit i386/ppc
loader, loading 64-bit amd64/ppc64 kernels), but wasn't dealing with
the inverse case where a 64-bit loader was loading a 32-bit kernel.

Reported by:	ktcallbox@gmail.com with a bhyve/i386 and ZFS root install
Differential Revision:	https://reviews.freebsd.org/D1129
Reviewed by:	neel, jhb
MFC after:	1 week
2014-11-11 22:03:11 +00:00
Marcel Moolenaar
bab0558297 Fix text output for the uptime command.
Reported by: "Max N. Boyarov" <zotrix@bsd.by>, ae@
2014-11-11 21:52:10 +00:00
Marcel Moolenaar
a0f704ffc1 Upgrade libxo to 0.1.5
Obtained from:  https://github.com/Juniper/libxo
2014-11-11 21:37:17 +00:00
Gleb Smirnoff
0e87b36eaa Remove SF_KQUEUE code. This code was developed at Netflix, but was not
ever used.  It didn't go into stable/10, neither was documented.
It might be useful, but we collectively decided to remove it, rather
leave it abandoned and unmaintained.  It is removed in one single
commit, so restoring it should be easy, if anyone wants to reopen
this idea.

Sponsored by:	Netflix
2014-11-11 20:32:46 +00:00
John Baldwin
7bfc98355a Add device ID for the T502-BT (dual-port 1G) adapter.
Reviewed by:	np
MFC after:	1 week
2014-11-11 20:05:50 +00:00
Devin Teske
7e31e02573 Fix whitespace.
Thanks to:	nwhitehorn
2014-11-11 19:45:14 +00:00
John Baldwin
8b20d1c1c5 Move NFS and TFTP filesystems before the synthetic filesystems (bzip,
gzip, and split).  "Real" filesystems should always be listed first so
that the "bare" filename is tried before alternate filenames.  For PXE
booting in particular this can remove a lot of spurious pathname lookups.

While here, move splitfs to the bottom after the bzip and gzip filesystems
as it is the least often used.

Tested by:	Prokash Sinha <psinha@panasas.com>
MFC after:	1 week
2014-11-11 19:44:59 +00:00
Jung-uk Kim
44aba0f6c2 Use the correct device. Note this commit complements r274386.
PR:		194884
2014-11-11 19:42:10 +00:00
Devin Teske
e91afc1cda Default bsdconfig timezone' and tzsetup' to `-s' in a VM.
Recommended by:	cperciva
Reviewed by:	cperciva
Relnotes:	tzsetup and bsdconfig now assume that the "hardware" clock inside a VM is set to UTC
2014-11-11 19:37:17 +00:00
Dimitry Andric
7a3659bcac Change kbdb's kthr::cpu field into an int, to avoid gcc warnings about
comparing it with NOCPU, which became -1 recently.  While here, avoid
using it for address calculations if it is negative.

Reviewed by:	jhb, adrian
MFC after:	1 week
2014-11-11 18:54:57 +00:00
John Baldwin
858b72dbb8 Use the callout(9) API instead of timeout(9). To do this more cleanly,
convert a global timer to a per-controller timer.  This works much better
with locking and removes the need for several global lookup tables.

Tested by:	ambrisko
2014-11-11 18:15:05 +00:00
Adrian Chadd
2da2ade021 Use the correct device (child) when asking the bus layer about which power
state said device should go into.

This was a snafu introduced in the ACPI/PCI awareness separation.

When putting a device into a power state, the bus (and thus firmware,
eg ACPI) should be asked before hand to check whether the device
can indeed go into that power state.

There's a set of nodes in ACPI under each device - the _SxD nodes - which
state which ACPI power state to put the device into when the system is
going into power save state 'x'.  So when going into S3, the existence
of an _S3D node would override whatever the system was trying to do.

By default the PCI code wants to put devices into D3 before suspending.

I have a laptop here (Asus Zenbook - check the PR) whose EHCI controller
really wants to be in D2 during suspend, not D3.  So if we put it into
D3 and then try to enter S3, everything hangs.  The device itself
can go into D3 - it just can't be there when the call to ACPI to enter
S3 occurs.  The PCI patch fixes this.

jkim@ noticed that the same is needed for the ACPI child device
enumeration.

Thankyou to Matt Dillon (the programmer, not the actor) for buying me
this particular laptop so I could debug the issues with the Atheros
AR9485 that is in it.  It's his fault that I ended up with this
laptop and was sufficiently annoyed by the lack of USB suspend
to go down this rabbit hole.

Tested:

* Thinkpad T400
* Thinkpad X230
* Thinkpad T42
* Thinkpad T60
* Asus Zenbook (see PR)
* Asus EEEPC 701
* Asus EEEPC 1001PX

TODO:

* Figure out what we should do about devices we unload drivers for
  that want to be in a specific state when entering S3 / S4 -
  the "put devices into D3 if they're not bound to a driver" option
  may also mess with things.

PR:		kern/194884
Reviewed by:	jhb, jkim
MFC after:	1 week
Relnotes:	yes
Sponsored by:	Matt Dillon <dillon@apollo.backplane.com> (hardware)
2014-11-11 17:14:11 +00:00
David Christensen
1cb8f1cd72 Remove myself from bxe(4) maintenance. 2014-11-11 16:51:00 +00:00
Xin LI
2582ba5ec3 Test errno against EEXIST as well.
MFC after:	3 days
2014-11-11 16:49:33 +00:00
Ed Maste
96699e86a3 Add workaround for vt efifb's early use of PHYS_TO_DMAP
In vt_efifb_init the framebuffer's physaddr is passed to PHYS_TO_DMAP
before the DMAP is setup. The result is not actually accessed until
after the mapping is setup, though. Loosen the assertion in PHYS_TO_DMAP
for now, to allow use when dmaplimit == 0.

Reviewed by:	kib
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D1142
2014-11-11 14:59:46 +00:00
Konstantin Belousov
843c718fa7 Update comment.
Noted by:	dim
Approved by:	secteam (des)
MFC after:	4 days
2014-11-11 14:30:35 +00:00
Dag-Erling Smørgrav
136fae42a9 Fix gcc build: preserve const qualifier when casting input values.
Noticed by:	bz@
Submitted by:	dim@
2014-11-11 13:37:28 +00:00
Konstantin Belousov
a537a017e8 Initial attachment of the agp(4) to Haswell IGP. There is no handling
of cacheablility control bits in GTT PTEs yet.

Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
2014-11-11 12:56:30 +00:00
Konstantin Belousov
d6fe56e5d7 Based on some BIOS configuration (GGC register in host bridge, bit 1),
IGP may declare subclass as either VGA-compatible, or non-VGA.  The
difference is that in the later case, IGP does not claim VGA cycles.
Other than that, the device functions normally, and agp_i810 should
attach to it.

Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
2014-11-11 12:52:45 +00:00
Konstantin Belousov
a41f4046f5 On 965 and higher, map GTT as write-combining.
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
2014-11-11 12:37:13 +00:00
Hans Petter Selasky
3c7c188c16 Fix some minor TSO issues:
- Improve description of TSO limits.
- Remove a not needed KASSERT()
- Remove some not needed variable casts.

Sponsored by:	Mellanox Technologies
Discussed with:	lstewart @
MFC after:	1 week
2014-11-11 12:05:59 +00:00
Gleb Smirnoff
00f22c06e8 Move struct ether_vlan_header to ethernet.h, out of if_vlan_var.h,
since this structure is protocol definition, not part of implementation.
2014-11-11 10:22:33 +00:00
Xin LI
a31070e90d Rename variable name from 'index' to 'idx' to avoid shadowing index(3).
Noticed by:	dim
MFC after:	2 weeks
2014-11-11 05:49:57 +00:00
Pawel Jakub Dawidek
5ebb15b942 Add missing privilege check when setting the dump device. Before that change it
was possible for a regular user to setup the dump device if he had write access
to the given device. In theory it is a security issue as user might get access
to kernel's memory after provoking kernel crash, but in practise it is not
recommended to give regular users direct access to storage devices.

Rework the code so that we do privileges check within the set_dumper() function
to avoid similar problems in the future.

Discussed with:	secteam
2014-11-11 04:48:09 +00:00
Enji Cooper
0b837c87ce Revert WiP to contrib/tzcode accidentally committed with r274364 2014-11-11 04:07:41 +00:00
Enji Cooper
ad11def521 Add baud rate support to telnet(1)
This implements part of RFC-2217

It's based off a patch originally written by Sujal Patel at Isilon, and
contributions from other Isilon employees.

PR: 173728
Phabric: D995
Reviewed by: markj, markm
MFC after: 2 weeks
Sponsored by: EMC / Isilon Storage Division
2014-11-11 04:06:05 +00:00
Alexander V. Chernikov
670e8b3b8c Kill custom in_matroute() radix mathing function removing one rte mutex lock.
Initially in_matrote() in_clsroute() in their current state was introduced by
r4105 20 years ago. Instead of deleting inactive routes immediately, we kept them
in route table, setting RTPRF_OURS flag and some expire time. After that, either
GC came or RTPRF_OURS got removed on first-packet. It was a good solution
in that days (and probably another decade after that) to keep TCP metrics.
However, after moving metrics to TCP hostcache in r122922, most of in_rmx
functionality became unused. It might had been used for flushing icmp-originated
routes before rte mutexes/refcounting, but I'm not sure about that.

So it looks like this is nearly impossible to make GC do its work nowadays:

in_rtkill() ignores non-RTPRF_OURS routes.
route can only become RTPRF_OURS after dropping last reference via rtfree()
which calls in_clsroute(), which, it turn, ignores UP and non-RTF_DYNAMIC routes.

Dynamic routes can still be installed via received redirect, but they
have default lifetime (no specific rt_expire) and no one has another trie walker
to call RTFREE() on them.

So, the changelist:
* remove custom rnh_match / rnh_close matching function.
* remove all GC functions
* partially revert r256695 (proto3 is no more used inside kernel,
  it is not possible to use rt_expire from user point of view, proto3 support
  is not complete)
* Finish r241884 (similar to this commit) and remove remaining IPv6 parts

MFC after:	1 month
2014-11-11 02:52:40 +00:00
Luigi Rizzo
039dd540f5 in the Linux section, properly define the NMG_LOCK type.
Also import WITH_GENERIC in preparation to adding fine-grained
options to disable specific netmap components.
2014-11-11 00:13:28 +00:00
Luigi Rizzo
204f91dd3a - fix typo: use ring size from the rx ring, not the tx one (they should be
the same, but just in case);
- reuse the previously computed len-1 value
2014-11-11 00:10:44 +00:00
Alexander V. Chernikov
d1f79a3bfc Remove kernel handling of ICMP_SOURCEQUENCH.
It hasn't been used for a very long time.
Additionally, it was deprecated by RFC 6633.
2014-11-10 23:10:01 +00:00
Luigi Rizzo
6435a0dc1b fix a typo 2014-11-10 21:00:23 +00:00
Luigi Rizzo
4e93beff92 initialize *color if passed as an argument 2014-11-10 20:25:33 +00:00
Luigi Rizzo
db5cb21105 sync a comment with our internal repo 2014-11-10 20:19:58 +00:00