summaryrefslogtreecommitdiffstats
path: root/cddl/contrib/opensolaris/lib
Commit message (Collapse)AuthorAgeFilesLines
* Preserve the errno value of an ioctl before calling free(3). Previously,markj2014-08-043-11/+14
| | | | | | | errno was very occasionally being clobbered, resulting in a bogus error from dt_consume() and thus an error from dtrace(1). MFC after: 2 weeks
* MFV r269010:delphij2014-07-261-0/+8
| | | | | | | | | | | | | | | Import Illumos changes to address the following Illumos issues: 4976 zfs should only avoid writing to a failing non-redundant top-level vdev 4978 ztest fails in get_metaslab_refcount() 4979 extend free space histogram to device and pool 4980 metaslabs should have a fragmentation metric 4981 remove fragmented ops vector from block allocator 4982 space_map object should proactively upgrade when feature is enabled 4984 device selection should use fragmentation metric MFC after: 2 weeks
* MFV r268453:delphij2014-07-092-19/+19
| | | | | | Diff reduction against Illumos. MFC after: 2 weeks
* Remove ia64.marcel2014-07-071-22/+2
| | | | | | | | | | | | | | | | | This includes: o All directories named *ia64* o All files named *ia64* o All ia64-specific code guarded by __ia64__ o All ia64-specific makefile logic o Mention of ia64 in comments and documentation This excludes: o Everything under contrib/ o Everything under crypto/ o sys/xen/interface o sys/sys/elf_common.h Discussed at: BSDcan
* MFV r268119:delphij2014-07-011-9/+12
| | | | | | | | 4914 zfs on-disk bookmark structure should be named *_phys_t illumos/illumos-gate@7802d7bf98dec568dadf72286893b1fe5abd8602 MFC after: 2 weeks
* - Fix handling of "new" style of ioctl in compatiblity mode [1];delphij2014-07-011-10/+17
| | | | | | | | - Reorganize code and reduce diff from upstream; - Improve forward compatibility shims for previous kernel; Reported by: sbruno [1] X-MFC-With: r268075
* MFV r267568:delphij2014-07-012-0/+26
| | | | | | | | 4891 want zdb option to dump all metadata illumos/illumos-gate@df15e419cb7359ba56ddddab9045e438d89e7cbc MFC after: 2 weeks
* MFV r267566:delphij2014-07-011-0/+1
| | | | | | 4390 i/o errors when deleting filesystem/zvol can lead to space map corruption MFC after: 2 weeks
* MFV r267565:delphij2014-07-014-9/+61
| | | | | | | 4757 ZFS embedded-data block pointers ("zero block compression") 4913 zfs release should not be subject to space checks MFC after: 2 weeks
* MFV illumosrpaulo2014-06-266-38/+724
| | | | | | | | 4471 DTrace count() with histogram 4472 DTrace full width distribution histograms 4473 DTrace frequency trails MFC after: 2 weeks
* MFV illumosrpaulo2014-06-2622-116/+724
| | | | | | | | | | 4474 DTrace Userland CTF Support 4475 DTrace userland Keyword 4476 DTrace tests should be better citizens 4479 pid provider types 4480 dof emulation is missing checks MFC after: 2 weeks
* MFV illumosrpaulo2014-06-261-2/+8
| | | | | | 4477 DTrace should speak JSON MFC after: 2 weeks
* MFV illumos r266986:rpaulo2014-06-261-3/+7
| | | | | | | | 2915 DTrace in a zone should see "cpu", "curpsinfo", et al 2916 DTrace in a zone should be able to access fds[] 2917 DTrace in a zone should have limited provider access MFC after: 2 weeks
* Revert r267898.rpaulo2014-06-266-737/+39
|
* Bring the following change from the illumos-joyent repository:rpaulo2014-06-266-39/+737
| | | | | | | | | | | | commit 78e24ab6803bbe11ba37642624e1498ede5b239d Author: Bryan Cantrill <bryan@joyent.com> Date: Thu Oct 31 01:20:54 2013 OS-1688 DTrace count() with histogram OS-2360 DTrace full width distribution histograms OS-2361 DTrace frequency trails MFC after: 2 weeks
* MFV r258381:pfg2014-06-251-2/+7
| | | | | | | | | | | | | 4251 libdtrace leaks open file handles Illumos commit: 93ed8d0d4b068b95d0bb50d57bb854df462a8485 (partial) Reference: https://www.illumos.org/issues/4251 Discussed with: Robert Mustacchi Obtained from: Illumos MFC after: 1 week
* Comment out some pointless device open/close around reading device IDs.mav2014-05-102-0/+8
| | | | | | | | | FreeBSD ZFS port unlike OpenSolaris does not use device IDs, and does not implement respective devid_*() fuctions. It is pointless to open devices just to close them back immediately. MFC after: 2 weeks Sponsored by: iXsystems, Inc.
* Re-apply r248644. This fixes an annoying problem which caused dtrace -c tomarkj2014-05-081-1/+1
| | | | | | | | | | | 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. MFC after: 2 weeks
* Silence compiler warning due to missing return in idmap_id_to_numeric_domain_ridsmh2014-04-241-0/+1
|
* MFV r264829:delphij2014-04-232-0/+40
| | | | | | 3897 zfs filesystem and snapshot limits MFC after: 2 weeks
* MFV r264666:delphij2014-04-182-8/+7
| | | | | | | | 4374 dn_free_ranges should use range_tree_t illumos/illumos-gate@bf16b11e8deb633dd6c4296d46e92399d1582df4 MFC after: 2 weeks
* Use the correct format specifiers for wide characters and strings of widemarkj2014-04-151-0/+5
| | | | | | characters. MFC after: 1 week
* Take into account when zpool history block grows exceeding 128KB in zpool(8)delphij2014-04-141-4/+26
| | | | | | | | | 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) MFC after: 2 weeks
* MFV r258379;pfg2014-04-023-8/+23
| | | | | | | | | | | | | | 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 MFC after: 1 month
* MFV r263887:delphij2014-03-283-12/+20
| | | | | | | 3993 zpool(1M) and zfs(1M) should support -p for "list" and "get" 4700 "zpool get" doesn't support -H or -o options MFC after: 2 weeks
* cddl/contrib/opensolaris/lib/libuutil/common/uu_avl.casomers2014-03-071-0/+1
| | | | | | | | | 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". MFC after: 3 weeks Sponsored by: Spectra Logic Corporation
* When our linker merges .SUNW_dof sections from multiple files, it simplymarkj2014-03-011-30/+58
| | | | | | | | | | | 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 Submitted by: Fedor Indutny <fedor@indutny.com> MFC after: 1 month
* MFV r262570:delphij2014-02-271-4/+11
| | | | | | | | 4626 libzfs memleak in zpool_in_use() illumos/illumos-gate@fb13f48f1d9593453b94cd1c7277553b56f493c8 MFC after: 2 weeks
* 1452 DTrace buffer autoscaling should be less violentmarkj2014-02-221-27/+0
| | | | | | | | | | | illumos/illumos-gate@6fb4854bed54ce82bd8610896b64ddebcd4af706 This fixes the tst.resize1.d and tst.resize2.d DTrace tests, which have been failing since r261122 since they were causing dtrace(1) to attempt to allocate and use large amounts of memory, and get killed by the OOM killer as a result. MFC after: 1 month
* dtrace: remove unexplained 16MB limitation from dt_alloc/dt_zallocavg2014-01-241-10/+0
| | | | | | | | | | The limitation was introduced in r178556 without any note or comment. It seems pretty artificial and now it leads to problems like the following: $ dtrace -x bufsize=17m -n ... dtrace: processing aborted: Memory allocation failure OpenSolaris and illumos never had this limitation. Sponsored by: HybridCluster
* MFV r260154 + 260182:delphij2014-01-028-60/+364
| | | | | | | | | 4369 implement zfs bookmarks 4368 zfs send filesystems from readonly pools Illumos/illumos-gate@78f171005391b928aaf1642b3206c534ed644332 MFC after: 2 weeks
* MFV r242733:delphij2013-12-312-1/+80
| | | | | | | | | | | | | | | 3306 zdb should be able to issue reads in parallel 3321 'zpool reopen' command should be documented in the man page and help message illumos/illumos-gate@31d7e8fa33fae995f558673adb22641b5aa8b6e1 FreeBSD porting notes: the kernel part of this changeset depends on Solaris buf(9S) interfaces and are not really applicable for our use. vdev_disk.c is patched as-is to reduce diverge from upstream, but vdev_file.c is left intact. MFC after: 2 weeks
* When clearing relocations to __dtrace* symbols, handle both SHT_REL andmarkj2013-12-291-4/+11
| | | | | | | | SHT_RELA sections properly instead of assuming that the relocation section is of type SHT_REL. Submitted by: Prashanth Kumar <pra_udupi@yahoo.co.in> (original version) MFC after: 1 month
* MFV r258384:delphij2013-12-252-8/+10
| | | | | | | | 2583 Add -p (parsable) option to zfs list illumos/illumos-gate@43d68d68c1ce08fb35026bebfb141af422e7082e MFC after: 2 weeks
* MFV r258374:delphij2013-12-241-6/+5
| | | | | | | | | | | 4171 clean up spa_feature_*() interfaces 4172 implement extensible_dataset feature for use by other zpool features illumos/illumos-gate@2acef22db7808606888f8f92715629ff3ba555b9 MFC after: 2 weeks
* Don't even try to read vdev labels from devices smaller then SPA_MINDEVSIZEmav2013-12-101-2/+9
| | | | | | (64MB). Even if we would find one somehow, ZFS kernel code rejects such devices. It is funny to look on attempts to read 4 256K vdev labels from 1.44MB floppy, though it is not very practical and quite slow.
* The uaddr, ufunc, umod and usym functions all seem to work as expected onmarkj2013-12-041-8/+0
| | | | | | FreeBSD, so stop hiding them behind a "#if defined(sun)". Reported by: Prashanth Kumar <pra_udupi@yahoo.co.in>
* Use mkstemp(3) to create the temporary file used in the FreeBSD-specificmarkj2013-12-031-8/+10
| | | | portions of dtrace_program_link().
* MFV r255255: 4045 zfs write throttle & i/o scheduler performance workavg2013-11-261-0/+3
| | | | | | | | | | | | | illumos/illumos-gate@69962b5647e4a8b9b14998733b765925381b727e Please note the following changes: - zio_ioctl has lost its priority parameter and now TRIM is executed with 'now' priority - some knobs are gone and some new knobs are added; not all of them are exposed as tunables / sysctls yet MFC after: 10 days Sponsored by: HybridCluster [merge]
* 734 taskq_dispatch_prealloc() desiredavg2013-11-262-34/+83
| | | | | | | | | | | | | | | | | | | | 943 zio_interrupt ends up calling taskq_dispatch with TQ_SLEEP illumos/illumos-gate@5aeb94743e3be0c51e86f73096334611ae3a058e Essentially FreeBSD taskqueues already operate in a mode that was added to Illumos with taskq_dispatch_ent change. We even exposed the superior FreeBSD interface as taskq_dispatch_safe. Now we just rename taskq_dispatch_safe to taskq_dispatch_ent and struct struct ostask to taskq_ent_t, so that code differences will be minimal. After this change sys/cddl/compat/opensolaris/sys/taskq.h header is no longer needed. Note that this commit is not an MFV because the upstream change was not individually committed to the vendor area. MFC after: 8 days
* Don't try to use the 32-bit drti.o unless the data model is explicitly setmarkj2013-11-091-3/+1
| | | | | | | | | | | | | | 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. MFC after: 2 weeks
* Quiesce warning regarding %llf which has no effect.sbruno2013-11-041-1/+1
| | | | | | Submitted as illumos issue #4284 Reviewed by: delphij
* Add a function, memstr, which can be used to convert a buffer ofmarkj2013-10-161-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | 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(). Thanks to Brendan Gregg for helpful comments on freebsd-dtrace. Tested by: Fabian Keil (earlier version) MFC after: 2 weeks
* Add fasttrap for PowerPC. This is the last piece of the dtrace/ppc puzzle.jhibbits2013-10-152-12/+215
| | | | | | | It's incomplete, it doesn't contain full instruction emulation, but it should be sufficient for most cases. MFC after: 1 month
* MFV r254750:delphij2013-09-211-11/+8
| | | | | | | | | | | | | Add support of Illumos dumps on zvol over RAID-Z. Note that this only adds the features. FreeBSD would still need more work to support dumping on zvols. Illumos ZFS issues: 2932 support crash dumps to raidz, etc. pools MFC after: 1 month Approved by: re (ZFS blanket)
* MFV r247844 (illumos-gate 13975:ef6409bc370f)delphij2013-09-102-0/+37
| | | | | | | | | | | Illumos ZFS issues: 3582 zfs_delay() should support a variable resolution 3584 DTrace sdt probes for ZFS txg states Provide a compatibility shim for Solaris's cv_timedwait_hires to help aid future porting. Approved by: re (ZFS blanket)
* MFV r254748:delphij2013-08-241-1/+5
| | | | | | | Fix memory leak in libzfs's iter_dependents_cb(). Illumos ZFS issues: 4061 libzfs: memory leak in iter_dependents_cb()
* MFV r254746:delphij2013-08-231-15/+42
| | | | | | | | | | To quote original Illumos ticket: libctf thinks that any ELF file containing more than 65536 sections is corrupt, because it doesn't understand the SHN_XINDEX magic. Illumos DTrace issues: 4005 libctf can't deal with extended sections
* Enhance the ZFS vdev layer to maintain both a logical and a physicalgibbs2013-08-214-35/+105
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | minimum allocation size for devices. Use this information to automatically increase ZFS's minimum allocation size for new top-level vdevs to a value that more closely matches the optimum device allocation size. Use GEOM's stripesize attribute, if set, as the physical sector size of the GEOM. Calculate the minimum blocksize of each metaslab class. Use the calculated value instead of SPA_MINBLOCKSIZE (512b) when determining the likelyhood of compression yeilding a reduction in physical space usage. Report devices with sub-optimal block size configuration in "zpool status". Also properly fail attempts to attach devices with a logical block size greater than 8kB, since this will cause corruption to ZFS's label area. Sponsored by: Spectra Logic Corporaion MFC after: 2 weeks Background ========== Many modern devices use physical allocation units that are much larger than the minimum logical allocation size accessible by external commands. Two prevalent examples of this are 512e disk drives (512b logical sector, 4K physical sector) and flash devices (512b logical sector, 4K or larger allocation block size, and 128k or larger erase block size). Operations that modify less than the physical sector size result in a costly read-modify-write or garbage collection sequence on these devices. Simply exporting the true physical sector of the device to ZFS would yield optimal performance, but has two serious drawbacks: 1) Existing pools created with devices that have different logical and physical block sizes, but were configured to use the logical block size (e.g. because the OS version used for pool construction reported the logical block size instead of the physical block size) will suddenly find that the vdev allocation size has increased. This can be easily tolerated for active members of the array, but ZFS would prevent replacement of a vdev with another identical device because it now appears that the smaller allocation size required by the pool is not supported by the new device. 2) The device's physical block size may be too large to be supported by ZFS. The optimal allocation size for the vdev may be quite large. For example, a RAID controller may export a vdev that requires read-modify-write cycles unless accessed using 64k aligned/sized requests. ZFS currently has an 8k minimum block size limit. Reporting both the logical and physical allocation sizes for vdevs solves these problems. A device may be used so long as the logical block size is compatible with the configuration. By comparing the logical and physical block sizes, new configurations can be optimized and administrators can be notified of any existing pools that are sub-optimal. sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/spa.h: Add the SPA_ASHIFT constant. ZFS currently has a hard upper limit of 13 (8k) for ashift and this constant is used to both document and enforce this limit. sys/cddl/contrib/opensolaris/uts/common/sys/fs/zfs.h: Add the VDEV_AUX_ASHIFT_TOO_BIG error code. Add fields for exporting the configured, logical, and physical ashift to the vdev_stat_t structure. Add VDEV_STAT_VALID() macro which can be used to verify the presence of required vdev_stat_t fields in nvlist data. sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev.c: Provide a SYSCTL_PROC handler for "max_auto_ashift". Since the limit is only referenced long after boot when a create operation occurs, there's no compelling need for it to be a boot time configurable tunable. This also allows the validation code for the max_auto_ashift value to be contained within the sysctl handler. Populate the new fields in the vdev_stat_t structure. Fail vdev opens if the vdev reports an ashift larger than SPA_MAXASHIFT. Propogate vdev_logical_ashift and vdev_physical_ashift between child and parent vdevs as is done for vdev_ashift. In vdev_open(), restore code that fails opens for devices where vdev_ashift grows. This can only happen now if the device's logical ashift grows, which means it really isn't safe to use the device. sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/vdev_impl.h: sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev.c: sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_file.c: sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c: sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_mirror.c: sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_missing.c: sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_raidz.c: sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_root.c: Update the vdev_open() API so that both logical (what was just ashift before) and physical ashift are reported. sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/vdev_impl.h: Add two new fields, vdev_physical_ashift and vdev_logical_ashift, to vdev_t. sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev.c: sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_config.c: sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c: Add vdev_ashift_optimize(). Call it anytime a new top-level vdev is allocated. cddl/contrib/opensolaris/cmd/zpool/zpool_main.c: Add text for the VDEV_AUX_ASHIFT_TOO_BIG error. For each sub-optimally configured leaf vdev, report configured and native block sizes. cddl/contrib/opensolaris/cmd/zpool/zpool_main.c: cddl/contrib/opensolaris/lib/libzfs/common/libzfs.h: cddl/contrib/opensolaris/lib/libzfs/common/libzfs_status.c: Introduce a new zpool status: ZPOOL_STATUS_NON_NATIVE_ASHIFT. This status is reported on healthy pools containing vdevs configured to use a block size smaller than their reported physical block size. cddl/contrib/opensolaris/lib/libzfs/common/libzfs_status.c: Update find_vdev_problem() and supporting functions to provide the full vdev_stat_t structure to problem checking routines, and to allow decent into replacing vdevs. Add a vdev_non_native_ashift() validator which is used on the full vdev tree to check for ZPOOL_STATUS_NON_NATIVE_ASHIFT. cddl/contrib/opensolaris/lib/libzpool/common/kernel.c: cddl/contrib/opensolaris/lib/libzpool/common/sys/zfs_context.h: Enhance sysctl userland stubs now that a SYSCTL_PROC handler is used in vdev.c. sys/cddl/contrib/opensolaris/uts/common/fs/zfs/metaslab.c: sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/metaslab_impl.h: When the group membership of a metaslab class changes (i.e. when a vdev is added or removed from a pool), walk the group list to determine the smallest block size currently available and record this in the metaslab class. sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/metaslab.h: sys/cddl/contrib/opensolaris/uts/common/fs/zfs/metaslab.c: Add the metaslab_class_get_minblocksize() accessor. sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zio_compress.h: sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio_compress.c: sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c: In zio_compress_data(), take the minimum blocksize as an input parameter instead of assuming SPA_MINBLOCKSIZE. sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c: In l2arc_compress_buf(), pass SPA_MINBLOCKSIZE as the minimum blocksize of the device. The l2arc code performs has it's own code for deciding if compression is worth while, so this effectively disables zio_compress_data() from second guessing the original decision. sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c: In zio_write_bp_init(), use the minimum blocksize of the normal metaslab class when compressing data.
* MFV r254421:delphij2013-08-213-12/+29
| | | | | Illumos ZFS issues: 3996 want a libzfs_core API to rollback to latest snapshot
OpenPOWER on IntegriCloud