Commit Graph

367 Commits

Author SHA1 Message Date
Enji Cooper
e74712a19b MFstable/10 r305233:
MFstable/11 r305225:

MFC r303573:

Cast result from third parameter to int instead of promoting it to size_t

This resolves a -Wformat issue when the value is used as a format width
precision specifier, i.e. %*s
2016-09-01 19:36:39 +00:00
Andriy Gapon
94b6b9a31d MFC r303086: 7164 zdb should be able to open the root dataset 2016-08-15 08:49:31 +00:00
Andriy Gapon
f6d39dceee MFC r303084: 6391 Override default SPA config location via environment
Note that there was a merge conflict because of an unmerged earlier
change.
2016-08-15 08:44:22 +00:00
Andriy Gapon
86517f69c2 MFC r298472: MFV r298471: 6052 decouple lzc_create() from the
implementation details
2016-05-17 08:18:19 +00:00
Andriy Gapon
531a9f27f1 MFC r297520: zfs receive: -u can be ignored sometimes
PR:		204705
2016-04-19 12:14:52 +00:00
Pedro F. Giffuni
43d56ebd68 Revert r297130: Revert to unbreak the build.
No idea how this broke the build in libstand but it was the only
change so revert to appease jenkins.
2016-03-21 05:47:59 +00:00
Pedro F. Giffuni
7f4c093cb2 MFC r296816:
libdtrace: use calloc(3) instead of malloc(3) when it makes sense.

calloc(3) is faster and occasionally safer than malloc(3) + bzero(3).

In one case, pointed out by Mark[1], this also cleans up a calculation.

Reviewed by:	markj [1]
2016-03-21 01:17:48 +00:00
Dimitry Andric
a074bde4a7 MFC r295844:
Fix "invalid type '(null)'" usage messages in zfs(8) and zpool(8).

Currently, zfs(8) and zpool(8) print "invalid type '(null)'" or similar
messages, if you pass in invalid types, sources or column names for "zfs
get", "zfs list" and "zpool get".  This is because the commands use
getsubopt(3), and in case of failure, they print 'value', which is NULL
when sub options don't match.

They should print 'suboptarg' instead, which is the documented way to
get at the non-matching sub option value.

Reviewed by:	smh
Differential Revision: https://reviews.freebsd.org/D5365
2016-02-24 07:53:57 +00:00
Enji Cooper
791fc90de5 MFstable/10 r289956:
MFC r283144:

Articulate dependencies for cddl/lib/libdtrace and cddl/lib/libzfs

Parallelize the build in this subdirectory

Sponsored by: EMC / Isilon Storage Division
2015-10-25 22:35:43 +00:00
Andriy Gapon
ecdc30b2b9 MFC r288339: remove unused sgsmsg utility (originally imported from opensolaris) 2015-10-23 08:35:39 +00:00
Andriy Gapon
1d70a7fd5e MFC r284409: Fix circular dependency between libzfs and libzfs_core
By bapt.
2015-10-23 08:12:43 +00:00
Andriy Gapon
ee45d7d6c3 MFC r288340: define aok in libnvpair which is linked to all zfs
libraries that need aok
2015-10-23 08:04:59 +00:00
Andriy Gapon
3116ce3356 MFC r288337: remove an extra copy of avl.c from illumos contrib code 2015-10-23 07:48:40 +00:00
Mark Johnston
731b7e0b21 MFC r286169:
Perform bounds checking when constructing a format string.

PR:	201657
2015-08-27 23:46:45 +00:00
Glen Barber
90f14ae03b MFC r286092:
Fix a rendering issue in the zfs(8) manual.

Sponsored by:	The FreeBSD Foundation
2015-08-03 16:30:03 +00:00
Andriy Gapon
ad68cebce8 MFC r284297: several lockstat improvements 2015-07-01 10:17:17 +00:00
Andriy Gapon
e43f7e03a3 MFC r284308: MFV r284042: 1778 Assertion failed: rn->rn_nozpool == B_FALSE 2015-06-25 08:10:23 +00:00
Andriy Gapon
aa96db50fe MFC r284309: zfs clone should not mount the clone if canmount == noauto 2015-06-24 14:32:05 +00:00
Andriy Gapon
52e66c2abd MFC r282121: dump_nvlist: handle DATA_TYPE_BOOLEAN_ARRAY 2015-05-11 08:31:39 +00:00
Mark Johnston
5588d565a2 MFC r280125:
Add a missing format string argument.

PR:		197391
2015-03-18 02:29:00 +00:00
Xin LI
de71b34d06 MFC r277433: MFV r277432:
Plug various memory leaks in libzfs import implementation.

Illumos issue:
    5518 Memory leaks in libzfs import implementation
2015-02-04 00:52:26 +00:00
Mark Johnston
ce185626df MFC r276250:
DOF tables are aligned according to the DOF section's alignment constraint,
so take this into account when iterating over DOF tables.

PR:	195555
2015-01-06 02:13:48 +00:00
Mark Johnston
645845a6cb MFC r272671:
Treat D keywords as identifiers in certain postfix expressions. This allows
one to, for example, access the "provider" field of a struct g_consumer,
even though "provider" is a D keyword.

PR:	169657
2014-12-26 22:52:43 +00:00
Mark Johnston
771c84b2e8 MFC r275011:
The module load address always needs to be included when setting the dm_*_va
fields of dt_module_t. Previously, this was only done on architectures where
kernel modules have type ET_REL; this change fixes that. As a result, symbol
name resolution in the stack() action now works properly for kernel modules
on i386.
2014-12-26 22:49:27 +00:00
Mark Johnston
04175e52fc MFC r271695:
Fix some incorrect endianness checks.
2014-12-05 18:55:32 +00:00
Mark Johnston
63a3084e06 MFC r258902:
The uaddr, ufunc, umod and usym functions all seem to work as expected on
FreeBSD, so stop hiding them behind a "#if defined(sun)".
2014-10-24 17:24:29 +00:00
Andriy Gapon
1fa3a4b570 MFC r261893: zfs.8: fix garbled options in a sample zfs send -R command line 2014-10-07 13:24:07 +00:00
Andriy Gapon
433fee9310 MFC r261892: zpool.8: fix typo in option description of labelclear command 2014-10-07 13:20:28 +00:00
Mark Johnston
e5b0ab6932 MFC r269524:
Preserve the errno value of an ioctl before calling free(3). Previously,
errno was very occasionally being clobbered, resulting in a bogus error from
dt_consume() and thus an error from dtrace(1).
2014-08-20 14:57:21 +00:00
Mark Johnston
34d884bf3b MFC r257877:
Don't try to use the 32-bit drti.o unless the data model is explicitly set
to ILP32. Otherwise dtrace -G will attempt to use it on amd64 if it can't
determine which data model to use, which happens when -64 is omitted and
no object files are provided, e.g. with

# dtrace -G -n BEGIN

This would result in a linker error, but now works properly.

Also remove an unnecessary #ifdef.
2014-08-14 16:45:02 +00:00
Mark Johnston
225c85d311 MFC r265631:
Re-apply r248644. This fixes an annoying problem which caused dtrace -c to
fail to attach to stripped binaries. With the _r_debug_postinit symbol,
dtrace(1) can now set a breakpoint in the victim process after it has
registered its DOF table(s) with the kernel. r_debug_state cannot be used
for this purpose since it is called before DOF is made available, in which
case dtrace(1) cannot create USDT probes before the program begins
execution.
2014-08-08 15:21:42 +00:00
Mark Johnston
e8fa7037fe MFC r256571:
Add a function, memstr, which can be used to convert a buffer of
null-separated strings to a single string. This can be used to print the
full arguments of a process using execsnoop (from the DTrace toolkit) or
with the following one-liner:

dtrace -n 'syscall::execve:return {trace(curpsinfo->pr_psargs);}'

Note that this relies on the process arguments being cached via the struct
proc, which means that it will not work for argvs longer than
kern.ps_arg_cache_limit. However, the following rather non-portable
script can be used to extract any argv at exec time:

fbt::kern_execve:entry
{
    printf("%s", memstr(args[1]->begin_argv, ' ',
        args[1]->begin_envv - args[1]->begin_argv));
}

The debug.dtrace.memstr_max sysctl limits the maximum argument size to
memstr().
2014-08-04 15:36:23 +00:00
Mark Johnston
c82ceec877 MFC r264486:
Use the correct format specifiers for wide characters and strings of wide
characters.
2014-07-29 21:21:15 +00:00
Mark Johnston
09f8638965 MFC r262669:
When our linker merges .SUNW_dof sections from multiple files, it simply
concatenates the DOF tables into one section. Previously, the USDT init
code in drti.o would only look at the first table in the DOF section; with
this change, it iterates over all the tables, passing each DOF table to
the kernel.

PR:	186821
2014-07-29 18:31:44 +00:00
Mark Johnston
87d5e98c65 MFC r262329:
Define the KM_NORMALPRI flag for kmem_alloc(), as it is used in some
upstream DTrace code.

MFC r262330:
1452 DTrace buffer autoscaling should be less violent

illumos/illumos-gate@6fb4854bed
2014-07-24 01:08:02 +00:00
Xin LI
717224fa53 MFC r266520:
Explicitly link libzfs against libavl as it is done in OpenSolaris
(4543:12bb2876a62e).  Without this, some third party applications
may break because the lack of AVL related symbols.

FreeBSD base system are not affected because the FreeBSD ZFS command
line tools were all linked against libavl and thus hide the underlying
issue.

PR:		bin/183081
Approved by:	re (gjb)
2014-05-27 18:54:45 +00:00
Xin LI
c601bc58cf MFC r264835: MFV r264829:
3897 zfs filesystem and snapshot limits
2014-05-09 08:10:33 +00:00
Xin LI
285e94fe21 MFC r264669: MFV r264666:
4374 dn_free_ranges should use range_tree_t
2014-05-09 07:54:59 +00:00
Xin LI
b6fe9b26d0 MFC r263889: MFV r263887:
3993 zpool(1M) and zfs(1M) should support -p for "list" and "get"
4700 "zpool get" doesn't support -H or -o options
2014-05-09 07:35:39 +00:00
Xin LI
efb3313055 MFC r263459 (MFV 263436-263438):
3947 zpool(1M) references nonexistent zfs-features(5)
  4540 zpool(1M) man page doesn't describe "readonly" property
  3948 zfs sync=default is not accepted
  4611 zfs(1M) still mentions 'send -r' in synopsis
  4415 zpool(1M) man page missing "import -m" description
  4570 Document dedupditto pool property
  4572 Dedup-related documentation additions for zpool and zdb.
  1371 Add -D option description to zpool(1M) manpage
  4571 Add documentation for -T and interval to "zpool list"
2014-05-09 07:34:38 +00:00
Steven Hartland
b41f6e75e6 MFC r264851
Eliminated optarg global being used outside of the function which called getopt

Sponsored by:	Multiplay
2014-05-08 08:26:20 +00:00
Mark Johnston
eeaade54e0 MFC r262542:
Move some files that are identical on i386 and amd64 to an x86 subdirectory
rather than keeping duplicate copies.
2014-05-03 16:09:08 +00:00
Pedro F. Giffuni
7c4ac14b1b MFC r264040:
4248 dtrace(1M) should never create DOF with empty probes section
4249 Only probes from the first DTrace object file will be included

Illumos Revision:	4a20ab41aadcb81c53e72fc65886e964e9add59

Reference:
https://www.illumos.org/issues/4248
https://www.illumos.org/issues/4249

Obtained from:	Illumos
2014-05-02 20:13:52 +00:00
Xin LI
9b4cea771a MFC r264467:
Take into account when zpool history block grows exceeding 128KB in zpool(8)
and zdb(8) by growing the buffer on demand with a cap of 1GB (specified in
spa_history_create_obj()).

PR:		bin/186574
Submitted by:	Andrew Childs <lorne cons org nz> (with changes)
2014-04-28 06:11:44 +00:00
Mark Johnston
0e14cff126 MFC r262596:
4478 dtrace_dof_maxsize is far too small

illumos/illumos-gate@d339a29bb4
2014-04-23 03:30:00 +00:00
Xin LI
d6593a2a8b MFC r263385:
Remove unused option -r from zpool.

Submitted by:	Richard Yao <ryao gentoo org>
2014-04-03 01:02:14 +00:00
Dimitry Andric
81ed74b00e MFC r260880 (by kaiw, from projects/elftoolchain):
* Make die_mem_offset() be able to handle DW_AT_data_member_location
    attributes generated by Clang 3.4.
  * Document how different compilers generate DW_AT_data_member_location
    attributes differently.
  * Document the quirks about DW_FORM_data[48].

This is a slightly modified version, adapted to work with the old
libdwarf in stable/9 and stable/10.  It should fix DTrace on these
branches, when the kernel is compiled with clang 3.4.

Note that you have to build *and* install the CTF tools first, before
building the kernel.  Otherwise you can possibly still get error
messages similar to "failed to copy type of 'pr_uid': Type information
is in parent and unavailable", when attempting to run dtrace(1).

Submitted by:	kaiw
2014-03-29 17:18:23 +00:00
Alan Somers
78434c8b95 MFC r262912
cddl/contrib/opensolaris/lib/libuutil/common/uu_avl.c
	Fix a memory leak in uu_avl_pool_create: pthread_mutex_init without
	a corresponding pthread_mutex_destroy.  It shows up, among other
	places, when doing "zfs list
2014-03-28 15:41:04 +00:00
Xin LI
fcd387b8d2 MFC r260183:
MFV r260154 + 260182:

4369 implement zfs bookmarks
4368 zfs send filesystems from readonly pools

Illumos/illumos-gate@78f1710053
2014-03-20 00:38:46 +00:00
Xin LI
d5b2406adb MFC r254755: MFV r254748:
Fix memory leak in libzfs's iter_dependents_cb().

Illumos ZFS issues:
  4061 libzfs: memory leak in iter_dependents_cb()
2014-03-20 00:32:26 +00:00