aboutsummaryrefslogtreecommitdiff
path: root/cddl
Commit message (Collapse)AuthorAgeFilesLines
* Fix an unchecked return value in zfsdAlan Somers2017-01-181-2/+5
| | | | | | | | | | | | It's pretty unlikely to actually hit this, but good to check it anyway Reported by: Coverity CID: 1362018 MFC after: 4 weeks Sponsored by: Spectra Logic Corp Notes: svn path=/head/; revision=312396
* Convert ipv4_flags and ipv4_offset fields into host byte order.Andrey V. Elsukov2016-12-291-2/+2
| | | | | | | | | | | Also save only high bits in the ipv4_flags, because it is defined as uint8_t. So now it will show DF and MF flags as 0x40 and 0x20. Reviewed by: markj@ MFC after: 1 week Notes: svn path=/head/; revision=310785
* Avoid modifying the object string table when patching USDT probes.Mark Johnston2016-12-201-5/+8
| | | | | | | | | | | | | | | | | dtrace converts pairs of consecutive underscores in a probe name to dashes. When dtrace -G processes relocations corresponding to USDT probe sites, it performs this conversion on the corresponding symbol names prior to looking up the resulting probe names in the USDT provider definition. However, in so doing it would actually modify the input object's string table, which breaks the string suffix merging done by recent binutils. Because we don't care about the symbol name once the probe site is recorded, just perform the probe lookup using a temporary copy. Reported by: hrs, swills MFC after: 3 weeks Notes: svn path=/head/; revision=310332
* Consistently print D variable indices in decimal when disassembling.Mark Johnston2016-12-201-1/+1
| | | | | | | MFC after: 1 week Notes: svn path=/head/; revision=310316
* Skip a ustack test that triggers an assertion on INVARIANTS kernels.Mark Johnston2016-12-141-0/+3
| | | | | | | | | Reported by: ngie Sponsored by: Dell EMC Isilon X-MFC-With: r309698 Notes: svn path=/head/; revision=310085
* err.D_PROC_CREATEFAIL.many.d passes, so remove the EFAIL annotation.Mark Johnston2016-12-081-3/+0
| | | | | | | | MFC after: 1 week Sponsored by: Dell EMC Isilon Notes: svn path=/head/; revision=309718
* Use the correct path to date(1).Mark Johnston2016-12-073-3/+3
| | | | | | | | MFC after: 1 week Sponsored by: Dell EMC Isilon Notes: svn path=/head/; revision=309700
* Use the native data model instead of forcing ILP32 in tst.provregex3.ksh.Mark Johnston2016-12-071-1/+1
| | | | | | | | MFC after: 1 week Sponsored by: Dell EMC Isilon Notes: svn path=/head/; revision=309699
* Run DTrace test scripts with "tst" set to the test script file name.Mark Johnston2016-12-071-1/+1
| | | | | | | | MFC after: 1 week Sponsored by: Dell EMC Isilon Notes: svn path=/head/; revision=309698
* libdtrace: Don't use a read-only handle for enumerating pid probes.Mark Johnston2016-12-061-1/+6
| | | | | | | | | | | | | Enumeration of return probes involves disassembling subroutines in the target process, and ptrace(2) is currently used to read from the target process. libproc could read from the backing file instead to avoid this problem, but in the common case libdtrace will have a writeable handle on the process anyway. In particular, a writeable handle is needed to list USDT probes, and libdtrace will cache such a handle for processes that it controls via dtrace -c and -p. Notes: svn path=/head/; revision=309599
* libproc: Add support for some proc_attach() flags.Mark Johnston2016-12-062-3/+3
| | | | | | | | | | This change adds some handling for the equivalent of Solaris' PGRAB_* flags. In particular, support for PGRAB_RDONLY is needed to avoid a nasty deadlock: dtrace(1) may otherwise stop the master process for its pseudo-terminal and end up blocking while writing to standard output. Notes: svn path=/head/; revision=309597
* libproc: Match prefixes when looking up mapped object by name.Mark Johnston2016-12-061-1/+1
| | | | | | | | | | | | | | | | | When looking up an object by name, allow prefix matches if no direct match is found. This allows one to, for example, match libc entry probes with: # dtrace -n 'pid$target:libc.so::entry' -c ./foo instead of requiring "libc.so.7" or a glob. Also remove proc_obj2map() as it currently just duplicates the functionality of proc_name2map(). It's supposed to take a Solaris link-map ID as a paramter, but support for this isn't implemented and isn't required to support DTrace's pid provider. Notes: svn path=/head/; revision=309595
* Revert r253678, r253661:Pedro F. Giffuni2016-12-034-55/+6
| | | | | | | | | | | | | | | | Fix a segfault in ctfmerge(1) due to a bug in GCC. The change was correct and the bug real, but upstream didn't adopt it and we want to remain in sync. When/if upstream does something about it we can bring their version. The bug in question was fixed in GCC 4.9 which is now the default in FreeBSD's ports. Our native gcc-4.2, which is still in use in some Tier-2 platforms also has a workaround so no end-user should be harmed by the revert. Notes: svn path=/head/; revision=309490
* MFV r308989: 6428 set canmount=off on unmounted filesystem tries toAndriy Gapon2016-11-241-1/+1
| | | | | | | | | | | unmount children This is a cosmetic and bookkeeping change as the actual change is already in FreeBSD. See r297521, r304520, r308985. Notes: svn path=/head/; revision=309096
* revert r304520, set canmount=on is not supposed to mount the filesystemAndriy Gapon2016-11-221-8/+3
| | | | | | | | | | | | | Not sure where I got the idea that it should. See https://github.com/openzfs/openzfs/pull/218 Reported by: mahrens Pointyhat to: avg MFC after: 5 days Notes: svn path=/head/; revision=308985
* After some ZIL changes 6 years ago zil_slog_limit got partially brokenAlexander Motin2016-11-171-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | due to zl_itx_list_sz not updated when async itx'es upgraded to sync. Actually because of other changes about that time zl_itx_list_sz is not really required to implement the functionality, so this patch removes some unneeded broken code and variables. Original idea of zil_slog_limit was to reduce chance of SLOG abuse by single heavy logger, that increased latency for other (more latency critical) loggers, by pushing heavy log out into the main pool instead of SLOG. Beside huge latency increase for heavy writers, this implementation caused double write of all data, since the log records were explicitly prepared for SLOG. Since we now have I/O scheduler, I've found it can be much more efficient to reduce priority of heavy logger SLOG writes from ZIO_PRIORITY_SYNC_WRITE to ZIO_PRIORITY_ASYNC_WRITE, while still leave them on SLOG. Existing ZIL implementation had problem with space efficiency when it has to write large chunks of data into log blocks of limited size. In some cases efficiency stopped to almost as low as 50%. In case of ZIL stored on spinning rust, that also reduced log write speed in half, since head had to uselessly fly over allocated but not written areas. This change improves the situation by offloading problematic operations from z*_log_write() to zil_lwb_commit(), which knows real situation of log blocks allocation and can split large requests into pieces much more efficiently. Also as side effect it removes one of two data copy operations done by ZIL code WR_COPIED case. While there, untangle and unify code of z*_log_write() functions. Also zfs_log_write() alike to zvol_log_write() can now handle writes crossing block boundary, that may also improve efficiency if ZPL is made to do that. Sponsored by: iXsystems, Inc. Notes: svn path=/head/; revision=308782
* Define dependencies for some auto-generated source files in libdtrace.Mark Johnston2016-11-171-7/+5
| | | | | | | | | | | Remove an unneeded beforedepend rule. Reported by: emaste, jhb Reviewed by: bdrewery MFC after: 1 week Notes: svn path=/head/; revision=308773
* Remove the DTrace printt and typeref actions.Mark Johnston2016-11-126-409/+10
| | | | | | | | | | | | | These are FreeBSD-specific and were added in r178576 to provide the ability to pretty-print instances of compound types. However, the print action has long since been augmented to provide this functionality with a simpler interface. Discussed with: gnn Differential Revision: https://reviews.freebsd.org/D8478 Notes: svn path=/head/; revision=308582
* MFV r308222: 6051 lzc_receive: allow the caller to read the begin recordAndriy Gapon2016-11-032-8/+41
| | | | | | | | | | | | | | | | | | | | | | | | | | | illumos/illumos-gate@620f322510b2d6433f7f6af60fa52380c07756ad https://github.com/illumos/illumos-gate/commit/620f322510b2d6433f7f6af60fa52380c07756ad https://www.illumos.org/issues/6051 Currently lzc_receive() requires that its snapname argument is a snapshot name (contains '@'). zfs receive allows to specify just a dataset name and would try to deduce the snapshot name from the stream. I propose to allow lzc_receive() to do the same. That seems to be quite easy to implement, it requires only a small amount of logic, it does not require any additional system calls or any additional data from the stream. The benefit is that the new behavior would allow to keep the snapshot names the same between the sender and receiver at zero cost, without a need to pass the names out of band. Reviewed by: Matthew Ahrens <mahrens@delphix.com> Reviewed by: Paul Dagnelie <pcd@delphix.com> Approved by: Robert Mustacchi <rm@joyent.com> Author: Andriy Gapon <avg@icyb.net.ua> MFC after: 2 weeks Notes: svn path=/head/; revision=308247
* zfsbootcfg: a simple tool to set next boot (one time) options for zfsbootAndriy Gapon2016-10-292-0/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | (gpt)zfsboot will read one-time boot directives from a special ZFS pool area. The area was previously described as "Boot Block Header", but currently it is know as Pad2, marked as reserved and is zeroed out on pool creation. The new code interprets data in this area, if any, using the same format as boot.config. The area is immediately wiped out. Failure to parse the directives results in a reboot right after the cleanup. Otherwise the boot sequence proceeds as usual. zfsbootcfg writes zfsboot arguments specified on its command line to the Pad2 area of a disk identified by vfs.zfs.boot.primary_pool and vfs.zfs.boot.primary_vdev kenv variables that are set by loader during boot. Please see the manual page for more. Thanks to all who reviewed, contributed and made suggestions! There are many potential improvements to the feature, please see the review for details. Reviewed by: wblock (docs) Discussed with: jhb, tsoome MFC after: 3 weeks Relnotes: yes Differential Revision: https://reviews.freebsd.org/D7612 Notes: svn path=/head/; revision=308089
* Fix tst.args1.c on LP64 platforms.Mark Johnston2016-10-161-2/+2
| | | | | | | | | | The untyped probe arguments have a width larger than int on such platforms, so printing their value without a cast can give unexpected results. MFC after: 1 week Notes: svn path=/head/; revision=307401
* tst.kpriv.ksh fails because DTrace privilege levels are unimplemented.Mark Johnston2016-10-161-0/+1
| | | | | | | MFC after: 1 week Notes: svn path=/head/; revision=307400
* Corrected non-portable reuse of va_list in dt_printf()George V. Neville-Neil2016-10-111-5/+16
| | | | | | | | | | | Submitted by: Graeme Jenkinson Reviewed by: markj MFC after: 2 weeks Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D8157 Notes: svn path=/head/; revision=307044
* MFV r304159: 7277 zdb should be able to print zfs_dbgmsg'sAlexander Motin2016-09-031-4/+22
| | | | | | | | | | | | | | | | | | | | illumos/illumos-gate@29bdd2f916366ece37c4748bca6b3d61f57a223b https://github.com/illumos/illumos-gate/commit/29bdd2f916366ece37c4748bca6b3d61f 57a223b https://www.illumos.org/issues/7277 ztest always prints the debug messages (zfs_dbgmsg()) by calling zfs_dbgmsg_print(). We should add a flag to zdb to make it do this as well before exiting. Reviewed by: George Wilson <george.wilson@delphix.com> Reviewed by: Matthew Ahrens <mahrens@delphix.com> Reviewed by: Igor Kozhukhov <ikozhukhov@gmail.com> Approved by: Dan McDonald <danmcd@omniti.com> Author: Pavel Zakharov <pavel.zakharov@delphix.com> Notes: svn path=/head/; revision=305332
* MFV r303081: 7163 ztest failures due to excess error injectionAlexander Motin2016-09-031-2/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | illumos/illumos-gate@f34284d835bc555f987c1310df46c034c3101155 https://github.com/illumos/illumos-gate/commit/f34284d835bc555f987c1310df46c034c 3101155 https://www.illumos.org/issues/7163 Running zloop from zfs-precommit hit this assertion: *panicstr/s 0xfffffd7fd7419370: assertion failed for thread 0xfffffd7fe29ed240, thread-id 577: parent != NULL, file ../../../uts/common/fs/zfs/dbuf.c, line 1827 $c libc.so.1`_lwp_kill+0xa() libc.so.1`_assfail+0x182(fffffd7ffb1c29fa, fffffd7ffb1cc028, 723) libc.so.1`assfail+0x19(fffffd7ffb1c29fa, fffffd7ffb1cc028, 723) libzpool.so.1`dbuf_dirty+0xc69(10e3bc10, 3601700) libzpool.so.1`dbuf_dirty+0x61e(10c73640, 3601700) libzpool.so.1`dbuf_dirty+0x61e(10e28280, 3601700) libzpool.so.1`dmu_buf_will_fill+0x64(10e28280, 3601700) libzpool.so.1`dmu_write+0x1b6(2c7e640, d, 400000002e000000, 200, 3717b40, 3601700) ztest_replay_write+0x568(4950d0, 3717a80, 0) ztest_write+0x125(4950d0, d, 400000002e000000, 200, 413f000) ztest_io+0x1bb(4950d0, d, 400000002e000000) ztest_dmu_write_parallel+0xaa(4950d0, 6) ztest_execute+0x83(1, 420c98, 6) ztest_thread+0xf4(6) libc.so.1`_thrp_setup+0x8a(fffffd7fe29ed240) libc.so.1`_lwp_start() This is another manifestation of ECKSUM in ztest: The lowest level ancestor that’s in memory is the L8 (topmost). The L7 ancestor is blkid 0x10: ::dbufs -O 0x2c7e640 -o d -l 7 |::dbuf addr object lvl blkid holds os 600be50 d 7 4 1 ztest/ds_6 719d880 d 7 0 4 ztest/ds_6 Reviewed by: George Wilson <george.wilson@delphix.com> Reviewed by: Paul Dagnelie <pcd@delphix.com> Approved by: Robert Mustacchi <rm@joyent.com> Author: Matthew Ahrens <mahrens@delphix.com> Notes: svn path=/head/; revision=305328
* MFV r303080: 6451 ztest fails due to checksum errorsAlexander Motin2016-09-031-1/+26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | illumos/illumos-gate@f9eb9fdf196b6ed476e4ffc69cecd8b0da3cb7e7 https://github.com/illumos/illumos-gate/commit/f9eb9fdf196b6ed476e4ffc69cecd8b0d a3cb7e7 https://www.illumos.org/issues/6451 Sometimes ztest fails because zdb detects checksum errors. e.g.: Traversing all blocks to verify checksums and verify nothing leaked ... zdb_blkptr_cb: Got error 50 reading <71, 47, 0, 8000160> DVA0=<0:1cc2000: 180000> [L0 other uint64[]] sha256 uncompressed LE contiguou s unique single size=100000L/100000P birth=271L/271P fill=1 cksum=c5a3e27d1ed0f894:843bca3a5473c4bf:f76a19b6830a2e4:91292591613a12bf -- skipping zdb_blkptr_cb: Got error 50 reading <71, 47, 0, 800000180> DVA0=<0:ce16800: 180000> [L0 other uint64[]] sha256 uncompressed LE contigu ous unique single size=100000L/100000P birth=840L/840P fill=1 cksum=5d018f3d061e17f3:6d1584784587bf63:2805a74a0ce37369:ba68a214806c7e75 -- skipping zdb_blkptr_cb: Got error 50 reading <71, 47, 0, 1000000360> DVA0=<0:10d37400: 180000> [L0 other uint64[]] sha256 uncompressed LE conti guous unique single size=100000L/100000P birth=904L/904P fill=1 cksum=fa1e11d4138bd14b:86c9488c444473e3:f31e43c72e72e46b:e3446472d1174d ba -- skipping zdb_blkptr_cb: Got error 50 reading <71, 47, 0, 400000002c0> DVA0=<0:127ef400: 180000> [L0 other uint64[]] sha256 uncompressed LE cont iguous dedup single size=100000L/100000P birth=549L/549P fill=1 cksum=30e14955ebf13522:66dc2ff8067e6810:4607e750abb9d3b3:6582b8af909fcb 58 -- skipping zdb_blkptr_cb: Got error 50 reading <657, 5, 0, 1c0> DVA0=<0:1a180400:180000> [L0 other uint64[]] fletcher4 uncompressed LE contiguou s unique single size=100000L/100000P birth=1091L/1091P fill=1 cksum=a6cf1e50: 29b3bd01c57e5:36779b914035db9a:db61cdcf6bec56f0 -- skippin g The problem is that ztest_fault_inject() can inject multiple faults into the same block. It is designed such that it can inject errors on all leafs of a RAID-Z or mirror, but for a given range of offsets, it will only inject errors Reviewed by: George Wilson <george.wilson@delphix.com> Reviewed by: Prakash Surya <prakash.surya@delphix.com> Reviewed by: Jorgen Lundman <lundman@lundman.net> Approved by: Dan McDonald <danmcd@omniti.com> Author: Matthew Ahrens <mahrens@delphix.com> Notes: svn path=/head/; revision=305327
* MFV r303079:Alexander Motin2016-09-031-3/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 7147 ztest: ztest_ddt_repair fails with ztest_pattern_match assertion illumos/illumos-gate@aab80726335c76a7cae32c7300890248d73a51e3 https://github.com/illumos/illumos-gate/commit/aab80726335c76a7cae32c7300890248d 73a51e3 https://www.illumos.org/issues/7147 Here's the dbuf we're currently reading: 966f200::dbuf addr object lvl blkid holds os 966f200 4 0 0 1 ztest/ds_3 966f200::print dmu_buf_t db_data db_data = 0x9ae0400 0x9ae0400/10J 0x9ae0400: c1c7ced932020d c1c7ced932020d c1c7ced932020d c1c7ced932020d c1c7ced932020d c1c7ced932020d c1c7ced932020d c1c7ced932020d c1c7ced932020d c1c7ced932020d The pattern we're expecting is actually this: a34ae10b5f2db2. If we attempt to read the block on disk we find that it has matches what ztest_ddt_repair() would have written: ~c1c7ced932020d=J ff3e383126cdfdf2 966f200::print dmu_buf_impl_t db_blkptr | ::blkptr DVA0=<0:71d3c00:800> [L0 UINT64_OTHER] SHA256 OFF LE contiguous dedup single size=400L/400P birth=55L/55P fill=1 cksum=18486450d3ce8c6d:75a72f4bbf117b0f:2d3a226314eb5650:2eb0fd68648b1af0 1. zdb -U /rpool/tmp/zpool.cache -R ztest 0:71d3c00:800 | head Found vdev type: mirror 0:71d3c00:800 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef 000000: ff3e383126cdfdf2 ff3e383126cdfdf2 ...&18>....&18>. 000010: ff3e383126cdfdf2 ff3e383126cdfdf2 ...&18>....&18>. 000020: ff3e383126cdfdf2 ff3e383126cdfdf2 ...&18>....&18>. 000030: ff3e383126cdfdf2 ff3e383126cdfdf2 ...&18>....&18>. 000040: ff3e383126cdfdf2 ff3e383126cdfdf2 ...&18>....&18>. 000050: ff3e383126cdfdf2 ff3e383126cdfdf2 ...&18>....&18>. Reviewed by: Matthew Ahrens <mahrens@delphix.com> Reviewed by: Prakash Surya <prakash.surya@delphix.com> Approved by: Robert Mustacchi <rm@joyent.com> Author: George Wilson <george.wilson@delphix.com> Notes: svn path=/head/; revision=305326
* MFV r302991: 6950 ARC should cache compressed dataAlexander Motin2016-09-032-1/+8
| | | | | | | | | | | | | | | | | | | | | | | | illumos/illumos-gate@dcbf3bd6a1f1360fc1afcee9e22c6dcff7844bf2 https://github.com/illumos/illumos-gate/commit/dcbf3bd6a1f1360fc1afcee9e22c6dcff7844bf2 https://www.illumos.org/issues/6950 When reading compressed data from disk, the ARC should keep the compressed block cached and only decompress it when consumers access the block. The uncompressed data should be short-lived allowing the ARC to cache a much larger amount of data. The DMU would also maintain a smaller cache of uncompressed blocks to minimize the impact of decompressing frequently accessed blocks. Reviewed by: Prakash Surya <prakash.surya@delphix.com> Reviewed by: Dan Kimmel <dan.kimmel@delphix.com> Reviewed by: Matt Ahrens <mahrens@delphix.com> Reviewed by: Paul Dagnelie <pcd@delphix.com> Reviewed by: Don Brady <don.brady@intel.com> Reviewed by: Richard Elling <Richard.Elling@RichardElling.com> Approved by: Richard Lowe <richlowe@richlowe.net> Author: George Wilson <george.wilson@delphix.com> Notes: svn path=/head/; revision=305323
* MFV r302662: 6447 handful of nvpair cleanupsAlexander Motin2016-09-011-3/+5
| | | | | | | | | | | | | | | | | | | | | | | | | illumos/illumos-gate@759e89be359f2af635e4122d147df56bce948773 https://github.com/illumos/illumos-gate/commit/759e89be359f2af635e4122d147df56bc e948773 https://www.illumos.org/issues/6447 I got a patch from someone who uses nvpair code outside of illumos. It fixes a couple of gcc warnings/bugs for him. 1. silence uninitialized use warnings 2. add parentheses around assignment used as truth value 3. fix printf format specifier (ll is for integers only) 4. strstr, strspn, strcspn, and strcmp are declared in string.h, not strings.h. 5. avoid scanning integer into boolean variable Reviewed by: Josef 'Jeff' Sipek <jeffpc@josefsipek.net> Reviewed by: Andy Stormont <astormont@racktopsystems.com> Reviewed by: Garrett D'Amore <garrett@damore.org> Approved by: Robert Mustacchi <rm@joyent.com> Author: Steve Dougherty <sdougherty@barracuda.com> Notes: svn path=/head/; revision=305211
* MFV r302660: 6314 buffer overflow in dsl_dataset_nameAlexander Motin2016-09-0116-122/+131
| | | | | | | | | | | | | | | | | | | | illumos/illumos-gate@9adfa60d484ce2435f5af77cc99dcd4e692b6660 https://github.com/illumos/illumos-gate/commit/9adfa60d484ce2435f5af77cc99dcd4e6 92b6660 https://www.illumos.org/issues/6314 Callers of dsl_dataset_name pass a buffer of size ZFS_MAXNAMELEN, but dsl_dataset_name copies the datasets' name PLUS the snapshot name to it, resulting in a max of 2 * ZFS_MAXNAMELEN + '@'. Reviewed by: George Wilson <george.wilson@delphix.com> Reviewed by: Prakash Surya <prakash.surya@delphix.com> Reviewed by: Igor Kozhukhov <ikozhukhov@gmail.com> Approved by: Dan McDonald <danmcd@omniti.com> Author: Matthew Ahrens <mahrens@delphix.com> Notes: svn path=/head/; revision=305209
* MFV r302659: 6931 lib/libzfs: cleanup gcc warningsAlexander Motin2016-09-017-54/+68
| | | | | | | | | | | | | | | | | | illumos/illumos-gate@88f61dee20b358671b1b643e9d1dbf220a1d69be https://github.com/illumos/illumos-gate/commit/88f61dee20b358671b1b643e9d1dbf220a1d69be https://www.illumos.org/issues/6931 need cleanup: CERRWARN += -_gcc=-Wno-switch CERRWARN += -_gcc=-Wno-parentheses CERRWARN += -_gcc=-Wno-unused-function Reviewed by: Matthew Ahrens <mahrens@delphix.com> Approved by: Robert Mustacchi <rm@joyent.com> Author: Igor Kozhukhov <ikozhukhov@gmail.com> Notes: svn path=/head/; revision=305207
* MFV r302658: 6872 zfs libraries should not allow uninitialized variablesAlexander Motin2016-09-014-9/+9
| | | | | | | | | | | | | | | | | | | | illumos/illumos-gate@f83b46baf98d276f5f84fa84c8b461f412ac1f5e https://github.com/illumos/illumos-gate/commit/f83b46baf98d276f5f84fa84c8b461f41 2ac1f5e https://www.illumos.org/issues/6872 We compile the zfs libraries with -Wno-uninitialized. We should remove this. Change makefiles, fix new warnings, fix pbchk errors. Reviewed by: Dan Kimmel <dan.kimmel@delphix.com> Reviewed by: George Wilson <george.wilson@delphix.com> Reviewed by: Prakash Surya <prakash.surya@delphix.com> Reviewed by: Yuri Pankov <yuri.pankov@nexenta.com> Approved by: Robert Mustacchi <rm@joyent.com> Author: Paul Dagnelie <pcd@delphix.com> Notes: svn path=/head/; revision=305206
* MFV r302657: 4521 zfstest is trying to execute evil "zfs unmount -a"Alexander Motin2016-09-014-13/+48
| | | | | | | | | | | | | | | | | | | | | | | | | | illumos/illumos-gate@8808ac5dae118369991f158b6ab736cb2691ecde https://github.com/illumos/illumos-gate/commit/8808ac5dae118369991f158b6ab736cb2 691ecde https://www.illumos.org/issues/4521 zfstest is trying to execute evil "zfs unmount -a", which fails (fortunately, as it would otherwise leave me with my ~ missing): 03:44:11.86 cannot unmount '/export/home/yuri': Device busy cannot unmount '/ export/home': Device busy 03:44:11.86 ERROR: /usr/sbin/zfs unmount -a exited 1 This affects, at least, zfs_mount_009_neg and zfs_mount_all_001_pos, both failing on that step. The pool containing the /export/home hierarchy is included in KEEP variable, but it doesn't seem to affect anything here. Reviewed by: Andriy Gapon <avg@FreeBSD.org> Reviewed by: Dan McDonald <danmcd@omniti.com> Reviewed by: Matthew Ahrens <mahrens@delphix.com> Reviewed by: John Kennedy <john.kennedy@delphix.com> Approved by: Robert Mustacchi <rm@joyent.com> Author: Yuri Pankov <yuri.pankov@nexenta.com> Notes: svn path=/head/; revision=305205
* MFV r302655: 6873 zfs_destroy_snaps_nvl leaks errlistAlexander Motin2016-09-011-2/+5
| | | | | | | | | | | | | | | | | | illumos/illumos-gate@4cde22c29999ffb907ca39d2ebd512812f7e5168 https://github.com/illumos/illumos-gate/commit/4cde22c29999ffb907ca39d2ebd512812 f7e5168 https://www.illumos.org/issues/6873 lzc_destroy_snaps() returns an nvlist in errlist. zfs_destroy_snaps_nvl() should nvlist_free() it before returning. Reviewed by: Matthew Ahrens <mahrens@delphix.com> Reviewed by: Paul Dagnelie <pcd@delphix.com> Approved by: Dan McDonald <danmcd@omniti.com> Author: Chris Williamson <chris.williamson@delphix.com> Notes: svn path=/head/; revision=305203
* MFV r302654:Alexander Motin2016-09-011-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | 6879 incorrect endianness swap for drr_spill.drr_length in libzfs_sendrecv.c illumos/illumos-gate@20fea7a47472aceb64d3ed48cc2a3ea268bc4795 https://github.com/illumos/illumos-gate/commit/20fea7a47472aceb64d3ed48cc2a3ea26 8bc4795 https://www.illumos.org/issues/6879 In libzfs_sendrecv, there's a typo: case DRR_SPILL: if (byteswap) { drr->drr_u.drr_write.drr_length = BSWAP_64(drr->drr_u.drr_spill.drr_length); } Instead of drr_write.drr_length, we should be assigning the result of the byteswap to drr_spill.drr_length. Reviewed by: Matthew Ahrens <mahrens@delphix.com> Reviewed by: Paul Dagnelie <pcd@delphix.com> Approved by: Robert Mustacchi <rm@joyent.com> Author: Dan Kimmel <dan.kimmel@delphix.com> Notes: svn path=/head/; revision=305202
* MFV r302653: 6111 zfs send should ignore datasets created after the ending ↵Alexander Motin2016-09-011-6/+108
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | snapshot illumos/illumos-gate@4a20c933b148de8a1c1d3538391c64284e636653 https://github.com/illumos/illumos-gate/commit/4a20c933b148de8a1c1d3538391c64284 e636653 https://www.illumos.org/issues/6111 If you create a zfs child folder, zfs send returns an error when a recursive incremental send is done between two snapshots made prior to the folder creation. The problem can be reproduced with the following steps. root@zfs:/# zfs create pool/test root@zfs:/# zfs snapshot pool/test@snap1 root@zfs:/# zfs snapshot pool/test@snap2 root@zfs:/# zfs create pool/test/child root@zfs:/# zfs send -R -I pool/test@snap1 pool/test@snap2 > /dev/null WARNING: could not send pool/test/child@snap2: does not exist WARNING: could not send pool/test/child@snap2: does not exist root@zfs:/# echo $? 1 root@zfs:/# zfs snapshot -r pool/test@snap3 root@zfs:/# zfs send -R -I pool/test@snap1 pool/test@snap3 > /dev/null root@zfs:/# echo $? 0 root@zfs:/# zfs send -R -I pool/test@snap2 pool/test@snap3 > /dev/null root@zfs:/# echo $? 0 Since pool/test/child was created after snap2, zfs send should not expect snap2 to be in pool/test/child when doing a recursive send. It should examine the compare the creation time of the snapshot and each child folder to decide if the folder will be sent. The next incremental send between snap2 and snap3 would properly create the child folder and snap3 which first appears in the child folder. The problem is identical if '-i' is used instead of '-I'. Reviewed by: Alex Aizman alex.aizman@nexenta.com Reviewed by: Alek Pinchuk alek.pinchuk@nexenta.com Reviewed by: Roman Strashkin roman.strashkin@nexenta.com Reviewed by: Matthew Ahrens <mahrens@delphix.com> Reviewed by: Paul Dagnelie <pcd@delphix.com> Approved by: Garrett D'Amore <garrett@damore.org> Author: Alex Deiter <alex.deiter@nexenta.com> Notes: svn path=/head/; revision=305201
* MFV r302643:Alexander Motin2016-09-018-18/+12
| | | | | | | | | 6902 speed up listing of snapshots if requesting name only and sorting by name This was our change from the beginning, so just reduce the upstream diff. Notes: svn path=/head/; revision=305195
* MFV r302642:Alexander Motin2016-09-011-1/+6
| | | | | | | | | | | | | | | | | | | | | | 6876 Stack corruption after importing a pool with a too-long name illumos/illumos-gate@c971037baa5d64dfecf6d87ed602fc3116ebec41 https://github.com/illumos/illumos-gate/commit/c971037baa5d64dfecf6d87ed602fc3116ebec41 https://www.illumos.org/issues/6876 Calling dsl_dataset_name on a dataset with a 256 byte buffer is asking for trouble. We should check every dataset on import, using a 1024 byte buffer and checking each time to see if the dataset's new name is longer than 256 bytes. Reviewed by: Prakash Surya <prakash.surya@delphix.com> Reviewed by: Dan Kimmel <dan.kimmel@delphix.com> Reviewed by: George Wilson <george.wilson@delphix.com> Reviewed by: Yuri Pankov <yuri.pankov@nexenta.com> Approved by: Richard Lowe <richlowe@richlowe.net> Author: Paul Dagnelie <pcd@delphix.com> Notes: svn path=/head/; revision=305194
* DIRDEPS_BUILD: Add some missing dirctories to the build.Bryan Drewery2016-08-311-0/+35
| | | | | | | Sponsored by: EMC / Isilon Storage Division Notes: svn path=/head/; revision=305148
* DIRDEPS_BUILD: Update dependencies.Bryan Drewery2016-08-313-0/+6
| | | | | | | Sponsored by: EMC / Isilon Storage Division Notes: svn path=/head/; revision=305146
* Recursively enumerate anonymous structs and unions in ctf_member_info().Mark Johnston2016-08-301-7/+24
| | | | | | | | | | | | Previously, ctf_member_info() would ignore members belonging to an anonymous struct or union. This made it impossible to, for example, trace the m_next field of an mbuf using DTrace. Reported and tested by: gallatin MFC after: 2 weeks Notes: svn path=/head/; revision=305055
* Remove redundant declarations and simplify ../ in pathingEnji Cooper2016-08-291-9/+2
| | | | | | | | | | | | | | - TESTSBASE and LOCALBASE are already defined in bsd.tests.mk - TESTSDIR is automatically divined as ${TESTSBASE}${RELDIR:H} after r289158. - Replace SRCDIR with SRCTOP MFC after: 1 week X-MFC with: r305019 Sponsored by: EMC / Isilon Storage Division Notes: svn path=/head/; revision=305020
* Remove unnecessary variable (SRCDIR) replaced by SRCTOP in Makefile.commonEnji Cooper2016-08-291-1/+0
| | | | | | | | | MFC after: 1 week X-MFC with: r305018 Sponsored by: EMC / Isilon Storage Division Notes: svn path=/head/; revision=305019
* Use SRCTOP instead of a homegrown definition for it (SRCDIR)Enji Cooper2016-08-291-14/+14
| | | | | | | | MFC after: 1 week Sponsored by: EMC / Isilon Storage Division Notes: svn path=/head/; revision=305018
* Fix the zfsd unittest:Dimitry Andric2016-08-292-2/+1
| | | | | | | | | | | | * TESTSDIR is supposed to be under cddl/usr.sbin, not cddl/sbin * DevdCtl::EventBuffer no longer exists, so remove its forward declaration MFC after: 3 days X-MFC-With: r305013 Notes: svn path=/head/; revision=305016
* Add an empty virtual destructor to zfsd's Vdev class. This is neededDimitry Andric2016-08-291-0/+10
| | | | | | | | | | | because the class has virtual functions, and the compiler-generated default destructor is non-virtual. Reviewed by: asomers MFC after: 3 days Notes: svn path=/head/; revision=305013
* Unlike Solaris, in FreeBSD p_args can be 0 so check for thatGeorge V. Neville-Neil2016-08-251-1/+1
| | | | | | | | | | | | instead of walking down to ar_args blindly. Reported by: Amanda Strnad Reviewed by: markj, jhb MFC after: 2 weeks Sponsored by: DARPA, AFRL Notes: svn path=/head/; revision=304825
* fix bug introduced in r297521, set canmount=on doesn't mount filesystemAndriy Gapon2016-08-201-3/+8
| | | | | | | | | | | | | | There are two cases where changing canmount should result in an action: - canmount is set to off for a mounted filesystem - canmount is set to on for an unmounted filesystem Before r297521 we could unmount and re-mount a filesystem when that was not necessary, but after r297521 we only handled the first of the above cases. MFC after: 5 days Notes: svn path=/head/; revision=304520
* Add a SIGINFO handler for dtrace(1).Mark Johnston2016-08-181-1/+25
| | | | | | | | | | | | Have it print the contents of aggregations, if any. Otherwise, one needs to kill the running script to view the collected data, or add code to periodically print it. Discussed with: gnn MFC after: 1 month Notes: svn path=/head/; revision=304431
* Regenerate DTrace tests.Mark Johnston2016-08-163-0/+28
| | | | Notes: svn path=/head/; revision=304201