Commit Graph

198024 Commits

Author SHA1 Message Date
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
gjb
505f4c781a MFC r277216:
Evaluate running userland/kernel version in daily
  periodic(8) run, taken from uname(1) '-U' and '-K'
  flags.

Sponsored by:	The FreeBSD Foundation
2015-01-22 02:24:09 +00:00
jhb
4d3ec3464b MFC 272666: Fix build for i386 kernels with out 'I686_CPU'.
Reported by:	Mike Tancsa <mike@sentex.net>
2015-01-21 17:59:32 +00:00
smh
13bbed0129 MFC r276063:
Standardise on illumos for #ifdef's in zvol.c

MFC r276066:
Refactor zvol locking to minimise diff with upstream

MFC r276069:
Fix panic when resizing ZFS zvol's

Sponsored by:	Multiplay
2015-01-21 09:45:48 +00:00
smh
48282fa7cc MFC r272509 (by delphi):
Diff reduction with upstream

Sponsored by:	Multiplay
2015-01-21 09:39:20 +00:00
ngie
259bd5c13f MFC r275907:
r275907 (by ngie):

  Fix building/installing tests when TESTSBASE != /usr/tests

  The work in r258233 hardcoded the assumption that tests was the last component
  of the tests tree by pushing tests as an explicit prefix for the paths in
  BSD.tests.dist and /usr was the prefix for all tests, per BSD.usr.dist and all
  of the mtree calls used in Makefile.inc1. This assumption breaks if/when one
  provides a custom TESTSBASE "prefix", e.g. TESTSBASE=/mytests .

  One thing that r258233 did properly though was remove "/usr/tests" creation
  from BSD.usr.dist -- that should have not been there in the first place. That
  was an "oops" on my part for the work that was originally committed in r241823

  Phabric: D1301
  Reviewed by: imp
  Sponsored by: EMC / Isilon Storage Division
2015-01-20 23:39:08 +00:00
ngie
a170f61a5a MFC r267004,r274592:
r267004 (by gahr):

  - Use strlen instead of hardcoding a number
  - Terminate a sentence with a period

  Approved by:	cognet

r274592 (by ngie):

  Convert tools/regression/lib/libc/stdio/test-fmemopen into an ATF testcase and
  rename as lib/libc/stdio/fmemopen2_test

  Sponsored by: EMC / Isilon Storage Division
2015-01-20 21:59:48 +00:00
ngie
63ef816492 MFC r276590:
r276590 (by jilles):

  Link lib/libc/c063 tests to the build.

  Some files lack required #include <sys/stat.h>. The #ifdef is per ngie's
  request; the includes are clearly necessary for struct stat.

  The faccessat test fails because it tries to use AT_SYMLINK_NOFOLLOW with
  faccessat(), which is not specified by POSIX.1-2008.

  Differential Revision:	https://reviews.freebsd.org/D1411
  Reviewed by:	ngie
2015-01-20 21:48:42 +00:00
ngie
914ba0497a MFC r276318:
r276318 (by ngie):

  Build/install lib/libc/tests/hash/t_sha2 if MK_OPENSSL == yes

  Reported by: Beeblebrox <zaphod@berentweb.com>
2015-01-20 21:46:04 +00:00
ngie
447f2d204c MFC r274075,r274581,r274582,r274595:
r274075 (by ngie):

  Add reachover Makefiles for contrib/netbsd-tests/lib/libc; this adds approximately
  500 new testcases

  Various TODOs have been sprinkled around the Makefiles for items that even need
  to be ported (missing features), testcases have issues with building/linking, or
  issues at runtime.

  A variant of this code has been tested extensively on amd64 and i386
  10-STABLE/11-CURRENT for several months without issue. It builds on other
  architectures, but the code will remain off until I have prove it works on
  virtual hardware or real hardware on other architectures

  In collaboration with: pho, Casey Peel <casey.peel@isilon.com>
  Sponsored by: EMC / Isilon Storage Division

r274581 (by ngie):

  Convert tools/regression/lib/libc/gen/test-arc4random into an ATF testcase and
  rename as lib/libc/gen/arc4random_test

  Sponsored by: EMC / Isilon Storage Division

r274582 (by ngie):

  Remove test-arc4random from this Makefile so others can continue to use
  this as-is for the time being

r274595 (by ngie):

  Convert tools/regression/lib/libc/stdio/test-fpclassify into an ATF testcase and
  Rename as lib/libc/stdio/fpclassify2_test

  Sponsored by: EMC / Isilon Storage Division
2015-01-20 21:42:40 +00:00
trasz
4e06276ca8 MFC r277128:
Fix detection of ext2/ext3 filesystems that lack labels.

Sponsored by:	The FreeBSD Foundation
2015-01-20 20:44:16 +00:00
trasz
1444c0c436 MFC r276704:
Fix memory leaks.

Sponsored by:	The FreeBSD Foundation
2015-01-20 20:42:55 +00:00
trasz
8a23a0c9e7 MFC r276703:
Remove leftovers.

Sponsored by:	The FreeBSD Foundation
2015-01-20 20:41:32 +00:00
trasz
0638ccbfc6 MFC r275680:
Add fstyp(8).  This utility, named after its SVR4 counterpart, detects
filesystems.  It differs from file(1) in that it gives machine-parseable
output, it outputs filesystem labels, doesn't get confused by other
formats metadata, and runs in Capsicum sandbox.

Differential Revision:	https://reviews.freebsd.org/D1255
Relnotes:	yes
Sponsored by:	The FreeBSD Foundation
2015-01-20 20:39:29 +00:00
hselasky
a20136a303 MFC r276892:
Add support for USB device side mode to the USB modem driver.
2015-01-20 05:12:30 +00:00
hselasky
b34c77d403 MFC r276825 and r277372:
Allow a block size of zero to mean 512 bytes, which is the most common
block size for USB disks. This fixes support for "Action Cam SJ4000".
2015-01-20 05:00:38 +00:00
bryanv
d8207c1298 MFC r276491:
Add softc flag for when the indirect descriptor feature was negotiated
2015-01-19 17:02:30 +00:00
bryanv
17a9a10342 MFC r276489:
Use the appropriate IPv4 or IPv6 TSO HW assist flag
2015-01-19 17:00:53 +00:00
kib
44ff2e7b62 MFC r277055:
Revert r263475: TDP_DEVMEMIO no longer needed.
2015-01-19 11:07:29 +00:00
kib
762486d18f MFC r277051:
Fix several issues with /dev/mem and /dev/kmem devices on amd64.
2015-01-19 11:02:23 +00:00
brueffer
4337378f01 MFH: r277085
Fix a typo in the FFS maxbpg option, it was erroneously spelled maxbpf.

The error has been reported to and fixed in the NetBSD upstream version as well.

PR:             196598
Submitted by:   Dan McGregor
2015-01-19 10:57:00 +00:00
kib
da566e85be MFC r277047:
For x86, read MAXPHYADDR into variable cpu_maxphyaddr.
2015-01-19 10:52:55 +00:00