Commit Graph

198095 Commits

Author SHA1 Message Date
cperciva
65e2f94603 MFC r277318:
When disabling C3+ CPU states due to the CPU_QUIRK_NO_C3 quirk, don't
  accidentally enable non-existent states.

  This bug was triggered if ACPI advertises the presence of a C2 state
  which we fail to parse via acpi_PkgGas due to our lack of support for
  FFixedHW resources, and causes an immediate panic when an attempt is
  made to enter the (NULL) state.

  One affected platform is the EC2 c4.8xlarge VM instance type; there
  may be others.
2015-01-25 08:16:51 +00:00
ngie
c8660cb9db MFC r277527:
r277527 (by ngie):

  Make this compile with WARNS=6 and clang/gcc

  Sponsored by: EMC / Isilon Storage Division
2015-01-25 05:18:03 +00:00
ngie
be8fb1ecda MFC r277278:
r277278 (by ngie):

  Fix lib/libthr/tests/detach_test

  - Eliminate race with liberal use of sleep(3) [1]
  - Fix NetBSD-specific implementation way of testing result from pthread_cancel
    by testing with `td` instead of `NULL` [2]

  PR: 196738 [1]
  PR: 191906 [2]

  Sponsored by: EMC / Isilon Storage Division
2015-01-25 00:28:15 +00:00
pfg
ea5c22141a MFC r277301:
ext2: cosmetical issues

Minor sorting and note when the cases are expected to fall through.
2015-01-24 21:23:53 +00:00
kib
bac6ad8875 MFC r277488:
Do not allow pthread_sigmask() to block SIGCANCEL.
2015-01-24 08:35:49 +00:00
luigi
0f243342b5 use the same version as in HEAD
(among other things, the -v flag to make is long since unsupported)
2015-01-24 06:11:13 +00:00
smh
e2d4209626 MFC r276194:
Prevent zpool upgrade failing due to unavailable pools

Sponsored by:	Multiplay
2015-01-24 00:40:42 +00:00
delphij
f72184af7f MFC r276904:
Improve style and fix a possible use-after-free case introduced in r268384
by reinitializing the 'freestate' pointer after freeing the memory.

Obtained from:	HardenedBSD (71fab80c5dd3034b71a29a61064625018671bbeb)
PR:		194525
Submitted by:	Oliver Pinter <oliver.pinter@hardenedbsd.org>
2015-01-24 00:27:50 +00:00
delphij
ae11365e35 MFC r275923:
Add missing continue: we can't proceed further if the
kernel does not panic with zfs_panic_recover.

Illumos issue:
    5438 zfs_blkptr_verify should continue after zfs_panic_recover

Reported by:	Coverity
CID:		1232014
2015-01-23 22:46:07 +00:00
delphij
e878593535 Note OpenSSL MFC.
This is a direct commit to stable/10.
2015-01-23 19:19:34 +00:00
jkim
702b057a66 MFC: r277274
Update buildinf.h to make SSLeay_version(3) little bit more useful.
2015-01-23 19:17:04 +00:00
jkim
2a0385d554 MFC: r277270
Merge OpenSSL 1.0.1l.

Relnotes:	yes
2015-01-23 19:14:36 +00:00
delphij
877985d154 MFC r276891:
var/named/etc/namedb/working should be removed as part of namedb.
2015-01-23 18:56:31 +00:00
delphij
771ee7d0d8 MFC r276795:
Fix sos@'s name.
2015-01-23 18:55:24 +00:00
delphij
606dfe1075 MFC r276577: MFV r276568:
Update file to 5.22.
2015-01-23 18:48:59 +00:00
delphij
b62501e2c2 MFC r276495: Fix markup for minthreads and maxthreads.
PR:	196403
2015-01-23 18:45:22 +00:00
delphij
ff89014ed1 MFC r275918:
Sync with NetBSD, mainly address NetBSD bug #43355:

Fix valid_format() to be more careful about allowing only valid
printf formats.

Obtained from:        NetBSD
2015-01-23 18:42:05 +00:00
delphij
6cd815aece MFC r275552: MFV r260710 + 275532:
Add a new method, nvlist_print_json to allow libnvpair to emit JSON.
2015-01-23 18:40:47 +00:00
delphij
902f541eb5 MFC r275922: MFV r275914:
As of r270383, the dbuf_compare comparator compares the dbuf
attributes in the following order:

      db_level (indirect level)
      db_blkid (block number)
      db_state (current state)
      the address of the element

Because db_state is being considered before the element's state,
changing of db_state would affect balancedness of the AVL tree,
even when the address of element compares differently.  For
instance, in dbuf_create, db_state may be altered after the
node is inserted into the AVL tree and may break AVL tree
balancedness.

Instead of using db_state as a comparision critera (introduced
in r270383), consider it only when we are doing a lookup, that
is one of the two dbuf pointers contains DB_SEARCH.

Illumos issue:
    5422 preserve AVL invariants in dn_dbufs
2015-01-23 18:39:26 +00:00
delphij
429a0a7af7 MFC r275812: MFV r275784:
Plug a memory leak in libzfs.  In zfs_iter_bookmarks, an nvlist is allocated
before calling lzc_get_bookmarks, which allocates the nvlist again (and
overwrites the pointer to previously allocated list).

Illumos issue:
    5427 memory leak in libzfs when doing rollback
2015-01-23 18:36:21 +00:00
delphij
b84208b123 MFC r275811: MFV r275783:
Convert ARC flags to use enum.  Previously, public flags are defined in
arc.h and private flags are defined in arc.c which can lead to confusion
and programming errors.

Consistently use 'hdr' (when referencing arc_buf_hdr_t) instead of 'buf'
or 'ab' because arc_buf_t are often named 'buf' as well.

Illumos issue:
    5369 arc flags should be an enum
    5370 consistent arc_buf_hdr_t naming scheme
2015-01-23 18:33:50 +00:00
delphij
9ef0e2ecd5 MFC r275782: MFV r275551:
Remove "dbuf phys" db->db_data pointer aliases.

Use function accessors that cast db->db_data to the appropriate
"phys" type, removing the need for clients of the dmu buf user
API to keep properly typed pointer aliases to db->db_data in order
to conveniently access their data.

sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zap_leaf.c:
        In zap_leaf() and zap_leaf_byteswap, now that the pointer alias
        field l_phys has been removed, use the db_data field in an on
        stack dmu_buf_t to point to the leaf's phys data.

sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dbuf.c:
        Remove the db_user_data_ptr_ptr field from dbuf and all logic
        to maintain it.

sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dbuf.c:
sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dnode.c:
sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dbuf.h:
sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dmu.h:
sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c:
sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dir.c:
sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sa.c:
sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zap.c:
sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zap_micro.c:
        Modify the DMU buf user API to remove the ability to specify
        a db_data aliasing pointer (db_user_data_ptr_ptr).

cddl/contrib/opensolaris/cmd/zdb/zdb.c:
sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_diff.c:
sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_objset.c:
sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_send.c:
sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_traverse.c:
sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_tx.c:
sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_bookmark.c:
sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c:
sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_deadlist.c:
sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_deleg.c:
sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_destroy.c:
sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dir.c:
sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_pool.c:
sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_prop.c:
sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_scan.c:
sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_synctask.c:
sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_userhold.c:
sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sa.c:
sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c:
sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_history.c:
sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zap.c:
sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zap_leaf.c:
sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zap_micro.c:
sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c:
sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dsl_dataset.h:
sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dsl_dir.h:
sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zap_impl.h:
sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zap_leaf.h:
        Create and use the new "phys data" accessor functions
        dsl_dir_phys(), dsl_dataset_phys(), zap_m_phys(),
        zap_f_phys(), and zap_leaf_phys().

sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dsl_dataset.h:
sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dsl_dir.h:
sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zap_impl.h:
sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zap_leaf.h:
        Remove now unused "phys pointer" aliases to db->db_data
        from clients of the DMU buf user API.

Illumos issue:
    5314 Remove "dbuf phys" db->db_data pointer aliases in ZFS
2015-01-23 18:30:32 +00:00
delphij
cab26f42cc MFC r275781: MFV r275550:
In addition to r273158, make the code in spa_sync() that checks if the
current TXG is a no-op TXG less fragile.

Illumos issue:
    5347 idle pool may run itself out of space
2015-01-23 18:28:37 +00:00
delphij
49b7f05a49 MFC r275748: MFV r247174:
Expose arc_meta_limit, et al via kstats.

Note that as a result, vfs.zfs.arc_meta_used is removed.
The existing vfs.zfs.arc_meta_limit sysctl/tunable is retained
with a SYSCTL_PROC wrapper.

Illumos ZFS issues:
    3561 arc_meta_limit should be exposed via kstats

Relnotes:	yes
2015-01-23 18:23:19 +00:00
delphij
9a781ab65c MFC r275740: MFV r275548:
Verify that the block pointer is structurally valid, before attempting to
read it in.  It can only be invalid in the case of a ZFS bug, but this
change will help identify such bugs in a more transparent way, by
panic'ing with a relevant message, rather than indexing off the end of an
array or something.

Illumos issue:
    5349 verify that block pointer is plausible before reading
2015-01-23 18:16:36 +00:00
glebius
52282183c0 Merge r274709 by eri@: deal with IPv6 same way as we IPv4 and calculate
the checksum before entering pf_test6().

PR:		172648, 179392
2015-01-23 18:15:15 +00:00
delphij
049d5b632d MFC r275739: MFV r275547:
Port Illumos 'zfs allow' examples update.  While I'm there also fix
a typo.

Illumos issue:
    4181 zfs(1m): 'zfs allow' examples in the man page are outdated
2015-01-23 18:14:29 +00:00
delphij
a249d7c4fb MFC r274418 (gjb):
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
2015-01-23 18:11:48 +00:00
glebius
90eda5374c Merge r277258: plug mutex leak in ngctl(8). 2015-01-23 17:49:16 +00:00
delphij
9a50f3f3a8 MFC r275738: MFV r275546:
Reduce scrub activities when system there is enough dirty data, namely when
dirty data is more than zfs_vdev_async_write_active_min_dirty_percent (once
we start to increase the number of concurrent async writes).

While there also correct rounding error which would make scrub end up
pausing for (zfs_txg_timeout + 1) seconds instead of the desired
zfs_txg_timeout seconds.

Illumos issue:
    5351 scrub goes for an extra second each txg
    5352 scrub should pause when there is some dirty data
2015-01-23 17:41:34 +00:00
delphij
85cd2fc0bf MFC r275737: MFV r275545:
If zio_checksum_error() returns other than ECKSUM (e.g. EINVAL), it does not
fill in the "zio_bad_cksum_t *info" parameter. Caller should not attempt to
use it in this case.

Illumos issue:
    5348 zio_checksum_error() only fills in info if ECKSUM
2015-01-23 17:31:41 +00:00
delphij
4cf14a4e5e MFC r275736: MFV r275544:
Clean up some duplicated code in dnode_sync() around freeing spill blocks.

Illumos issue:
    5350 clean up code in dnode_sync()
2015-01-23 17:24:56 +00:00
delphij
73a900fefa MFC r275735: MFV r275543:
Remove always true tests for ds->ds_phys' presence.

Clean up assertions in dsl_dataset_disown.

Remove unreachable code in dsl_dataset_disown().

Illumos issue:
    5310 Remove always true tests for non-NULL ds->ds_phys
2015-01-23 17:21:11 +00:00
delphij
29c471fa7a MFC r275734: MFV r275542:
If a dnode has a spill block and there is an error while accessing
a data block then traverse_dnode() loses information about that error
and returns a status of visiting the spill block.

This issue is discovered by Spectra Logic.

Illumos issue:
    5311 traverse_dnode may report success when it should not

Original author:	gibbs
2015-01-23 17:16:26 +00:00
emaste
227bb2b2ea libelf: Improve ELF header validation
Avoid integer overflow and reading past EOF.

MFC of r276427, r276443, r277249 from contrib/elftoolchain.
2015-01-23 04:07:07 +00:00
emaste
23ccab912a crunchide: Correct 64-bit section header offset
For 64-bit binaries the Elf_Ehdr e_shoff is at offset 40, not 44.
Instead of using an incorrect hardcoded offset, let the compiler
figure it out for us with offsetof().

MFC of r277259
2015-01-23 02:39:00 +00:00
delphij
fb31f7e88b MFC r275595:
Use calloc() instead of malloc() + bzero().  This also gets rid of a warning
because bzero is defined by strings.h which is not included in thread_pool.c.
2015-01-23 00:54:56 +00:00
delphij
f0b1164b8b MFC r275594: MFV r275540:
When importing a pool, don't assume that the passed pool configuration
at vdev_load is always vaild.  It's possible that a stale configuration
that comes with extra vdevs, where metaslab_init() would fail because
of lower layer returns error.

Change the code to make metaslab_init() handle and return errors from
lower layer and pass it back to upper layer and handle it there.

Illumos issue:
    5213 panic in metaslab_init due to space_map_open returning ENXIO
2015-01-23 00:44:14 +00:00
delphij
9eb8a0d403 MFC r275579: MFV r275537:
Illumos issue:
   5316 allow smbadm join to use RPC

(Due to our lack of smbsrv this is mostly no-op on
FreeBSD)
2015-01-23 00:40:43 +00:00
delphij
cbce4fcc9a MFC r275563: MFV r275536:
Illumos issue:
    3363 Mark non-returning functions in ctftools
2015-01-23 00:36:17 +00:00
ngie
cf49e13d37 MFC r276806:
r276806 (by ngie):

  Remove unnecessary .include of bsd.own.mk

  Sponsored by: EMC / Isilon Storage Division
2015-01-23 00:35:47 +00:00
ngie
4c2adfc905 MFC r276671,r277357:
r276671 (by ngie):

  Expect :arithmetic_ops_body to fail with syntax errors on FreeBSD

  Sponsored by: EMC / Isilon Storage Division

r277357 (by ngie):

  Expect :overflow to fail with FreeBSD's expr as it doesn't have stringent
  overflow checks like NetBSD's expr does

  PR: 196867
2015-01-23 00:34:19 +00:00
ngie
09176354ca MFC r277453:
r277453 (by ngie):

  Garbage collect a prove test wrapper

  Sponsored by: EMC / Isilon Storage Division
2015-01-23 00:27:37 +00:00
delphij
7780f3d4e3 MFC r275562: MFV r275535:
Unexpand ISP2() and MSEC2NSEC().

Illumos issue:
    5255 uts shouldn't open-code ISP2
2015-01-23 00:27:08 +00:00
delphij
99239fcce4 MFC r275561: MFV r275534:
Sync with Illumos.  This have no effect to FreeBSD.

Illumos issue:
    5285 pass in cpu_pause_func via pause_cpus
2015-01-23 00:23:48 +00:00
delphij
2fbf983b2a MFC r275533:
Sync with Illumos.  This have no effect to FreeBSD.

Illumos issue:
    5100 sparc build failed after 5004
2015-01-23 00:19:58 +00:00
pfg
de76b0c7d4 MFC r276832 (partial), r277099
Avoid a warning from gcc48.
Replace __inline GNUism with the standard inline.
2015-01-22 21:41:41 +00:00
brooks
f4cd08de01 MFC r274816:
Add FPU support for MIPS setjmp(3)/longjmp(3).

This change saves/restores the callee-saved MIPS floating point
registers as documented by the o32/n32/n64 spec ("MIPSpro N32
ABI Handbook", Table 2-1) for the _setjmp(3), _longjmp(3),
setjmp(3) and longjmp(3) C library functions.  This is only
included when the C library is built with hardware floating point
support (or when "SOFTFLOAT" is not defined).

Submitted by:	sson
Sponsored by:	DARPA, AFRL
2015-01-22 21:17:58 +00:00
kib
2247a66996 MFC r277236:
For sigaction(2), ignore possible garbage in sa_flags for sa_handler
== SIG_DFL or SIG_IGN.
2015-01-22 09:07:02 +00:00
kib
f831eecaca MFC r277211:
fcntl F_O{GET,SET}LK take pointer as the arg, handle them properly for
compat32.
2015-01-22 09:02:58 +00:00