]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
6 years agoFix boot_pages exhaustion on machines with many domains and cores, where
glebius [Fri, 9 Feb 2018 04:45:39 +0000 (04:45 +0000)]
Fix boot_pages exhaustion on machines with many domains and cores, where
size of UMA zone allocation is greater than page size. In this case zone
of zones can not use UMA_MD_SMALL_ALLOC, and we  need to postpone switch
off of this zone from startup_alloc() until full launch of VM.

o Always supply number of VM zones to uma_startup_count(). On machines
  with UMA_MD_SMALL_ALLOC ignore it completely, unless zsize goes over
  a page. In the latter case account VM zones for number of allocations
  from the zone of zones.
o Rewrite startup_alloc() so that it will immediately switch off from
  itself any zone that is already capable of running real alloc.
  In worst case scenario we may leak a single page here. See comment
  in uma_startup_count().
o Hardcode call to uma_startup2() into vm_mem_init(). Otherwise some
  extra SYSINITs, e.g. vm_page_init() may sneak in before.
o While here, remove uma_boot_pages_mtx. With recent changes to boot
  pages calculation, we are guaranteed to use all of the boot_pages
  in the early single threaded stage.

Reported & tested by: mav

6 years agoSet script.lang in the environment to either 'forth' or 'simple' to
imp [Fri, 9 Feb 2018 00:36:55 +0000 (00:36 +0000)]
Set script.lang in the environment to either 'forth' or 'simple' to
reflect what scripting language was compiled into the loader. I
anticipate that being able to find this out quickly from the OK prompt
will be useful in troubleshooting in the future.

6 years agoFix ICMPv6 redirects
vangyzen [Fri, 9 Feb 2018 00:13:05 +0000 (00:13 +0000)]
Fix ICMPv6 redirects

icmp6_redirect_input() validates that a redirect packet came from the
current gateway for the respective destination.  To do this, it compares
the source address, which has an embedded scope zone id, to the next-hop
address, which does not.  If the address is link-local, which should be
the case, the comparison fails and the redirect is ignored.

Insert the scope zone id into the next-hop address so the comparison
is accurate.

Unsurprisingly, this fixes 35 UNH IPv6 conformance test cases.

Submitted by: Farrell Woods <Farrell_Woods@Dell.com> (initial revision)
Reviewed by: ae melifaro dab
MFC after: 1 week
Relnotes: yes
Sponsored by: Dell EMC
Differential Revision: https://reviews.freebsd.org/D14254

6 years agoInclude files missed in 329051.
mckusick [Thu, 8 Feb 2018 23:14:24 +0000 (23:14 +0000)]
Include files missed in 329051.

6 years agoThe goal of this change is to prevent accidental foot shooting by
mckusick [Thu, 8 Feb 2018 23:06:58 +0000 (23:06 +0000)]
The goal of this change is to prevent accidental foot shooting by
folks running filesystems created on check-hash enabled kernels
(which I will call "new") on a non-check-hash enabled kernels (which
I will call "old). The idea here is to detect when a filesystem is
run on an old kernel and flag the filesystem so that when it gets
moved back to a new kernel, it will not start getting a slew of
check-hash errors.

Back when the UFS version 2 filesystem was created, it added a file
flag FS_INDEXDIRS that was to be set on any filesystem that kept
some sort of on-disk indexing for directories. The idea was precisely
to solve the issue we have today. Specifically that a newer kernel
that supported indexing would be able to tell that the filesystem
had been run on an older non-indexing kernel and that the indexes
should not be used until they had been rebuilt. Since we have never
implemented on-disk directory indicies, the FS_INDEXDIRS flag is
cleared every time any UFS version 2 filesystem ever created is
mounted for writing.

This commit repurposes the FS_INDEXDIRS flag as the FS_METACKHASH
flag. Thus, the FS_METACKHASH is definitively known to have always
been cleared. The FS_INDEXDIRS flag has been moved to a new block
of flags that will always be cleared starting with this commit
(until they get used to implement some future feature which needs
to detect that the filesystem was mounted on a kernel that predates
the new feature).

If a filesystem with check-hashes enabled is mounted on an old
kernel the FS_METACKHASH flag is cleared. When that filesystem is
mounted on a new kernel it will see that the FS_METACKHASH has been
cleared and clears all of the fs_metackhash flags. To get them
re-enabled the user must run fsck (in interactive mode without the
-y flag) which will ask for each supported check hash whether it
should be rebuilt and enabled. When fsck is run in its default preen
mode, it will just ignore the check hashes so they will remain
disabled.

The kernel has always disabled any check hash functions that it
does not support, so as more types of check hashes are added, we
will get a non-surprising result. Specifically if filesystems get
moved to kernels supporting fewer of the check hashes, those that
are not supported will be disabled. If the filesystem is moved back
to a kernel with more of the check-hashes available and fsck is run
interactively to rebuild them, then their checking will resume.
Otherwise just the smaller subset will be checked.

A side effect of this commit is that filesystems running with
cylinder-group check hashes will stop having them checked until
fsck is run to re-enable them (since none of them currently have
the FS_METACKHASH flag set). So, if you want check hashes enabled
on your filesystems after booting a kernel with these changes, you
need to run fsck to enable them. Any newly created filesystems will
have check hashes enabled. If in doubt as to whether you have check
hashes emabled, run dumpfs and look at the list of enabled flags
at the end of the superblock details.

6 years agoFix build of userboot.so
imp [Thu, 8 Feb 2018 22:59:51 +0000 (22:59 +0000)]
Fix build of userboot.so

Since it's not possible to unset a variable easily, create a new
variable 'PIC' to signal that we are creating a shared object that we
want to install. defs.mk refains from defining NO_PIC and ITNERALLIB
when PIC is defined. This unbreaks userboot.so building.

6 years agoPull in r324594 from upstream clang trunk (by Alexander Ivchenko):
dim [Thu, 8 Feb 2018 21:11:48 +0000 (21:11 +0000)]
Pull in r324594 from upstream clang trunk (by Alexander Ivchenko):

  Fix for #31362 - ms_abi is implemented incorrectly for values >=16
  bytes.

  Summary:
  This patch is a fix for following issue:
  https://bugs.llvm.org/show_bug.cgi?id=31362 The problem was caused by
  front end lowering C calling conventions without taking into account
  calling conventions enforced by attribute. In this case win64cc was
  no correctly lowered on targets other than Windows.

  Reviewed By: rnk (Reid Kleckner)

  Differential Revision: https://reviews.llvm.org/D43016

  Author: belickim <mateusz.belicki@intel.com>

This fixes clang 6.0.0 assertions when building the emulators/wine and
emulators/wine-devel ports, and should also make it use the correct
Windows calling conventions.  Bump __FreeBSD_version to make the fix
easy to detect.

PR: 224863
MFC after: 3 months
X-MFC-With: r327952

6 years agoModernize nfssvc(2) registartion.
brooks [Thu, 8 Feb 2018 20:09:42 +0000 (20:09 +0000)]
Modernize nfssvc(2) registartion.

Use syscall_helper_register() to register syscalls and do it through the
module interface rather than sysinit.

This pattern is more common and easier to understand.

Reviewed by: jhb
Sponsored by: DARPA, AFRL
Differential Revision: https://reviews.freebsd.org/D14232

6 years agoRemove c_rehash(1) to not confuse users. We do not install the Perl script.
jkim [Thu, 8 Feb 2018 19:55:03 +0000 (19:55 +0000)]
Remove c_rehash(1) to not confuse users.  We do not install the Perl script.

MFC after: 3 days

6 years agoUse vm_page_unwire_noq() instead of directly modifying page wire counts.
markj [Thu, 8 Feb 2018 19:28:51 +0000 (19:28 +0000)]
Use vm_page_unwire_noq() instead of directly modifying page wire counts.

No functional change intended.

Reviewed by: alc, kib (previous revision)
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D14266

6 years agoMFV: r329021
jkim [Thu, 8 Feb 2018 19:26:52 +0000 (19:26 +0000)]
MFV: r329021

Belatedly remove an empty directory.

6 years agoMove to tabs for indentation and to 8-space notches, per style(9).
imp [Thu, 8 Feb 2018 17:07:27 +0000 (17:07 +0000)]
Move to tabs for indentation and to 8-space notches, per style(9).

4 space indentation with a mix of tabs and spaces is a hassle. Update
to project-standard hard-tabs with 8-space indentation in these files.
This matches the new code coming in better as well.

6 years agosu_data: correct macro expansion.
pfg [Thu, 8 Feb 2018 14:53:34 +0000 (14:53 +0000)]
su_data: correct macro expansion.

Protect su_data() users from strange macro expansion.

Obtained from: linux libtirpc

6 years agoremove a duplicate assignment
avg [Thu, 8 Feb 2018 13:22:40 +0000 (13:22 +0000)]
remove a duplicate assignment

There should be no functional change.

MFC after: 1 week

6 years agoTemporarily widen count for interrupt rate calculations on 32-bit archs
jhibbits [Thu, 8 Feb 2018 05:18:30 +0000 (05:18 +0000)]
Temporarily widen count for interrupt rate calculations on 32-bit archs

If the interrupt count is very high (greater than ~42M), notably on one-shot
execution on long running systems, the intermediate multiplication step in the
rate calculation will overflow the width of a 32-bit architecture long (32
bits), causing the rest of the calculation to calculate with a truncated value,
and report very low rates (sometimes 0).

MFC after: 2 weeks

6 years agomountd(8): Produce vaguely meaningful error messages
cem [Thu, 8 Feb 2018 01:34:35 +0000 (01:34 +0000)]
mountd(8): Produce vaguely meaningful error messages

Sponsored by: Dell EMC Isilon

6 years agostyle(9): use a type for each member in struct defintions.
brooks [Thu, 8 Feb 2018 00:42:28 +0000 (00:42 +0000)]
style(9): use a type for each member in struct defintions.

Shorten a comment to fit in 80 columns.

6 years agoAdd myself to committers-src.dot
jeb [Thu, 8 Feb 2018 00:14:20 +0000 (00:14 +0000)]
Add myself to committers-src.dot

Reviewed by: erj (mentor)
Approved by: erj (mentor)

6 years agold.lld.1: explain long options may use one or two dashes
emaste [Thu, 8 Feb 2018 00:09:17 +0000 (00:09 +0000)]
ld.lld.1: explain long options may use one or two dashes

6 years agoUpdate ld.lld.1 based on the version committed upstream
emaste [Wed, 7 Feb 2018 23:58:00 +0000 (23:58 +0000)]
Update ld.lld.1 based on the version committed upstream

6 years agoRemove part of a comment reverting to nonexistant struct members.
brooks [Wed, 7 Feb 2018 23:45:13 +0000 (23:45 +0000)]
Remove part of a comment reverting to nonexistant struct members.

6 years agoMove simple interpreter 'perform' into interp.c and call it
imp [Wed, 7 Feb 2018 23:27:38 +0000 (23:27 +0000)]
Move simple interpreter 'perform' into interp.c and call it
interp_builtin_cmd().

6 years agoFix indentation to FreeBSD standard for interp files
imp [Wed, 7 Feb 2018 23:27:25 +0000 (23:27 +0000)]
Fix indentation to FreeBSD standard for interp files

6 years agoexec_map_first_page: fix an inverse condition introduced in r254138
avg [Wed, 7 Feb 2018 21:51:59 +0000 (21:51 +0000)]
exec_map_first_page: fix an inverse condition introduced in r254138

While the bug itself was serious, as we could either pass a non-busied
page to vm_pager_get_pages() or leak a busy page, it could only be
triggered under a very rare condition where the page is already inserted
into the object, but it is not valid yet.

Reviewed by: kib
MFC after: 2 weeks

6 years agoFix the WITH_SORT_THREADS build.
markj [Wed, 7 Feb 2018 20:36:37 +0000 (20:36 +0000)]
Fix the WITH_SORT_THREADS build.

PR: 201664
MFC after: 1 week

6 years agoiw_cxgbe: Remove declaration of a function that no longer exists.
np [Wed, 7 Feb 2018 20:13:08 +0000 (20:13 +0000)]
iw_cxgbe: Remove declaration of a function that no longer exists.

6 years agoMove the stand/usb test loader into its own directory.
hselasky [Wed, 7 Feb 2018 19:20:59 +0000 (19:20 +0000)]
Move the stand/usb test loader into its own directory.
Fix its Makefile to build correctly.

MFC after: 1 week
Sponsored by: Mellanox Technologies

6 years agoRemove duplicate #include <netinet/ip_var.h>.
ae [Wed, 7 Feb 2018 19:12:05 +0000 (19:12 +0000)]
Remove duplicate #include <netinet/ip_var.h>.

6 years agoRework ipfw dynamic states implementation to be lockless on fast path.
ae [Wed, 7 Feb 2018 18:59:54 +0000 (18:59 +0000)]
Rework ipfw dynamic states implementation to be lockless on fast path.

o added struct ipfw_dyn_info that keeps all needed for ipfw_chk and
  for dynamic states implementation information;
o added DYN_LOOKUP_NEEDED() macro that can be used to determine the
  need of new lookup of dynamic states;
o ipfw_dyn_rule now becomes obsolete. Currently it used to pass
  information from kernel to userland only.
o IPv4 and IPv6 states now described by different structures
  dyn_ipv4_state and dyn_ipv6_state;
o IPv6 scope zones support is added;
o ipfw(4) now depends from Concurrency Kit;
o states are linked with "entry" field using CK_SLIST. This allows
  lockless lookup and protected by mutex modifications.
o the "expired" SLIST field is used for states expiring.
o struct dyn_data is used to keep generic information for both IPv4
  and IPv6;
o struct dyn_parent is used to keep O_LIMIT_PARENT information;
o IPv4 and IPv6 states are stored in different hash tables;
o O_LIMIT_PARENT states now are kept separately from O_LIMIT and
  O_KEEP_STATE states;
o per-cpu dyn_hp pointers are used to implement hazard pointers and they
  prevent freeing states that are locklessly used by lookup threads;
o mutexes to protect modification of lists in hash tables now kept in
  separate arrays. 65535 limit to maximum number of hash buckets now
  removed.
o Separate lookup and install functions added for IPv4 and IPv6 states
  and for parent states.
o By default now is used Jenkinks hash function.

Obtained from: Yandex LLC
MFC after: 42 days
Sponsored by: Yandex LLC
Differential Revision: https://reviews.freebsd.org/D12685

6 years agoA more definitions to kernel emulation shim in order to build stand/usb.
hselasky [Wed, 7 Feb 2018 18:50:36 +0000 (18:50 +0000)]
A more definitions to kernel emulation shim in order to build stand/usb.

MFC after: 1 week
Sponsored by: Mellanox Technologies

6 years agoFix relative location of USB sources after recent move.
hselasky [Wed, 7 Feb 2018 18:49:06 +0000 (18:49 +0000)]
Fix relative location of USB sources after recent move.

MFC after: 1 week
Sponsored by: Mellanox Technologies

6 years agoGive USB template SYSUNINIT()'s a uniq name to avoid symbol name collision
hselasky [Wed, 7 Feb 2018 18:46:08 +0000 (18:46 +0000)]
Give USB template SYSUNINIT()'s a uniq name to avoid symbol name collision
when building stand/usb. Regression after r328194.

MFC after: 1 week
Sponsored by: Mellanox Technologies

6 years agoCull Atmel board configs no longer relevant.
imp [Wed, 7 Feb 2018 18:33:53 +0000 (18:33 +0000)]
Cull Atmel board configs no longer relevant.

Remove most of the Atmel at91 boards. Most of them are no longer
relevant or used by people. Kept ATMEL since it should work on all the
boards that still work (I've not confirmed this, since I don't have
all these boards). Also kept SAM9G20EK, since I have several boards
that it is used on. If I've deleted a kernel in error, please let me
know.

6 years agoFix cut and pasted comments to reflect differences in code from the
imp [Wed, 7 Feb 2018 18:33:46 +0000 (18:33 +0000)]
Fix cut and pasted comments to reflect differences in code from the
original source.

Sponsored by: Netflix

6 years agoFix three miscalculations in amount of boot pages:
glebius [Wed, 7 Feb 2018 18:32:51 +0000 (18:32 +0000)]
Fix three miscalculations in amount of boot pages:

o Most of startup zones have struct uma_slab embedded into the slab,
  so provide macro UMA_SLAB_SPACE and use it instead of UMA_SLAB_SIZE,
  when calculating how many pages would certain kind of allocations
  require. Some zones are offpage, so we might have a positive inaccuracy.
o The keg for the zone of zones is allocated "dynamically", so we
  need +1 when calculating amount of pages for kegs. [1]
o The zones of zones and zones of kegs have arbitrary alignment of 32,
  and this also needs to be accounted for. [2]

While here, spread more comments and improve diagnostic messages.

Reported by: pho [1], jtl [2]

6 years agoFix broken SPDX comment in usr.bin/lex/initparse.c
arichardson [Wed, 7 Feb 2018 17:09:12 +0000 (17:09 +0000)]
Fix broken SPDX comment in usr.bin/lex/initparse.c

Approved By: jhb (mentor)

6 years agoFix compilation of mips_postboot_fixup() with a C11 compiler
arichardson [Wed, 7 Feb 2018 16:58:01 +0000 (16:58 +0000)]
Fix compilation of mips_postboot_fixup() with a C11 compiler

The _Alignas specifier must come before the declaration and not after. It
works if _Alignas() expands to __attribute__(aligned(x)) which was the only
case I tested before.

Approved By: jhb (mentor)

6 years agoDequeue wired pages lazily.
markj [Wed, 7 Feb 2018 16:57:10 +0000 (16:57 +0000)]
Dequeue wired pages lazily.

Previously, wiring a page would cause it to be removed from its page
queue. In the common case, unwiring causes it to be enqueued at the tail
of that page queue. This change modifies vm_page_wire() to not dequeue
the page, thus avoiding the highly contended page queue locks. Instead,
vm_page_unwire() takes care of requeuing the page as a single operation,
and the page daemon dequeues wired pages as they are encountered during
a queue scan to avoid needlessly revisiting them later. For pages in
PQ_ACTIVE we do even better, since a requeue is unnecessary.

The change improves scalability for some common workloads. For instance,
threads wiring pages into the buffer cache no longer need to modify
global page queues, and unwiring is usually done by the bufspace thread,
so concurrency is not as much of an issue. As another example, many
sysctl handlers wire the output buffer to avoid faults on copyout, and
since the buffer is likely to be in PQ_ACTIVE, we now entirely avoid
modifying the page queue in this case.

The change also adds a block comment describing some properties of
struct vm_page's reference counters, and the busy lock.

Reviewed by: jeff
Discussed with: alc, kib
MFC after: 1 month
Differential Revision: https://reviews.freebsd.org/D11943

6 years agoAdd a note about why we have the conditional before including
imp [Wed, 7 Feb 2018 16:28:26 +0000 (16:28 +0000)]
Add a note about why we have the conditional before including
bsd.compiler.mk. It's so fmake from older 9.x systems still
works (still a supported build config, and having the note here
will let us know when we can cull it more easily).

Also pull in a related change from include to sinclude from
arichardson@'s cross building work, as well as it's companion in
Makefile.inc1 with a note about why we do the odd thing there.

Submitted by: archardson
Differential Revision: https://reviews.freebsd.org/D14241

6 years agoadd retpoline compiler and linker feature flags
emaste [Wed, 7 Feb 2018 14:50:06 +0000 (14:50 +0000)]
add retpoline compiler and linker feature flags

These features indicate that the compiler and linker support the
retpoline speculative execution vulnerability (CVE-2017-5715)
mitigation.

Reviewed by: dim, imp
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D14228

6 years agoFix implementation of ktime_add_ns() and ktime_sub_ns() in the LinuxKPI to
hselasky [Wed, 7 Feb 2018 12:12:06 +0000 (12:12 +0000)]
Fix implementation of ktime_add_ns() and ktime_sub_ns() in the LinuxKPI to
actually return the computed result instead of the input value.

This is a regression issue after r289572.

Found by: gcc6
MFC after: 3 days
Sponsored by: Mellanox Technologies

6 years ago[ath] Use the BSSID address logic for STA VAPs too.
adrian [Wed, 7 Feb 2018 09:37:22 +0000 (09:37 +0000)]
[ath] Use the BSSID address logic for STA VAPs too.

For DWDS VAPs on ath(4) we need to ensure that the STA vap and hostap VAP
have different MAC addresses.  If the STA code path doesn't utilise the
address assign / reclaim path then it doesn't update the bitmap with which
address was allocated.

This should fix a bunch of corner issues I've been seeing with DWDS STA + AP
VAPs that I was working around with manual MAC address assignment.

6 years ago[ar71xx] Fix the TL-wdr3600/tl-wdr4300 hints in the new world order.
adrian [Wed, 7 Feb 2018 09:35:47 +0000 (09:35 +0000)]
[ar71xx] Fix the TL-wdr3600/tl-wdr4300 hints in the new world order.

Tested:

* tl-wdr4300

6 years agoif_awg: Skip emac reset if configured for internal PHY
kevans [Wed, 7 Feb 2018 01:54:13 +0000 (01:54 +0000)]
if_awg: Skip emac reset if configured for internal PHY

On the OrangePi One at least, emac reset when an ethernet cable is not
plugged in seems to break ethernet. Soft reset will fail, even with
increasing the delay and retries to wait for up to 20 seconds. This can be
reproduced across at least two different OrangePi One's by simply leaving
ethernet cable unplugged when awg attaches. Whether it's plugged in or not
through u-boot process makes no difference.

Skipping the reset in this configuration doesn't seem to cause any problems,
tried across many many reboots with and without ethernet cable plugged in.

Tested on: OrangePi One
Tested on: Other boards (manu)
Reviewed by: manu
Differential Revision: https://reviews.freebsd.org/D13974

6 years agoKeep a counter for number of requests completed with an error.
imp [Tue, 6 Feb 2018 23:21:08 +0000 (23:21 +0000)]
Keep a counter for number of requests completed with an error.

Sponsored by: Netflix

6 years agofsync.2: Cross-reference fsync(1)
cem [Tue, 6 Feb 2018 23:12:47 +0000 (23:12 +0000)]
fsync.2: Cross-reference fsync(1)

Reported by: rpokala
Sponsored by: Dell EMC Isilon

6 years agoAvoid find -s, use find | sort instead.
imp [Tue, 6 Feb 2018 23:12:16 +0000 (23:12 +0000)]
Avoid find -s, use find | sort instead.

find -s was introduced to make the metalog more
deterministic. However, find -s is not portable. find | sort is
portable and accomplishes the same goals, even if it isn't
pedantically the same. TZS is the same before / after the change so
any fussy differences between the two are moot and there won't be
METALOG churn across this change.

Differential Revision: https://reviews.freebsd.org/D14231

6 years ago{ext2|ufs}_readdir: Avoid setting negative ncookies.
pfg [Tue, 6 Feb 2018 22:38:19 +0000 (22:38 +0000)]
{ext2|ufs}_readdir: Avoid setting negative ncookies.

ncookies cannot be negative or the allocator will fail. This should only
happen if a caller is very broken but we can still try to survive the
event.

We should probably also verify for uio_resid > MAXPHYS but in that case
it is not clear that just clipping the ncookies value is an adequate
response.

MFC after: 2 weeks

6 years agoUse const pointers for input data not modified by clock utility functions.
ian [Tue, 6 Feb 2018 22:17:01 +0000 (22:17 +0000)]
Use const pointers for input data not modified by clock utility functions.

6 years agoUse correct arithmetic to calculate how many pages we need for kegs
glebius [Tue, 6 Feb 2018 22:13:40 +0000 (22:13 +0000)]
Use correct arithmetic to calculate how many pages we need for kegs
and hashes.  There is no functional change with current sizes.

6 years agoUse per-domain locks for vm page queue free. Move paging control from
jeff [Tue, 6 Feb 2018 22:10:07 +0000 (22:10 +0000)]
Use per-domain locks for vm page queue free.  Move paging control from
global to per-domain state.  Protect reservations with the free lock
from the domain that they belong to.  Refactor to make vm domains more
of a first class object.

Reviewed by:    markj, kib, gallatin
Tested by:      pho
Sponsored by:   Netflix, Dell/EMC Isilon
Differential Revision:  https://reviews.freebsd.org/D14000

6 years agoImprove DIAGNOSTIC printf. Report using a boot page every time regardless
glebius [Tue, 6 Feb 2018 22:08:43 +0000 (22:08 +0000)]
Improve DIAGNOSTIC printf.  Report using a boot page every time regardless
of booted status.

6 years agoFix boot_pages calculation for machines that don't have UMA_MD_SMALL_ALLOC.
glebius [Tue, 6 Feb 2018 22:06:59 +0000 (22:06 +0000)]
Fix boot_pages calculation for machines that don't have UMA_MD_SMALL_ALLOC.

o Call uma_startup1() after initializing kmem, vmem and domains.
o Include 8 eight VM startup pages into uma_startup_count() calculation.
o Account for vmem_startup() and vm_map_startup() preallocating pages.
o Account for extra two allocations done by kmem_init() and vmem_create().
o Hardcode the place of execution of vm_radix_reserve_kva(). Using SYSINIT
  allowed several other SYSINITs to sneak in before it, thus bumping
  requirement for amount of boot pages.

6 years agoRefactor cleanvar to remove shell expansion vulnerability
feld [Tue, 6 Feb 2018 21:35:41 +0000 (21:35 +0000)]
Refactor cleanvar to remove shell expansion vulnerability

If any process creates a directory named "-P" in /var/run or
/var/spool/lock it will cause the purgedir function to start to rm -r /.

Simplify a lot of complicated shell logic by leveraging find(1).

Reviewed by: allanjude
MFC after: 3 days
Differential Revision: https://reviews.freebsd.org/D13778

6 years agoCache the value of the request and reply frame size since it's used quite
scottl [Tue, 6 Feb 2018 21:01:38 +0000 (21:01 +0000)]
Cache the value of the request and reply frame size since it's used quite
a bit in the normal operation of the driver.  Covert it to represent bytes
instead of 32bit words.  Fix what I believe to be is a bug in this respect
with the Tri-mode cards.

Sponsored by: Netflix

6 years agoFix firstboot fs mount logic
feld [Tue, 6 Feb 2018 20:12:05 +0000 (20:12 +0000)]
Fix firstboot fs mount logic

The firstboot logic has an error which causes the filesystem to be
mounted readonly even though root_rw_mount=YES. This fixes the error to
ensure that the root filesystem is mounted rw as expected after the run
of the firstboot scripts.

Reviewed by: imp
MFC after: 3 days
Differential Revision: https://reviews.freebsd.org/D14226

6 years agoRemove a trailing whitspace.
bz [Tue, 6 Feb 2018 19:14:15 +0000 (19:14 +0000)]
Remove a trailing whitspace.

6 years agoDelete a declaration for a variable removed in r305362.
markj [Tue, 6 Feb 2018 17:26:11 +0000 (17:26 +0000)]
Delete a declaration for a variable removed in r305362.

6 years agoUse a workaround to compile the crt init functions correctly with clang.
jhb [Tue, 6 Feb 2018 17:01:10 +0000 (17:01 +0000)]
Use a workaround to compile the crt init functions correctly with clang.

The MIPS assembly parser treats forward-declared local symbols as global
symbols.  This results in CALL16 relocations being used against local
(private) symbols which then fail to resolve when linking binaries.
Add .local to force the init and fini functions to be treated as local as
a workaround.

Submitted by: sbruno
Sponsored by: DARPA / AFRL

6 years agoSimplify synchronization read error handling.
markj [Tue, 6 Feb 2018 16:02:33 +0000 (16:02 +0000)]
Simplify synchronization read error handling.

Since synchronization reads are performed by submitting a request to
the external mirror provider, we know that the request returns with an
error only when gmirror was unable to read a copy of the block from any
mirror. Thus, there is no need to retry the request from the
synchronization error handler.

Tested by: pho
MFC after: 2 weeks
Sponsored by: Dell EMC Isilon

6 years agoFix queue length reporting in mps(4) and mpr(4).
mav [Tue, 6 Feb 2018 16:02:25 +0000 (16:02 +0000)]
Fix queue length reporting in mps(4) and mpr(4).

Both drivers were found to report CAM bigger queue depth then they really
can handle.  It made them later under high load with many disks return
some of submitted requests back with CAM_REQUEUE_REQ status for later
resubmission.

Reviewed by: scottl
MFC after: 1 week
Sponsored by: iXsystems, Inc.
Differential Revision: https://reviews.freebsd.org/D14215

6 years agoDiagnostic buffer fixes for the mps(4) and mpr(4) drivers.
ken [Tue, 6 Feb 2018 15:58:22 +0000 (15:58 +0000)]
Diagnostic buffer fixes for the mps(4) and mpr(4) drivers.

In mp{r,s}_diag_register(), which is used to register diagnostic
buffers with the mp{r,s}(4) firmware, we allocate DMAable memory.

There were several issues here:
 o No checking of the bus_dmamap_load() return value.  If the load
   failed or got deferred, mp{r,s}_diag_register() continued on as if
   nothing had happened.  We now check the return value and bail
   out if it fails.

 o No waiting for a deferred load callback.  bus_dmamap_load()
   calls a supplied callback when the mapping is done.  This is
   generally done immediately, but it can be deferred.
   mp{r,s}_diag_register() did not check to see whether the callback
   was already done before proceeding on.  We now sleep until the
   callback is done if it is deferred.

 o No call to bus_dmamap_sync(... BUS_DMASYNC_PREREAD) after the
   memory is allocated and loaded.  This is necessary on some
   platforms to synchronize host memory that is going to be updated
   by a device.

Both drivers would also panic if the firmware was reinitialized while
a diagnostic buffer operation was in progress.  This fixes that problem
as well.  (The driver will reinitialize the firmware in various
circumstances, but the problem I ran into was that the firmware would
generate an IOC Fault due to a PCIe error.)

mp{r,s}var.h:
Add a new structure, struct mpr_busdma_context, that is
used for deferred busdma load callbacks.

Add a prototype for mp{r,s}_memaddr_wait_cb().
mp{r,s}.c:
Add a new busdma callback function, mp{r,s}_memaddr_wait_cb().
This provides synchronization for callers that want to
wait on a deferred bus_dmamap_load() callback.

mp{r,s}_user.c:
In bus_dmamap_register(), add a call to bus_dmamap_sync()
with the BUS_DMASYNC_PREREAD flag set after an allocation
is loaded.

Also, check the return value of bus_dmamap_load().  If it
fails, bail out.  If it is EINPROGRESS, wait for the
callback to happen.  We use an interruptible sleep (msleep
with PCATCH) and let the callback clean things up if we get
interrupted.

In mpr_diag_read_buffer() and mps_diag_read_buffer(), call
bus_dmamap_sync(..., BUS_DMASYNC_POSTREAD) before copying
the data out to make sure the data is in stable storage.

In mp{r,s}_post_fw_diag_buffer() and
mp{r,s}_release_fw_diag_buffer(), check the reply to see
whether it is NULL.  It can be NULL (and the command non-NULL)
if the controller gets reinitialized while we're waiting for
the command to complete but the driver structures aren't
reallocated.  The driver structures generally won't be
reallocated unless there is a firmware upgrade that changes
one of the IOCFacts.

When freeing diagnostic buffers in mp{r,s}_diag_register()
and mp{r,s}_diag_unregister(), zero/NULL out the buffer after
freeing it.  This will prevent a duplicate free in some
situations.

Sponsored by: Spectra Logic
Reviewed by: mav, scottl
MFC after: 1 week
Differential Revision: D13453

6 years agocrossbuild: Make the CHECK_TIME variable work on Linux
arichardson [Tue, 6 Feb 2018 15:41:45 +0000 (15:41 +0000)]
crossbuild: Make the CHECK_TIME variable work on Linux

Linux /usr/bin/find doesn't understand the -mtime -0s flag.
Instead create a temporary file and compare that file's mtime to
sys/sys/param.h to check whether the clock is correct.

Reviewed By: jhb, imp
Approved By: jhb (mentor)
Differential Revision: https://reviews.freebsd.org/D14157

6 years agoDon't hardcode /usr/bin as the path for mktemp in build tools
arichardson [Tue, 6 Feb 2018 15:41:35 +0000 (15:41 +0000)]
Don't hardcode /usr/bin as the path for mktemp in build tools

It won't work e.g. when crossbuilding from Ubuntu Linux as mktemp is in
/bin there.

Reviewed By: bdrewery
Approved By: jhb (mentor)
Differential Revision: https://reviews.freebsd.org/D13937

6 years agoAllow compiling usr.bin/find on Linux and Mac
arichardson [Tue, 6 Feb 2018 15:41:26 +0000 (15:41 +0000)]
Allow compiling usr.bin/find on Linux and Mac

When building FreeBSD the makefiles invoke find with various flags such as
`-s` that aren't supported in the native /usr/bin/find. To fix this I
build the FreeBSD version of find and use that when crossbuilding.

Inserting lots if #ifdefs in the code is rather ugly but I don't see a
better solution.

Reviewed By: brooks (mentor)
Approved By: jhb (mentor)
Differential Revision: https://reviews.freebsd.org/D13306

6 years agoMake mips_postboot_fixup work when building the kernel with clang+lld
arichardson [Tue, 6 Feb 2018 15:41:15 +0000 (15:41 +0000)]
Make mips_postboot_fixup work when building the kernel with clang+lld

The compiler/linker can align fake_preload anyway it would like. When
building the kernel with gcc+bfd this always happened to be a multiple of 8.
When I built the kernel with clang and linked with lld fake_preload
happened to only be aligned to 4 bytes which caused a an ADDRS trap because
the compiler will emit sd instructions to store to this buffer.

Reviewed By: jhb, imp
Approved By: jhb (mentor)
Differential Revision: https://reviews.freebsd.org/D14018

6 years ago- Document new ${name}_limits rc.conf option
amdmi3 [Tue, 6 Feb 2018 15:30:17 +0000 (15:30 +0000)]
- Document new ${name}_limits rc.conf option

Approved by: cy
MFC after: 2 weeks (along with 328331 which introduced this option)
Differential Revision: https://reviews.freebsd.org/D14028

6 years agodtb/allwinner: Add sun7i-a20-lamobo-r1.dts (Banana Pi R1)
kevans [Tue, 6 Feb 2018 14:57:03 +0000 (14:57 +0000)]
dtb/allwinner: Add sun7i-a20-lamobo-r1.dts (Banana Pi R1)

FreeBSD boots on this board, but the ethernet switch is not currently
supported, resulting in no ethernet.

A U-Boot port will be added once the ethernet switch is at least basically
supported, but we add its DTS to the build here to lower the barrier-to-boot
while work is underway.

6 years agoRemove libreadline from the source tree, all consumers but gdb
bapt [Tue, 6 Feb 2018 12:22:42 +0000 (12:22 +0000)]
Remove libreadline from the source tree, all consumers but gdb
has been switched to libedit long ago, libreadline was built as an
internallib for a while and kept only for gdbtui which was broken using
libreadline.

Since gdb has been mostly deorbitted in all arches, gdbtui was only installed
on arm and sparc64, given it has been removed, gdb has been switched to use
libedit, no consumers are left for libreadline. Thus this removal

6 years agoCommit forgotten change in gdb allowing to use libedit
bapt [Tue, 6 Feb 2018 12:17:03 +0000 (12:17 +0000)]
Commit forgotten change in gdb allowing to use libedit

6 years agoSwitch to use libedit instead of readline
bapt [Tue, 6 Feb 2018 12:12:44 +0000 (12:12 +0000)]
Switch to use libedit instead of readline

6 years agoRemove gdbtui, it was already not installed on every arches
bapt [Tue, 6 Feb 2018 11:54:20 +0000 (11:54 +0000)]
Remove gdbtui, it was already not installed on every arches
only installed on arm and sparc64.
It is the only bits that keeps us having libreadline in base
The rest of gdb can be switched to libedit and will be in another
commit

6 years ago[arswitch] Implement the switch MAC address fetch API.
adrian [Tue, 6 Feb 2018 08:35:49 +0000 (08:35 +0000)]
[arswitch] Implement the switch MAC address fetch API.

The placeholders are here for some future "set" MAC address API.

Tested:

* AR9340 switch
* AR8327 switch

6 years ago[etherswitchcfg] print the switch MAC address if provided.
adrian [Tue, 6 Feb 2018 08:35:09 +0000 (08:35 +0000)]
[etherswitchcfg] print the switch MAC address if provided.

6 years ago[etherswitch] add initial support for potentially configuring and fetching the switch...
adrian [Tue, 6 Feb 2018 08:34:50 +0000 (08:34 +0000)]
[etherswitch] add initial support for potentially configuring and fetching the switch MAC address.

Switches that originate their own frames (eg obvious ones like Pause frames)
need a MAC address to use to send those frames from.

This API will hopefully begin to allow that to be configurable.

6 years agoFix a case where a request frame can be composed that requires 2 or more
scottl [Tue, 6 Feb 2018 06:55:55 +0000 (06:55 +0000)]
Fix a case where a request frame can be composed that requires 2 or more
SGList elements, but there's only enough space in the request frame for
either 1 element or a chain frame pointer.  Previously, the code would
hit the wrong case, add the SGList element, but then fail to add the
chain frame due to lack of space.  Re-arrange the code to catch this case
earlier and handle it.

Sponsored by: Netflix

6 years agoReturn a C errno for cam_periph_acquire().
scottl [Tue, 6 Feb 2018 06:42:25 +0000 (06:42 +0000)]
Return a C errno for cam_periph_acquire().

There's no compelling reason to return a cam_status type for this
function and doing so only creates confusion with normal C
coding practices. It's technically an API change, but the periph API
isn't widely used. No efffective change to operation.

Reviewed by: imp, mav, ken
Sponsored by: Netflix
Differential Revision: D14063

6 years agoCorrect structure name used in bus_map_resource(9) example
bryanv [Tue, 6 Feb 2018 04:28:21 +0000 (04:28 +0000)]
Correct structure name used in bus_map_resource(9) example

Reviewed by: jhb
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D14188

6 years agoFollowup on r302393 by cperciva, improving calculation of boot pages required
glebius [Tue, 6 Feb 2018 04:16:00 +0000 (04:16 +0000)]
Followup on r302393 by cperciva, improving calculation of boot pages required
for UMA startup.

o Introduce another stage of UMA startup, which is entered after
  vm_page_startup() finishes. After this stage we don't yet enable buckets,
  but we can ask VM for pages. Rename stages to meaningful names while here.
  New list of stages: BOOT_COLD, BOOT_STRAPPED, BOOT_PAGEALLOC, BOOT_BUCKETS,
  BOOT_RUNNING.
  Enabling page alloc earlier allows us to dramatically reduce number of
  boot pages required. What is more important number of zones becomes
  consistent across different machines, as no MD allocations are done before
  the BOOT_PAGEALLOC stage. Now only UMA internal zones actually need to use
  startup_alloc(), however that may change, so vm_page_startup() provides
  its need for early zones as argument.
o Introduce uma_startup_count() function, to avoid code duplication. The
  functions calculates sizes of zones zone and kegs zone, and calculates how
  many pages UMA will need to bootstrap.
  It counts not only of zone structures, but also of kegs, slabs and hashes.
o Hide uma_startup_foo() declarations from public file.
o Provide several DIAGNOSTIC printfs on boot_pages usage.
o Bugfix: when calculating zone of zones size use (mp_maxid + 1) instead of
  mp_ncpus. Use resulting number not only in the size argument to zone_ctor()
  but also as args.size.

Reviewed by: imp, gallatin (earlier version)
Differential Revision: https://reviews.freebsd.org/D14054

6 years agoOccasional cylinder-group check-hash errors were being reported on
mckusick [Tue, 6 Feb 2018 00:19:46 +0000 (00:19 +0000)]
Occasional cylinder-group check-hash errors were being reported on
systems running with a heavy filesystem load. Tracking down this
bug was elusive because there were actually two problems. Sometimes
the in-memory check hash was wrong and sometimes the check hash
computed when doing the read was wrong. The occurrence of either
error caused a check-hash mismatch to be reported.

The first error was that the check hash in the in-memory cylinder
group was incorrect. This error was caused by the following
sequence of events:

- We read a cylinder-group buffer and the check hash is valid.
- We update its cg_time and cg_old_time which makes the in-memory
  check-hash value invalid but we do not mark the cylinder group dirty.
- We do not make any other changes to the cylinder group, so we
  never mark it dirty, thus do not write it out, and hence never
  update the incorrect check hash for the in-memory buffer.
- Later, the buffer gets freed, but the page with the old incorrect
  check hash is still in the VM cache.
- Later, we read the cylinder group again, and the first page with
  the old check hash is still in the VM cache, but some other pages
  are not, so we have to do a read.
- The read does not actually get the first page from disk, but rather
  from the VM cache, resulting in the old check hash in the buffer.
- The value computed after doing the read does not match causing the
  error to be printed.

The fix for this problem is to only set cg_time and cg_old_time as
the cylinder group is being written to disk. This keeps the in-memory
check-hash valid unless the cylinder group has had other modifications
which will require it to be written with a new check hash calculated.
It also requires that the check hash be recalculated in the in-memory
cylinder group when it is marked clean after doing a background write.

The second problem was that the check hash computed at the end of the
read was incorrect because the calculation of the check hash on
completion of the read was being done too soon.

- When a read completes we had the following sequence:

  - bufdone()
  -- b_ckhashcalc (calculates check hash)
  -- bufdone_finish()
  --- vfs_vmio_iodone() (replaces bogus pages with the cached ones)

- When we are reading a buffer where one or more pages are already
  in memory (but not all pages, or we wouldn't be doing the read),
  the I/O is done with bogus_page mapped in for the pages that exist
  in the VM cache. This mapping is done to avoid corrupting the
  cached pages if there is any I/O overrun. The vfs_vmio_iodone()
  function is responsible for replacing the bogus_page(s) with the
  cached ones. But we were calculating the check hash before the
  bogus_page(s) were replaced. Hence, when we were calculating the
  check hash, we were partly reading from bogus_page, which means
  we calculated a bad check hash (e.g., because multiple pages have
  been mapped to bogus_page, so its contents are indeterminate).

The second fix is to move the check-hash calculation from bufdone()
to bufdone_finish() after the call to vfs_vmio_iodone() so that it
computes the check hash over the correct set of pages.

With these two changes, the occasional cylinder-group check-hash
errors are gone.

Submitted by: David Pfitzner <dpfitzner@netflix.com>
Reviewed by: kib
Tested by: David Pfitzner

6 years agoMove signal trampolines out of locore.s into separate source file.
kib [Tue, 6 Feb 2018 00:02:30 +0000 (00:02 +0000)]
Move signal trampolines out of locore.s into separate source file.

Similar to other arches, the move makes the subject of locore.s only
the kernel startup.

Sponsored by: The FreeBSD Foundation
MFC after: 1 week

6 years agobwn(4): migrate bwn(4) to the native bhnd(9) interface, and drop siba_bwn.
landonf [Mon, 5 Feb 2018 23:38:15 +0000 (23:38 +0000)]
bwn(4): migrate bwn(4) to the native bhnd(9) interface, and drop siba_bwn.

- Remove the shim interface that allowed bwn(4) to use either siba_bwn or
  bhnd(4), replacing all siba_bwn calls with their bhnd(4) bus equivalents.
- Drop the legay, now-unused siba_bwn bus driver.
- Clean up bhnd(4) board flag defines referenced by bwn(4).

Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D13518

6 years agoIgnore relocation tables for non-memory-resident sections.
jhb [Mon, 5 Feb 2018 23:35:33 +0000 (23:35 +0000)]
Ignore relocation tables for non-memory-resident sections.

As a followup to r328101, ignore relocation tables for ELF object
sections that are not memory resident.  For modules loaded by the
loader, ignore relocation tables whose associated section was not
loaded by the loader (sh_addr is zero).  For modules loaded at runtime
via kldload(2), ignore relocation tables whose associated section is
not marked with SHF_ALLOC.

Reported by: Mori Hiroki <yamori813@yahoo.co.jp>, adrian
Tested on: mips, mips64
MFC after: 1 month
Sponsored by: DARPA / AFRL

6 years agoFix a typo.
jhb [Mon, 5 Feb 2018 23:29:50 +0000 (23:29 +0000)]
Fix a typo.

6 years agoAlways give ELF brands a chance to veto a match.
jhb [Mon, 5 Feb 2018 23:27:42 +0000 (23:27 +0000)]
Always give ELF brands a chance to veto a match.

If a brand provides a header_supported hook, check it when trying to
find a brand based on a matching interpreter as well as in the final
loop for the fallback brand. Previously a brand might reject a binary
via a header_supported hook in one of the earlier loops, but still be
chosen by one of these later loops.

Reviewed by: kib
Obtained from: CheriBSD
MFC after: 2 weeks
Sponsored by: DARPA / AFRL
Differential Revision: https://reviews.freebsd.org/D13945

6 years ago[arswitch] disable ARP copy-to-CPU port for AR9340 for now.
adrian [Mon, 5 Feb 2018 20:37:29 +0000 (20:37 +0000)]
[arswitch] disable ARP copy-to-CPU port for AR9340 for now.

I'll have to go double check to see if it does indeed pass ARP frames between
switch ports with this disabled, but it seems required for the CPU port to see
ARP traffic.

I'll dig into this some more.

6 years ago[arswitch] fix build breakage.
adrian [Mon, 5 Feb 2018 20:30:53 +0000 (20:30 +0000)]
[arswitch] fix build breakage.

Apparently the last time I checked building this it didn't pick up that the
header had changed.

6 years agoReduce duplication in extattr_*_(file|link) syscalls.
brooks [Mon, 5 Feb 2018 19:06:34 +0000 (19:06 +0000)]
Reduce duplication in extattr_*_(file|link) syscalls.

Reviewed by: rwatson
Obtained from: CheriBSD
Sponsored by: DARPA, AFRL
Differential Revision: https://reviews.freebsd.org/D14173

6 years agoANSIfy syscall implementations.
brooks [Mon, 5 Feb 2018 18:58:55 +0000 (18:58 +0000)]
ANSIfy syscall implementations.

Reviewed by: rwatson
Sponsored by: DARPA, AFRL
Differential Revision: https://reviews.freebsd.org/D14172

6 years agoFix and enable SysV IPC tests.
brooks [Mon, 5 Feb 2018 18:48:00 +0000 (18:48 +0000)]
Fix and enable SysV IPC tests.

Don't declare some types that FreeBSD incorrectly declares.

Fix an incorrect call to open() (missing mode).

ANSIfy prototypes.

Enable SysV message queue, semaphore, and shared memory tests.

With exception of the workaround for union semun, these fixes have been
committed to NetBSD.

Reviewed by: asomers
Approved by: CheriBSD
Sponsored by: DARPA, AFRL
Differential Revision: https://reviews.freebsd.org/D13471

6 years agoCorrect Russia spelling in regdomain.xml
emaste [Mon, 5 Feb 2018 18:45:21 +0000 (18:45 +0000)]
Correct Russia spelling in regdomain.xml

PR: 225658
MFC after: 1 week

6 years agoAdditional linuxolator whitespace cleanup, missed in r328890
emaste [Mon, 5 Feb 2018 18:39:06 +0000 (18:39 +0000)]
Additional linuxolator whitespace cleanup, missed in r328890

6 years agoFix makecontext() on MIPS O32.
jhb [Mon, 5 Feb 2018 18:10:28 +0000 (18:10 +0000)]
Fix makecontext() on MIPS O32.

The GP register can be clobbered by the callback, so save it in S1
while invoking the callback function.

While here, add a comment expounding on the treatment of GP for the
various ABIs and the assumptions made.

Reviewed by: jmallett (earlier version)
Sponsored by: DARPA / AFRL
Differential Revision: https://reviews.freebsd.org/D14179

6 years agoGarbage collect trailing whitespace.
brooks [Mon, 5 Feb 2018 18:06:54 +0000 (18:06 +0000)]
Garbage collect trailing whitespace.

Sponsored by: DARPA, AFRL

6 years agoDocument the need for WITH_CASPER.
markj [Mon, 5 Feb 2018 17:33:16 +0000 (17:33 +0000)]
Document the need for WITH_CASPER.

After r325062, consumers need to define WITH_CASPER for libcasper to
function as expected.

6 years agoLinuxolator whitespace cleanup
emaste [Mon, 5 Feb 2018 17:29:12 +0000 (17:29 +0000)]
Linuxolator whitespace cleanup

A version of each of the MD files by necessity exists for each CPU
architecture supported by the Linuxolator.  Clean these up so that new
architectures do not inherit whitespace issues.

Clean up shared Linuxolator files while here.

Sponsored by: Turing Robotic Industries Inc.

6 years agoext2fs: remove EXT4F_RO_INCOMPAT_SUPP
pfg [Mon, 5 Feb 2018 15:14:01 +0000 (15:14 +0000)]
ext2fs: remove EXT4F_RO_INCOMPAT_SUPP

This was a hack to be able to mount ext4 filesystems read-only while not
supporting all the features. We now support all those features so it
doesn't make sense to keep the undocumented hack.

Discussed with: fsu

6 years agoMove assym.s to DPSRCS in linux modules
emaste [Mon, 5 Feb 2018 14:53:18 +0000 (14:53 +0000)]
Move assym.s to DPSRCS in linux modules

assym.s exists only to be included by other .s files, and should not
actually be assembled by itself.

Sponsored by: Turing Robotic Industries Inc.

6 years agoext2fs: Cleanup variable assignments for extents.
pfg [Mon, 5 Feb 2018 14:30:27 +0000 (14:30 +0000)]
ext2fs: Cleanup variable assignments for extents.

Delay the initialization of variables until the are needed.

In the case of ext4_ext_rm_leaf(), make sure 'error' value is not
undefined.

Reported by: Clang's static analyzer
Differential Revision: https://reviews.freebsd.org/D14193

6 years agozfs: move a utility function, ioflags, closer to its consumers
avg [Mon, 5 Feb 2018 14:19:36 +0000 (14:19 +0000)]
zfs: move a utility function, ioflags, closer to its consumers

No functional change.

MFC after: 1 week