delphij [Mon, 13 Oct 2014 20:39:51 +0000 (20:39 +0000)]
Use write_psize instead of write_asize when doing vdev_space_update.
Without this change the accounting of L2ARC usage would be wrong and
give 16EB free space because the number became negative and overflows.
imp [Mon, 13 Oct 2014 16:23:58 +0000 (16:23 +0000)]
Use the C99 flexible array construct to denote a variable amount of
data rather than the old-school [1] construct. We have required c99
compilers for some time.
andrew [Mon, 13 Oct 2014 15:35:08 +0000 (15:35 +0000)]
Start removing the omap3 support. In base it was only ever a header and a
few changes to drivers, no kernel config was added. As the SoCs are quite
old and the code is unmaintained start the process of removing support by
deleting the header file and code that depends on it along with the macro
SOC_OMAP3. Other Ti SoCs shouldn't be affected, other than for us to have
less code to maintain.
delphij [Mon, 13 Oct 2014 05:34:10 +0000 (05:34 +0000)]
Add a tunable for arc_shrink_shift (vfs.zfs.arc_shrink_shift) that
controls how much fraction, 1/2^arc_shrink_shift, should be reclaimed
when there is memory pressure.
Submitted by: Richard Kojedzinszky <krichy at tvnetwork.hu>
MFC after: 2 weeks
ngie [Mon, 13 Oct 2014 01:14:01 +0000 (01:14 +0000)]
Do initial port of contrib/netbsd-tests/lib/libc/locale
t_io:
- Expect failures potentially related to implementation-specific knowledge of
the zh_TW.Big5 locale [*]
t_mbrtowc:
- Handle unknown locales more gracefully (do not test if the locale doesn't
exist)
- Expect failure with mbrtowc_internal dealing with Japanese locales
(potentially related to implementation detail knowledge of the ja_* locales) [*].
t_mbstowcs, t_mbtowc, t_wctomb:
- Handle unknown locales more gracefully (do not test if the locale doesn't
exist)
t_wcstod:
- Treat FreeBSD like NetBSD and Linux in the XXX: FIXME section
[*] More investigation is required to determine the root cause of the failures
jhibbits [Sun, 12 Oct 2014 23:48:55 +0000 (23:48 +0000)]
Check error return from reading integer part of temperature.
There's a very remote, but possible, chance that the integer part read will
fail, but the fraction read succeeds, at which point the reported temperature is
invalid.
ngie [Sun, 12 Oct 2014 21:59:23 +0000 (21:59 +0000)]
- Add libutil #include for fparseln
- Change ATF_REQUIRE_EQ_MSG to ATF_CHECK_EQ_MSG to gather all failing results
possible (currently 12 with leftassoc)
- Mark leftassoc "atf_tc_expect_fail" on FreeBSD (PR coming soon after further
analysis is done on the code)
ngie [Sun, 12 Oct 2014 21:53:13 +0000 (21:53 +0000)]
Implement 64MB memory limit for test to ensure that it fails reliably in
600 seconds; it would previously fail inconsistently when run in some virtual
machine configurations
This patch might need to be reverted or revisited later (see the attached PR
for more details)
jhibbits [Sun, 12 Oct 2014 19:12:48 +0000 (19:12 +0000)]
Add an AC line monitor so power_profile can work
Summary:
Add a polling loop (1Hz) to monitor the battery and AC status, to notify devd
like ACPI does for power monitoring. This allows /etc/rc.d/power_profile to
work on PowerPC laptops
Test Plan:
Tested on a Titanium PowerBook, configuring economy_cpu_freq and
performance_cpu_freq, disabling powerd.
nwhitehorn [Sun, 12 Oct 2014 17:59:31 +0000 (17:59 +0000)]
Only allow ZFS boot on GPT; the MBR ZFS bootblocks cannot be installed using
gpart bootcode as /boot/zfsboot needs to be split into multiple pieces by
hand and copied to different areas of the partition.
rwatson [Sun, 12 Oct 2014 15:49:52 +0000 (15:49 +0000)]
When deciding whether to call m_pullup() even though there is adequate
data in an mbuf, use M_WRITABLE() instead of a direct test of M_EXT;
the latter both unnecessarily exposes mbuf-allocator internals in the
protocol stack and is also insufficient to catch all cases of
non-writability.
(NB: m_pullup() does not actually guarantee that a writable mbuf is
returned, so further refinement of all of these code paths continues to
be required.)
mav [Sun, 12 Oct 2014 06:55:34 +0000 (06:55 +0000)]
Improve and document `ctladm portlist` subcommand.
Make this subcommand less FC-specific, reporting target and port addresses
in more generic way. Also make it report list of connected initiators in
unified way, working for both FC and iSCSI, and potentially others.
hrs [Sat, 11 Oct 2014 23:49:27 +0000 (23:49 +0000)]
Add ${name}_env and ${name}_prepend. ${name}_env is an argument list which
will be passed to env(1). ${name}_prepend is simply prepended to the command
line for $command.
jhb [Sat, 11 Oct 2014 19:36:59 +0000 (19:36 +0000)]
Add locking and mark MPSAFE.
- Add a mutex to protect the softc.
- Use callout(9) instead of timeout(9).
- Consolidate duplicated detach routines into a bus-independent detach
routine.
- Add an extra sleep lock flag (MSESC_READING) to prevent other readers
from reading while the first reader is copying data out of sc_bytes[]
via uiomove().
- Use bus_*() instead of bus_space_*().
kib [Sat, 11 Oct 2014 19:09:56 +0000 (19:09 +0000)]
Do not set IN_ACCESS flag for read-only mounts. The IN_ACCESS
survives remount in rw, also it is set for vnodes on rootfs before
noatime can be set or clock is adjusted. All conditions result in
wrong atime for accessed vnodes.
pfg [Sat, 11 Oct 2014 18:54:37 +0000 (18:54 +0000)]
tcpd.h: add prototype for hosts_ctl
According the hosts_access(3) man page the hosts_ctl() prototype
should be in tcpd.h. For now, follow other declarations and don't
add the arguments in the prototype.
marcel [Sat, 11 Oct 2014 16:34:01 +0000 (16:34 +0000)]
Fix nits in previous commit:
1. Remove initializer for badstack_sbuf_size; it gets set unconditionally.
2. Remove meaningless comment.
3. Group witness_count and its sysctl together.
4. Fix spacing in for statements (space after for and within condition).
5. Change *all* M_NOWAIT usages in witness_initialize() to M_WAITOK; not
just those that were newly introduced -- the allocation is assumed to
succeed for all allocations.
6. Avoid using uint8_t as the base type in sizeof() expressions; Use the
variable name (w_rmatrix) as much as possible.
mav [Sat, 11 Oct 2014 10:19:37 +0000 (10:19 +0000)]
Filter out duplicate AC_PATH_REGISTERED async events.
Queued async events handling in CAM opened race, that may lead to duplicate
AC_PATH_REGISTERED events delivery during boot. That was not happening
before r272935 because the driver was initialized later. After that change
it started create duplicate ports in CTL.
mav [Sat, 11 Oct 2014 07:59:15 +0000 (07:59 +0000)]
Update isp_tgt_map and send new arrival notification if target that departed
earlier has returned. Previously that code worked only once, confusing CTL.
mav [Sat, 11 Oct 2014 07:49:27 +0000 (07:49 +0000)]
Mark CTL frontend's CAM driver as CAM_PERIPH_DRV_EARLY.
Target mode operation does not depend on the initiator mode scan process.
This change allows the target driver to attach earlier and receive some
async events (like AC_CONTRACT) that could be lost otherwise.
marcel [Sat, 11 Oct 2014 02:02:58 +0000 (02:02 +0000)]
Turn WITNESS_COUNT into a tunable and sysctl. This allows adjusting
the value without recompiling the kernel. This is useful when
recompiling is not possible as an immediate solution. When we run out
of witness objects, witness is completely disabled. Not having an
immediate solution can therefore be problematic.
Submitted by: Sreekanth Rupavatharam <rupavath@juniper.net>
Obtained from: Juniper Networks, Inc.
ngie [Fri, 10 Oct 2014 21:22:25 +0000 (21:22 +0000)]
Port the testcase to FreeBSD
- Make #include path to h_macros.h a non-relative path
- __gl_stat_t is synonymous with struct stat on FreeBSD
- FreeBSD doesn't have _DIRENT_RECLEN
- Skip over glob_star on FreeBSD (testcase doesn't pass)
mav [Fri, 10 Oct 2014 19:41:09 +0000 (19:41 +0000)]
Make ctld start even if some LUNs are unable to open backing storage.
Such LUNs will be visible to initiators, but return "not ready" status
on media access commands. If backing storage become available later,
`ctladm modify ...` or `service ctld reload` can trigger its reopen.
ngie [Fri, 10 Oct 2014 19:28:57 +0000 (19:28 +0000)]
Disable the invalid pointer test on FreeBSD
FreeBSD segfaults on invalid pointers passed to getcwd because it throbs the
address passed in in libc, whereas NetBSD just passes the information off to
the syscall, which allows the kernel to return EFAULT on bad pointers.
kib [Fri, 10 Oct 2014 19:27:36 +0000 (19:27 +0000)]
Make MAP_NOSYNC handling in the vm_fault() read-locked object path
compatible with write-locked path. Test for MAP_ENTRY_NOSYNC and set
VPO_NOSYNC for pages with dirty mask zero (this does not exclude a
possibility that the page is dirty, e.g. due to read fault on
writeable mapping and consequent write; the same issue exists in the
slow path).
Use helper vm_fault_dirty() to unify fast and slow path handling of
VPO_NOSYNC and setting the dirty mask.
Reviewed by: alc
Sponsored by: The FreeBSD Foundation
ngie [Fri, 10 Oct 2014 19:18:52 +0000 (19:18 +0000)]
FreeBSD doesn't support strings greater than MAXHOSTNAMELEN-1 in
{get,set}{domain,host}name. Adjust the tests to not exceed that
value when testing out the code
Add a positive and negative test for MAXHOSTNAMELEN-1 and
MAXHOSTNAMELEN, respectively
ngie [Fri, 10 Oct 2014 18:57:39 +0000 (18:57 +0000)]
Disable tests that don't pass on FreeBSD due to missing support in
humanize_number(3). Bringing in additional revisions from NetBSD's
humanize_number(3) will fix the tests
Account for the fact that util.h on NetBSD is libutil.h on FreeBSD