aboutsummaryrefslogtreecommitdiff
path: root/sys/contrib/openzfs/module/os/freebsd/zfs/zfs_vfsops.c
Commit message (Collapse)AuthorAgeFilesLines
* zfs: merge openzfs/zfs@229b9f4edMartin Matuska2024-02-081-4/+0
| | | | | | | | | | Notable upstream pull request merges: #15769 082338875 Add 'zpool status -e' flag to see unhealthy vdevs #15804 a0d3fe72b libzdb: Initial breakout of libzdb #15847 229b9f4ed LUA: Backport CVE-2020-24370's patch Obtained from: OpenZFS OpenZFS commit: 229b9f4ed05e6d14fb4d73fa04a71e99b01bb534
* zfs: merge openzfs/zfs@41e55b476Martin Matuska2023-11-011-0/+32
| | | | | | | | | | | | | | | | | | | Notable upstream pull request merges: #15366 c3773de1 ZIL: Cleanup sync and commit handling #15409 dbe839a9 zvol: Cleanup set property #15409 60387fac zvol: Implement zvol threading as a Property #15409 9ccdb8be zvol: fix delayed update to block device ro entry #15448 05a7348a RAIDZ: Use cache blocking during parity math #15452 514d661c Tune zio buffer caches and their alignments #15456 799e09f7 Unify arc_prune_async() code #15465 763ca47f Fix block cloning between unencrypted and encrypted datasets To make the module version better comparable, the module version number now includes the commit count since last tag. Obtained from: OpenZFS OpenZFS commit: 41e55b476bcfc90f1ad81c02c5375367fdace9e9
* zfs: enable block cloning by defaultMartin Matuska2023-10-101-1/+1
| | | | | | | | Discussed with: markj Reviewed by: mav Tested by: mm (FreeBSD test suite + OpenZFS test suite) MFC after: 2 months Differential Revision: https://reviews.freebsd.org/D41991
* zfs: retire z_nr_znodesMateusz Guzik2023-09-161-5/+3
| | | | | | It is not needed and is going away soon(tm), facilitating other changes. See https://github.com/openzfs/zfs/pull/15274
* zfs: merge openzfs/zfs@feff9dfedMartin Matuska2023-06-101-86/+0
| | | | | | | | | | | | | | | | | | | | | | Notable upstream pull request merges: #14833 Update compatibility.d files #14841 ZIL: Reduce scope of per-dataset zl_issuer_lock #14863 zil: Add some more statistics #14866 btree: Implement faster binary search algorithm #14894 Fix inconsistent definition of zfs_scrub_error_blocks_per_txg #14892 Fix concurrent resilvers initiated at same time #14903 Fix NULL pointer dereference when doing concurrent 'send' operations #14910 ZIL: Allow to replay blocks of any size #14939 Fix the L2ARC write size calculating logic #14934 Introduce zfs_refcount_(add|remove)_few() #14946 Improve l2arc reporting in arc_summary #14953 Finally drop long disabled vdev cache #14954 Fix the L2ARC write size calculating logic (2) #14955 Use list_remove_head() where possible #14959 ZIL: Fix race introduced by f63811f0721 Obtained from: OpenZFS OpenZFS commit: feff9dfed3df1bbae5dd74959a6ad87d11f27ffb
* zfs: Add vfs.zfs.bclone_enabled sysctl.Pawel Jakub Dawidek2023-04-171-0/+4
| | | | | | | | | | Keep block cloning disabled by default for now, but allow to enable and use it after setting vfs.zfs.bclone_enabled to 1, so people can easily try it. Approved by: oshogbo Reviewed by: mm, oshogbo Differential Revision: https://reviews.freebsd.org/D39613
* zfs: merge openzfs/zfs@431083f75Martin Matuska2023-04-031-1/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Notable upstream pull request merges: #12194 Fix short-lived txg caused by autotrim #13368 ZFS_IOC_COUNT_FILLED does unnecessary txg_wait_synced() #13392 Implementation of block cloning for ZFS #13741 SHA2 reworking and API for iterating over multiple implementations #14282 Sync thread should avoid holding the spa config write lock when possible #14283 txg_sync should handle write errors in ZIL #14359 More adaptive ARC eviction #14469 Fix NULL pointer dereference in zio_ready() #14479 zfs redact fails when dnodesize=auto #14496 improve error message of zfs redact #14500 Skip memory allocation when compressing holes #14501 FreeBSD: don't verify recycled vnode for zfs control directory #14502 partially revert PR 14304 (eee9362a7) #14509 Fix per-jail zfs.mount_snapshot setting #14514 Fix data race between zil_commit() and zil_suspend() #14516 System-wide speculative prefetch limit #14517 Use rw_tryupgrade() in dmu_bonus_hold_by_dnode() #14519 Do not hold spa_config in ZIL while blocked on IO #14523 Move dmu_buf_rele() after dsl_dataset_sync_done() #14524 Ignore too large stack in case of dsl_deadlist_merge #14526 Use .section .rodata instead of .rodata on FreeBSD #14528 ICP: AES-GCM: Refactor gcm_clear_ctx() #14529 ICP: AES-GCM: Unify gcm_init_ctx() and gmac_init_ctx() #14532 Handle unexpected errors in zil_lwb_commit() without ASSERT() #14544 icp: Prevent compilers from optimizing away memset() in gcm_clear_ctx() #14546 Revert zfeature_active() to static #14556 Remove bad kmem_free() oversight from previous zfsdev_state_list patch #14563 Optimize the is_l2cacheable functions #14565 FreeBSD: zfs_znode_alloc: lock the vnode earlier #14566 FreeBSD: fix false assert in cache_vop_rmdir when replaying ZIL #14567 spl: Add cmn_err_once() to log a message only on the first call #14568 Fix incremental receive silently failing for recursive sends #14569 Restore ASMABI and other Unify work #14576 Fix detection of IBM Power8 machines (ISA 2.07) #14577 Better handling for future crypto parameters #14600 zcommon: Refactor FPU state handling in fletcher4 #14603 Fix prefetching of indirect blocks while destroying #14633 Fixes in persistent error log #14639 FreeBSD: Remove extra arc_reduce_target_size() call #14641 Additional limits on hole reporting #14649 Drop lying to the compiler in the fletcher4 code #14652 panic loop when removing slog device #14653 Update vdev state for spare vdev #14655 Fix cloning into already dirty dbufs #14678 Revert "Do not hold spa_config in ZIL while blocked on IO" Obtained from: OpenZFS OpenZFS commit: 431083f75bdd3efaee992bdd672625ec7240d252
* Fix per-jail zfs.mount_snapshot settingAllan Jude2023-02-211-2/+14
| | | | | | | | | | | | When jail.conf set the nopersist flag during startup, it was incorrectly destroying the per-jail ZFS settings. PR: 260160 Reported by: imp (previous version), mm (upstream), freqlabs (upstream) MFC after: immediately Sponsored by: Modirum MDPay Sponsored by: Klara, Inc. Differential Revision: https://reviews.freebsd.org/D38662
* zfs: merge openzfs/zfs@57cfae4a2 (master)Martin Matuska2023-02-161-1/+2
| | | | | | | | | | | | | | | | | | Notable upstream pull request merges: #13816 Fix a race condition in dsl_dataset_sync() when activating features #14402 Prefetch on deadlists merge #14410 Improve resilver ETAs #14428 Resilver performance tuning #14439 Resolve WS-2021-0184 vulnerability in zstd #14440 EIO caused by encryption + recursive gang #14448 Fix console progress reporting for recursive send #14454 Improve arc_read() error reporting #14460 Restore FreeBSD to use .rodata #14474 Reduce need for contiguous memory for ioctls Obtained from: OpenZFS OpenZFS commit: 57cfae4a2f04aaff10c45b3f7975e0fe3ef3e8b8
* zfs: merge openzfs/zfs@59493b63c (master)Martin Matuska2022-12-071-14/+3
| | | | | | | | | | | | | | | | | | | | | | | | | Notable upstream pull request merges: #13782 Fix setting the large_block feature after receiving a snapshot #14157 FreeBSD: stop using buffer cache-only routines on sync #14172 zed: post a udev change event from spa_vdev_attach() #14181 zed: unclean disk attachment faults the vdev #14190 Bump checksum error counter before reporting to ZED #14196 Remove atomics from zh_refcount #14197 Don't leak packed recieved proprties #14198 Switch dnode stats to wmsums #14199 Remove few pointer dereferences in dbuf_read() #14200 Micro-optimize zrl_remove() #14204 Lua: Fix bad bitshift in lua_strx2number() #14212 Zstd fixes #14218 Avoid a null pointer dereference in zfs_mount() on FreeBSD #14235 nopwrites on dmu_sync-ed blocks can result in a panic #14236 zio can deadlock during device removal #14247 Micro-optimize fletcher4 calculations #14261 FreeBSD: zfs_register_callbacks() must implement error check correctly Obtained from: OpenZFS OpenZFS commit: 59493b63c18ea223857066218d6a58b67eb88159
* zfs: workaround panic on rootfs mountMartin Matuska2022-11-171-1/+9
| | | | | | The import of OpenZFS PR 13758 causes a panic in zfsctl_is_node() if ZFS is mounting as root filesystem. This implements a workaround until the issue is resolved by authors.
* zfs: merge openzfs/zfs@2163cde45Martin Matuska2022-11-161-4/+274
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Notable upstream pull request merges: #13680 Add options to zfs redundant_metadata property #13758 Allow mounting snapshots in .zfs/snapshot as a regular user #13838 quota: disable quota check for ZVOL #13839 quota: extend quota for dataset #13973 Fix memory leaks in dmu_send()/dmu_send_obj() #13977 Avoid unnecessary metaslab_check_free calling #13978 PAM: Fix unchecked return value from zfs_key_config_load() #13979 Handle possible null pointers from malloc/strdup/strndup() #13997 zstream: allow decompress to fix metadata for uncompressed records #13998 zvol_wait logic may terminate prematurely #14001 FreeBSD: Fix a pair of bugs in zfs_fhtovp() #14003 Stop ganging due to past vdev write errors #14039 Optimize microzaps #14050 Fix draid2+2s metadata error on simultaneous 2 drive failures #14062 zed: Avoid core dump if wholedisk property does not exist #14077 Propagate extent_bytes change to autotrim thread #14079 FreeBSD: vn_flush_cached_data: observe vnode locking contract #14093 Fix ARC target collapse when zfs_arc_meta_limit_percent=100 #14106 Add ability to recompress send streams with new compression algorithm #14119 Deny receiving into encrypted datasets if the keys are not loaded #14120 Fix arc_p aggressive increase #14129 zed: Prevent special vdev to be replaced by hot spare #14133 Expose zfs_vdev_open_timeout_ms as a tunable #14135 FreeBSD: Fix out of bounds read in zfs_ioctl_ozfs_to_legacy() #14152 Adds the `-p` option to `zfs holds` #14161 Handle and detect #13709's unlock regression Obtained from: OpenZFS OpenZFS commit: 2163cde450d0898b5f7bac16afb4e238485411ff
* zfs: Fix a pair of bugs in zfs_fhtovp()Mark Johnston2022-10-241-1/+2
| | | | | | | | | | | | | | This cherry-picks upstream ed566bf1cd0bdbf85e8c63c1c119e3d2ef5db1f6 - Add a zfs_exit() call in an error path, otherwise a lock is leaked. - Remove the fid_gen > 1 check. That appears to be Linux-specific: zfsctl_snapdir_fid() sets fid_gen to 0 or 1 depending on whether the snapshot directory is mounted. On FreeBSD it fails, making snapshot dirs inaccessible via NFS. PR: 266236 MFC after: 3 days
* zfs: merge openzfs/zfs@d62bafee9Martin Matuska2022-10-041-2/+1
| | | | | | | | | | | | | | | Notable upstream pull request merges: #13857 Enforce "-F" flag on resuming recv of full/newfs on existing dataset #13928 Revert "Reduce dbuf_find() lock contention" #13928 Dynamically size dbuf hash mutex array #13930 zpool: Don't print "repairing" on force faulted drives #13938 Bring per_txg_dirty_frees_percent back to 30 #13939 Fix panic in dsl_process_sub_livelist for EINTR #13954 Fix bad free in skein code #13967 Fix potential NULL pointer dereference in dsl_dataset_promote_check() Obtained from: OpenZFS OpenZFS commit: d62bafee9fc38f8b9653c531e1861e83dcba4618
* zfs: merge openzfs/zfs@c629f0bf6Martin Matuska2022-09-211-47/+28
| | | | | | | | | | | | | | | | | | | Notable upstream pull request merges: #13725 Fix BLAKE3 tuneable and module loading on Linux and FreeBSD #13756 FreeBSD: Organize sysctls #13773 FreeBSD: add kqfilter support for zvol cdev #13781 Importing from cachefile can trip assertion #13794 Apply arc_shrink_shift to ARC above arc_c_min #13798 Improve too large physical ashift handling #13799 Revert "Avoid panic with recordsize > 128k, raw sending and no large_blocks" #13802 Add zfs.sync.snapshot_rename #13831 zfs_enter rework #13855 zfs recv hangs if max recordsize is less than received recordsize Obtained from: OpenZFS OpenZFS commit: c629f0bf62e351355716f9870d6c2e377584b016
* zfs: merge openzfs/zfs@b3d0568cfMartin Matuska2022-08-131-4/+10
| | | | | | | | | | | | | | Notable upstream pull request merges: #9372 Implement a new type of zfs receive: corrective receive (-c) #13635 Add snapshots_changed as property #13636 Add support for per dataset zil stats and use wmsum counters #13643 Fix scrub resume from newly created hole #13670 Fix memory allocation for the checksum benchmark #13695 Skip checksum benchmarks on systems with slow cpu #13711 zpool: fix redundancy check after vdev removal Obtained from: OpenZFS OpenZFS commit: b3d0568cfd65458c92f7ab3d7bb709087992628e
* zfs: merge openzfs/zfs@a86e08941 (master) into mainMartin Matuska2022-03-081-11/+8
| | | | | | | | | | | | | | | | | | | | Notable upstream pull request merges: #9078: log xattr=sa create/remove/update to ZIL #11919: Cross-platform xattr user namespace compatibility #13014: Report dnodes with faulty bonuslen #13016: FreeBSD: Fix zvol_cdev_open locking #13019: spl: Don't check FreeBSD rwlocks for double initialization #13027: Fix clearing set-uid and set-gid bits on a file when replying a write #13031: Add enumerated vdev names to 'zpool iostat -v' and 'zpool list -v' #13074: Enable encrypted raw sending to pools with greater ashift #13076: Receive checks should allow unencrypted child datasets #13098: Avoid dirtying the final TXGs when exporting a pool #13172: Fix ENOSPC when unlinking multiple files from full pool Obtained from: OpenZFS OpenZFS commit: a86e089415679cf1b98eb424a159bb36aa2c19e3
* zfs: merge openzfs/zfs@17b2ae0b2 (master) into mainMartin Matuska2022-01-221-1/+7
| | | | | | | | | | | | | | | | | | | Notable upstream pull request merges: #12766 Fix error propagation from lzc_send_redacted #12805 Updated the lz4 decompressor #12851 FreeBSD: Provide correct file generation number #12857 Verify dRAID empty sectors #12874 FreeBSD: Update argument types for VOP_READDIR #12896 Reduce number of arc_prune threads #12934 FreeBSD: Fix zvol_*_open() locking #12947 lz4: Cherrypick fix for CVE-2021-3520 #12961 FreeBSD: Fix leaked strings in libspl mnttab #12964 Fix handling of errors from dmu_write_uio_dbuf() on FreeBSD #12981 Introduce a flag to skip comparing the local mac when raw sending #12985 Avoid memory allocations in the ARC eviction thread Obtained from: OpenZFS OpenZFS commit: 17b2ae0b24d487fdda2ef1098ec26fa7f79a61f6
* zfs: merge openzfs/zfs@5e2c8338b (master) into mainMartin Matuska2021-06-261-3/+6
| | | | | | | | | | | | | | Notable upstream pull request merges: #12183 Optimize small random numbers generation #12227 Revert Consolidate arc_buf allocation checks #12266 Fix flag copying in resume case #12273 zfs_metaslab_mem_limit should be 25 instead of 75 #12276 Update cache file when setting compatibility property #12280 Help compiller optimize out abd_verify() #12282 FreeBSD: fix compilation of FreeBSD world after 29274c9f6 Obtained from: OpenZFS OpenZFS commit: 5e2c8338bf17d31b44eb1dbbb3c9b6a0f64e96ee
* zfs: merge openzfs/zfs@75b4cbf62 (master) into mainMartin Matuska2021-06-081-25/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Notable upstream pull request merges: #11710 Allow zfs to send replication streams with missing snapshots #11751 Avoid taking global lock to destroy zfsdev state #11786 Ratelimit deadman zevents as with delay zevents #11803 ZFS traverse_visitbp optimization to limit prefetch #11813 Allow pool names that look like Solaris disk names #11822 Atomically check and set dropped zevent count #11822 Don't scale zfs_zevent_len_max by CPU count #11833 Refactor zfsdev state init/destroy to share common code #11837 zfs get -p only outputs 3 columns if "clones" property is empty #11843 libzutil: zfs_isnumber(): return false if input empty #11849 Use dsl_scan_setup_check() to setup a scrub #11861 Improvements to the 'compatibility' property #11862 cmd/zfs receive: allow dry-run (-n) to check property args #11864 receive: don't fail inheriting (-x) properties on wrong dataset type #11877 Combine zio caches if possible #11881 FreeBSD: use vnlru_free_vfsops if available #11883 FreeBSD: add support for lockless symlink lookup #11884 FreeBSD: add missing seqc write begin/end around zfs_acl_chown_setattr #11896 Fix crash in zio_done error reporting #11905 zfs-send(8): Restore sorting of flags #11926 FreeBSD: damage control racing .. lookups in face of mkdir/rmdir #11930 vdev_mirror: don't scrub/resilver devices that can't be read #11938 Fix AVX512BW Fletcher code on AVX512-but-not-BW machines #11955 zfs get: don't lookup mount options when using "-s local" #11956 libzfs: add keylocation=https://, backed by fetch(3) or libcurl #11959 vdev_id: variable not getting expanded under map_slot() #11966 Scale worker threads and taskqs with number of CPUs #11994 Clean up use of zfs_log_create in zfs_dir #11997 FreeBSD: Don't force xattr mount option #11997 FreeBSD: Implement xattr=sa #11997 FreeBSD: Use SET_ERROR to trace xattr name errors #11998 Simplify/fix dnode_move() for dn_zfetch #12003 FreeBSD: Initialize/destroy zp->z_lock #12010 Fix dRAID self-healing short columns #12033 Revert "Fix raw sends on encrypted datasets when copying back snapshots" #12040 Reinstate the old zpool read label logic as a fallback #12046 Improve scrub maxinflight_bytes math #12049 FreeBSD: avoid memory allocation in arc_prune_async #12052 FreeBSD: incorporate changes to the VFS_QUOTACTL(9) KPI #12061 Fix dRAID sequential resilver silent damage handling #12072 Let zfs diff be more permissive #12077 FreeBSD: Retry OCF ENOMEM errors. #12088 Propagate vdev state due to invalid label corruption #12091 libzfs: On FreeBSD, use MNT_NOWAIT with getfsstat #12097 FreeBSD: Update dataset_kstats for zvols in dev mode #12104 FreeBSD boot code reminder after zpool upgrade #12114 Introduce write-mostly sums Obtained from: OpenZFS OpenZFS commit: 75b4cbf62590c23fac3667537961a2a75fdc2cc3
* VFS_QUOTACTL(9): allow implementation to indicate busy state changesJason A. Harmening2021-05-301-0/+15
| | | | | | | | | | | | | | | Instead of requiring all implementations of vfs_quotactl to unbusy the mount for Q_QUOTAON and Q_QUOTAOFF, add an "mp_busy" in/out param to VFS_QUOTACTL(9). The implementation may then indicate to the caller whether it needed to unbusy the mount. Also, add stbool.h to libprocstat modules which #define _KERNEL before including sys/mount.h. Otherwise they'll pull in sys/types.h before defining _KERNEL and therefore won't have the bool definition they need for mp_busy. Reviewed By: kib, markj Differential Revision: https://reviews.freebsd.org/D30556
* Revert commits 6d3e78ad6c11 and 54256e7954d7Jason A. Harmening2021-05-301-15/+0
| | | | | | | Parts of libprocstat like to pretend they're kernel components for the sake of including mount.h, and including sys/types.h in the _KERNEL case doesn't fix the build for some reason. Revert both the VFS_QUOTACTL() change and the follow-up "fix" for now.
* VFS_QUOTACTL(9): allow implementation to indicate busy state changesJason A. Harmening2021-05-291-0/+15
| | | | | | | | | | Instead of requiring all implementations of vfs_quotactl to unbusy the mount for Q_QUOTAON and Q_QUOTAOFF, add an "mp_busy" in/out param to VFS_QUOTACTL(9). The implementation may then indicate to the caller whether it needed to unbusy the mount. Reviewed By: kib, markj Differential Revision: https://reviews.freebsd.org/D30218
* zfs: bring back possibility to rewind the checkpoint fromMariusz Zaborski2021-03-131-1/+16
| | | | | | | | | | | | | | | | | | | | Add parsing of the rewind options. When I was upstreaming the change [1], I omitted the part where we detect that the pool should be rewind. When the FreeBSD repo has synced with the OpenZFS, this part of the code was removed. [1] FreeBSD repo: 277f38abffc6a8160b5044128b5b2c620fbb970c [2] OpenZFS repo: f2c027bd6a003ec5793f8716e6189c389c60f47a Originally reviewed by: tsoome, allanjude Originally reviewed by: kevans (ok from high-level overview) Signed-off-by: Mariusz Zaborski <oshogbo@vexillium.org> PR: 254152 Reported by: Zhenlei Huang <zlei.huang at gmail.com> Obtained from: https://github.com/openzfs/zfs/pull/11730
* OpenZFS merge main-gf11b09Matt Macy2021-01-081-1/+2
| | | | | | | | - add dRAID support - fix duplicate close handling - fix memory leak in prefetch - fix problem with SIMD benchmarking on FreeBSD boot ...
* zfs: macroify teardown handlingMateusz Guzik2020-11-041-17/+13
| | | | Notes: svn path=/head/; revision=367345
* zfs: rename teardown inactive macros to mimick rrm conventionMateusz Guzik2020-11-041-9/+9
| | | | Notes: svn path=/head/; revision=367344
* zfs: remove unused support for zfs_znode_moveMateusz Guzik2020-10-261-11/+0
| | | | Notes: svn path=/head/; revision=367054
* Update OpenZFS to 2.0.0-rc3-gfc5966Matt Macy2020-10-171-0/+22
| | | | | | | | | | | - fix panic due to tqid overflow - Improve libzfs_error_init messages - Expose zfetch_max_idistance tunable - Make dbufstat work on FreeBSD - Fix EIO after resuming receive of new dataset over an existing one Notes: svn path=/head/; revision=366780
* OpenZFS: MFV 2.0-rc3-gfc5966Matt Macy2020-10-011-0/+4
| | | | | | | | | | | | | | | - Annotate FreeBSD sysctls with CTLFLAG_MPSAFE - Reduce stack usage of Lua - Don't save user FPU context in kernel threads - Add support for procfs_list - Code cleanup in zio_crypt - Add DB_RF_NOPREFETCH to dbuf_read()s in dnode.c - Drop references when skipping dmu_send due to EXDEV - Eliminate gratuitous bzeroing in dbuf_stats_hash_table_data - Fix legacy compat for platform IOCs Notes: svn path=/head/; revision=366350
* cache: drop the force flag from purgevfsMateusz Guzik2020-09-231-1/+1
| | | | | | | | | The optional scan is wasteful, thus it is removed altogether from unmount. Callers which always want it anyway remain unaffected. Notes: svn path=/head/; revision=366071
* MFV 2.0-rc2Matt Macy2020-09-181-9/+9
| | | | | | | | - Fixes divide by zero for unusual hz - remove cryptodev dependency Notes: svn path=/head/; revision=365894
* ZFS: MFV 2.0-rc1-gfd20a8Matt Macy2020-09-041-193/+0
| | | | | | | | | | - fixes jail delegation - fixes raw kstat unsupported complaints - exposes dbgmsg, dbuf, and checksum benchmark stats - restore rename -u support Notes: svn path=/head/; revision=365347
* Initial import from vendor-sys branch of openzfsMatt Macy2020-08-241-0/+2482
Notes: svn path=/head/; revision=364740