git: dbd5678dca91 - main - zfs: merge openzfs/zfs@2163cde45
Date: Wed, 16 Nov 2022 20:49:14 UTC
The branch main has been updated by mm: URL: https://cgit.FreeBSD.org/src/commit/?id=dbd5678dca91abcefe8d046aa2f9b66497a95ffb commit dbd5678dca91abcefe8d046aa2f9b66497a95ffb Merge: 61b146ba43cd 2163cde450d0 Author: Martin Matuska <mm@FreeBSD.org> AuthorDate: 2022-11-16 20:25:24 +0000 Commit: Martin Matuska <mm@FreeBSD.org> CommitDate: 2022-11-16 20:27:42 +0000 zfs: merge openzfs/zfs@2163cde45 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 cddl/usr.bin/zstream/Makefile | 1 + sys/conf/kern.pre.mk | 3 +- .../openzfs/.github/workflows/checkstyle.yaml | 4 +- sys/contrib/openzfs/.github/workflows/codeql.yml | 36 + .../.github/workflows/zfs-tests-functional.yml | 4 +- .../openzfs/.github/workflows/zfs-tests-sanity.yml | 4 +- sys/contrib/openzfs/.github/workflows/zloop.yml | 6 +- sys/contrib/openzfs/AUTHORS | 2 + sys/contrib/openzfs/META | 2 +- sys/contrib/openzfs/Makefile.am | 2 +- sys/contrib/openzfs/cmd/arc_summary | 8 +- sys/contrib/openzfs/cmd/raidz_test/raidz_test.c | 4 +- sys/contrib/openzfs/cmd/zdb/zdb.c | 23 +- sys/contrib/openzfs/cmd/zdb/zdb_il.c | 11 + sys/contrib/openzfs/cmd/zed/agents/fmd_api.c | 1 + sys/contrib/openzfs/cmd/zed/agents/fmd_serd.c | 19 + sys/contrib/openzfs/cmd/zed/agents/zfs_mod.c | 22 +- sys/contrib/openzfs/cmd/zed/zed_event.c | 6 +- sys/contrib/openzfs/cmd/zed/zed_exec.c | 4 + sys/contrib/openzfs/cmd/zfs/zfs_main.c | 85 ++- sys/contrib/openzfs/cmd/zhack.c | 8 +- sys/contrib/openzfs/cmd/zpool/zpool_main.c | 9 +- sys/contrib/openzfs/cmd/zstream/Makefile.am | 1 + sys/contrib/openzfs/cmd/zstream/zstream.c | 4 + sys/contrib/openzfs/cmd/zstream/zstream.h | 1 + .../openzfs/cmd/zstream/zstream_decompress.c | 40 +- sys/contrib/openzfs/cmd/zstream/zstream_dump.c | 8 +- .../openzfs/cmd/zstream/zstream_recompress.c | 356 +++++++++ sys/contrib/openzfs/cmd/ztest.c | 42 +- sys/contrib/openzfs/cmd/zvol_wait | 7 + sys/contrib/openzfs/config/kernel-dentry-alias.m4 | 30 + sys/contrib/openzfs/config/kernel-iattr-vfsid.m4 | 24 + sys/contrib/openzfs/config/kernel-idmap_mnt_api.m4 | 25 + sys/contrib/openzfs/config/kernel-mod-param.m4 | 33 - sys/contrib/openzfs/config/kernel-rename.m4 | 71 +- sys/contrib/openzfs/config/kernel.m4 | 23 +- sys/contrib/openzfs/contrib/coverity/model.c | 389 ++++++++-- sys/contrib/openzfs/contrib/debian/changelog | 7 + sys/contrib/openzfs/contrib/debian/clean | 11 + sys/contrib/openzfs/contrib/debian/control | 328 +++++++++ .../openzfs/contrib/debian/control.modules.in | 33 + sys/contrib/openzfs/contrib/debian/copyright | 19 + sys/contrib/openzfs/contrib/debian/not-installed | 13 + .../openzfs/contrib/debian/openzfs-libnvpair3.docs | 2 + .../contrib/debian/openzfs-libnvpair3.install.in | 1 + .../contrib/debian/openzfs-libpam-zfs.install | 2 + .../contrib/debian/openzfs-libpam-zfs.postinst | 6 + .../contrib/debian/openzfs-libpam-zfs.prerm | 8 + .../openzfs/contrib/debian/openzfs-libuutil3.docs | 2 + .../contrib/debian/openzfs-libuutil3.install.in | 1 + .../openzfs/contrib/debian/openzfs-libzfs-dev.docs | 2 + .../contrib/debian/openzfs-libzfs-dev.install.in | 3 + .../openzfs/contrib/debian/openzfs-libzfs4.docs | 2 + .../contrib/debian/openzfs-libzfs4.install.in | 2 + .../contrib/debian/openzfs-libzfsbootenv1.docs | 2 + .../debian/openzfs-libzfsbootenv1.install.in | 1 + .../openzfs/contrib/debian/openzfs-libzpool5.docs | 2 + .../contrib/debian/openzfs-libzpool5.install.in | 1 + .../contrib/debian/openzfs-python3-pyzfs.install | 1 + .../openzfs/contrib/debian/openzfs-zfs-dkms.config | 31 + .../openzfs/contrib/debian/openzfs-zfs-dkms.dkms | 1 + .../openzfs/contrib/debian/openzfs-zfs-dkms.docs | 2 + .../contrib/debian/openzfs-zfs-dkms.install | 1 + .../contrib/debian/openzfs-zfs-dkms.postinst | 51 ++ .../openzfs/contrib/debian/openzfs-zfs-dkms.prerm | 8 + .../contrib/debian/openzfs-zfs-dkms.templates | 40 + .../contrib/debian/openzfs-zfs-dkms.triggers | 1 + .../contrib/debian/openzfs-zfs-dracut.install | 2 + .../contrib/debian/openzfs-zfs-initramfs.install | 2 + .../openzfs-zfs-modules-_KVERS_-di.install.in | 2 + .../debian/openzfs-zfs-modules-_KVERS_.install.in | 2 + .../debian/openzfs-zfs-modules-_KVERS_.postinst.in | 16 + .../debian/openzfs-zfs-modules-_KVERS_.postrm.in | 7 + .../contrib/debian/openzfs-zfs-test.install | 15 + .../openzfs/contrib/debian/openzfs-zfs-zed.install | 5 + .../contrib/debian/openzfs-zfs-zed.postinst | 20 + .../openzfs/contrib/debian/openzfs-zfs-zed.postrm | 17 + .../openzfs/contrib/debian/openzfs-zfs-zed.prerm | 16 + .../contrib/debian/openzfs-zfs-zed.zfs-zed.init | 1 + .../openzfs/contrib/debian/openzfs-zfsutils.docs | 2 + .../contrib/debian/openzfs-zfsutils.examples | 5 + .../contrib/debian/openzfs-zfsutils.install | 135 ++++ .../contrib/debian/openzfs-zfsutils.postinst | 28 + .../debian/openzfs-zfsutils.zfs-import.init | 1 + .../debian/openzfs-zfsutils.zfs-load-key.init | 1 + .../contrib/debian/openzfs-zfsutils.zfs-mount.init | 1 + .../contrib/debian/openzfs-zfsutils.zfs-share.init | 1 + sys/contrib/openzfs/contrib/debian/rules | 223 ++++++ sys/contrib/openzfs/contrib/debian/source/format | 1 + .../usr/share/initramfs-tools/conf.d/zfs | 8 + .../usr/share/initramfs-tools/hooks/zdev | 67 ++ .../contrib/dracut/90zfs/module-setup.sh.in | 28 + .../openzfs/contrib/pam_zfs_key/pam_zfs_key.c | 5 +- sys/contrib/openzfs/etc/Makefile.am | 1 + sys/contrib/openzfs/include/libuutil_impl.h | 31 +- sys/contrib/openzfs/include/libzfs.h | 10 +- sys/contrib/openzfs/include/libzutil.h | 27 +- .../include/os/freebsd/spl/acl/acl_common.h | 2 +- .../openzfs/include/os/freebsd/spl/sys/debug.h | 5 +- .../openzfs/include/os/freebsd/spl/sys/dkio.h | 460 ------------ .../openzfs/include/os/freebsd/spl/sys/isa_defs.h | 415 ----------- .../openzfs/include/os/freebsd/spl/sys/kmem.h | 3 + .../openzfs/include/os/freebsd/spl/sys/mod_os.h | 18 +- .../openzfs/include/os/freebsd/spl/sys/sysmacros.h | 40 - .../openzfs/include/os/freebsd/spl/sys/types.h | 2 + .../openzfs/include/os/freebsd/spl/sys/vnode.h | 12 +- .../include/os/freebsd/zfs/sys/zfs_ioctl_compat.h | 13 + .../include/os/freebsd/zfs/sys/zfs_vnops_os.h | 13 +- .../include/os/linux/kernel/linux/blkdev_compat.h | 10 +- .../include/os/linux/kernel/linux/dcache_compat.h | 21 + .../include/os/linux/kernel/linux/mod_compat.h | 69 +- .../include/os/linux/kernel/linux/vfs_compat.h | 13 + .../include/os/linux/kernel/linux/xattr_compat.h | 10 +- .../openzfs/include/os/linux/spl/sys/cred.h | 80 +- .../openzfs/include/os/linux/spl/sys/debug.h | 37 +- .../openzfs/include/os/linux/spl/sys/isa_defs.h | 38 +- .../openzfs/include/os/linux/spl/sys/kmem.h | 2 + .../openzfs/include/os/linux/spl/sys/sysmacros.h | 10 + .../openzfs/include/os/linux/spl/sys/types.h | 3 + .../openzfs/include/os/linux/zfs/sys/policy.h | 5 +- .../openzfs/include/os/linux/zfs/sys/trace_acl.h | 9 +- .../include/os/linux/zfs/sys/trace_common.h | 6 +- .../openzfs/include/os/linux/zfs/sys/zfs_dir.h | 1 + .../include/os/linux/zfs/sys/zfs_vnops_os.h | 16 +- sys/contrib/openzfs/include/os/linux/zfs/sys/zpl.h | 9 +- sys/contrib/openzfs/include/sys/arc_impl.h | 6 +- sys/contrib/openzfs/include/sys/btree.h | 15 +- sys/contrib/openzfs/include/sys/dbuf.h | 4 +- sys/contrib/openzfs/include/sys/dmu.h | 7 + sys/contrib/openzfs/include/sys/dmu_zfetch.h | 2 +- sys/contrib/openzfs/include/sys/dsl_deadlist.h | 2 +- sys/contrib/openzfs/include/sys/dsl_pool.h | 8 +- sys/contrib/openzfs/include/sys/fs/zfs.h | 6 +- sys/contrib/openzfs/include/sys/mmp.h | 2 +- sys/contrib/openzfs/include/sys/spa.h | 8 +- sys/contrib/openzfs/include/sys/vdev_impl.h | 5 +- sys/contrib/openzfs/include/sys/zap_impl.h | 11 +- sys/contrib/openzfs/include/sys/zcp.h | 4 +- sys/contrib/openzfs/include/sys/zfs_acl.h | 11 +- sys/contrib/openzfs/include/sys/zfs_context.h | 5 + sys/contrib/openzfs/include/sys/zfs_ioctl_impl.h | 2 +- sys/contrib/openzfs/include/sys/zfs_onexit.h | 2 +- sys/contrib/openzfs/include/sys/zfs_znode.h | 7 +- sys/contrib/openzfs/include/sys/zil.h | 21 +- sys/contrib/openzfs/include/sys/zio.h | 102 +-- sys/contrib/openzfs/lib/libefi/rdwr_efi.c | 6 +- sys/contrib/openzfs/lib/libshare/os/linux/smb.c | 17 +- .../openzfs/lib/libspl/include/sys/isa_defs.h | 6 +- sys/contrib/openzfs/lib/libspl/include/sys/types.h | 25 - sys/contrib/openzfs/lib/libspl/include/umem.h | 20 +- .../openzfs/lib/libspl/os/linux/gethostid.c | 6 +- sys/contrib/openzfs/lib/libspl/os/linux/zone.c | 2 +- sys/contrib/openzfs/lib/libuutil/uu_avl.c | 30 +- sys/contrib/openzfs/lib/libuutil/uu_list.c | 30 +- sys/contrib/openzfs/lib/libzfs/libzfs.abi | 36 +- sys/contrib/openzfs/lib/libzfs/libzfs_dataset.c | 12 +- sys/contrib/openzfs/lib/libzfs/libzfs_diff.c | 2 +- sys/contrib/openzfs/lib/libzfs/libzfs_pool.c | 9 +- sys/contrib/openzfs/lib/libzfs/libzfs_sendrecv.c | 9 +- sys/contrib/openzfs/lib/libzfs/libzfs_util.c | 2 +- .../openzfs/lib/libzfs/os/freebsd/libzfs_compat.c | 2 + sys/contrib/openzfs/lib/libzfs_core/libzfs_core.c | 2 +- .../lib/libzfs_core/os/freebsd/libzfs_core_ioctl.c | 13 +- sys/contrib/openzfs/lib/libzpool/kernel.c | 31 +- sys/contrib/openzfs/lib/libzpool/util.c | 7 +- .../lib/libzutil/os/linux/zutil_device_path_os.c | 8 +- sys/contrib/openzfs/lib/libzutil/zutil_import.c | 118 +-- sys/contrib/openzfs/lib/libzutil/zutil_import.h | 15 - sys/contrib/openzfs/man/man4/zfs.4 | 145 ++-- sys/contrib/openzfs/man/man7/vdevprops.7 | 5 +- sys/contrib/openzfs/man/man7/zfsprops.7 | 18 +- sys/contrib/openzfs/man/man8/zfs-hold.8 | 6 +- sys/contrib/openzfs/man/man8/zstream.8 | 33 +- sys/contrib/openzfs/module/Kbuild.in | 6 +- .../openzfs/module/icp/algs/blake3/blake3.c | 4 +- sys/contrib/openzfs/module/icp/algs/modes/ccm.c | 1 - sys/contrib/openzfs/module/icp/algs/modes/ctr.c | 1 - sys/contrib/openzfs/module/icp/algs/modes/gcm.c | 1 - sys/contrib/openzfs/module/icp/algs/modes/modes.c | 4 +- .../openzfs/module/icp/asm-x86_64/aes/aes_amd64.S | 2 + .../module/icp/asm-x86_64/blake3/blake3_avx2.S | 12 +- .../module/icp/asm-x86_64/blake3/blake3_avx512.S | 16 +- .../module/icp/asm-x86_64/blake3/blake3_sse2.S | 16 +- .../module/icp/asm-x86_64/blake3/blake3_sse41.S | 16 +- .../module/icp/asm-x86_64/modes/aesni-gcm-x86_64.S | 20 +- .../module/icp/asm-x86_64/modes/ghash-x86_64.S | 16 +- .../module/icp/asm-x86_64/sha2/sha256_impl.S | 1 + .../module/icp/asm-x86_64/sha2/sha512_impl.S | 1 + .../module/icp/include/sys/ia32/asm_linkage.h | 27 +- sys/contrib/openzfs/module/icp/io/sha2_mod.c | 13 +- sys/contrib/openzfs/module/lua/lapi.c | 4 +- sys/contrib/openzfs/module/lua/ldo.c | 2 +- .../openzfs/module/lua/setjmp/setjmp_x86_64.S | 15 +- .../openzfs/module/os/freebsd/spl/acl_common.c | 4 +- .../openzfs/module/os/freebsd/spl/spl_string.c | 30 + .../openzfs/module/os/freebsd/spl/spl_vfs.c | 12 - .../openzfs/module/os/freebsd/zfs/kmod_core.c | 16 +- .../openzfs/module/os/freebsd/zfs/sysctl_os.c | 30 +- .../openzfs/module/os/freebsd/zfs/vdev_file.c | 8 +- .../openzfs/module/os/freebsd/zfs/zfs_acl.c | 37 +- .../openzfs/module/os/freebsd/zfs/zfs_dir.c | 4 +- .../module/os/freebsd/zfs/zfs_ioctl_compat.c | 4 +- .../openzfs/module/os/freebsd/zfs/zfs_vfsops.c | 278 ++++++- .../openzfs/module/os/freebsd/zfs/zfs_vnops_os.c | 68 +- .../openzfs/module/os/freebsd/zfs/zfs_znode.c | 5 +- .../openzfs/module/os/freebsd/zfs/zio_crypt.c | 1 - .../openzfs/module/os/freebsd/zfs/zvol_os.c | 8 +- .../openzfs/module/os/linux/spl/spl-condvar.c | 2 +- sys/contrib/openzfs/module/os/linux/spl/spl-err.c | 2 +- .../openzfs/module/os/linux/spl/spl-generic.c | 112 ++- .../openzfs/module/os/linux/spl/spl-kmem-cache.c | 2 +- .../openzfs/module/os/linux/spl/spl-procfs-list.c | 2 +- .../openzfs/module/os/linux/spl/spl-taskq.c | 1 - sys/contrib/openzfs/module/os/linux/spl/spl-zone.c | 3 +- sys/contrib/openzfs/module/os/linux/zfs/abd_os.c | 10 +- sys/contrib/openzfs/module/os/linux/zfs/arc_os.c | 8 +- sys/contrib/openzfs/module/os/linux/zfs/mmp_os.c | 2 +- sys/contrib/openzfs/module/os/linux/zfs/policy.c | 16 +- .../openzfs/module/os/linux/zfs/spa_misc_os.c | 4 +- .../openzfs/module/os/linux/zfs/vdev_disk.c | 35 +- .../openzfs/module/os/linux/zfs/vdev_file.c | 8 +- sys/contrib/openzfs/module/os/linux/zfs/zfs_acl.c | 93 ++- .../openzfs/module/os/linux/zfs/zfs_ctldir.c | 1 - .../openzfs/module/os/linux/zfs/zfs_debug.c | 2 +- sys/contrib/openzfs/module/os/linux/zfs/zfs_dir.c | 104 ++- .../openzfs/module/os/linux/zfs/zfs_file_os.c | 2 +- .../openzfs/module/os/linux/zfs/zfs_sysfs.c | 6 +- .../openzfs/module/os/linux/zfs/zfs_vfsops.c | 5 +- .../openzfs/module/os/linux/zfs/zfs_vnops_os.c | 354 ++++++--- .../openzfs/module/os/linux/zfs/zfs_znode.c | 9 +- .../openzfs/module/os/linux/zfs/zio_crypt.c | 3 +- .../openzfs/module/os/linux/zfs/zpl_ctldir.c | 6 +- sys/contrib/openzfs/module/os/linux/zfs/zpl_file.c | 6 +- .../openzfs/module/os/linux/zfs/zpl_inode.c | 159 ++-- .../openzfs/module/os/linux/zfs/zpl_super.c | 4 + .../openzfs/module/os/linux/zfs/zpl_xattr.c | 34 +- sys/contrib/openzfs/module/os/linux/zfs/zvol_os.c | 10 +- sys/contrib/openzfs/module/zcommon/zfs_prop.c | 31 +- sys/contrib/openzfs/module/zcommon/zpool_prop.c | 3 + sys/contrib/openzfs/module/zfs/abd.c | 6 +- sys/contrib/openzfs/module/zfs/arc.c | 88 +-- sys/contrib/openzfs/module/zfs/btree.c | 50 +- sys/contrib/openzfs/module/zfs/dataset_kstats.c | 7 +- sys/contrib/openzfs/module/zfs/dbuf.c | 11 +- sys/contrib/openzfs/module/zfs/dmu.c | 27 +- sys/contrib/openzfs/module/zfs/dmu_objset.c | 7 +- sys/contrib/openzfs/module/zfs/dmu_recv.c | 6 +- sys/contrib/openzfs/module/zfs/dmu_send.c | 15 +- sys/contrib/openzfs/module/zfs/dmu_traverse.c | 3 +- sys/contrib/openzfs/module/zfs/dmu_zfetch.c | 4 +- sys/contrib/openzfs/module/zfs/dsl_bookmark.c | 1 - sys/contrib/openzfs/module/zfs/dsl_crypt.c | 18 +- sys/contrib/openzfs/module/zfs/dsl_dataset.c | 3 +- sys/contrib/openzfs/module/zfs/dsl_deadlist.c | 5 +- sys/contrib/openzfs/module/zfs/dsl_dir.c | 59 +- sys/contrib/openzfs/module/zfs/dsl_pool.c | 17 +- sys/contrib/openzfs/module/zfs/dsl_prop.c | 93 +++ sys/contrib/openzfs/module/zfs/dsl_scan.c | 17 +- sys/contrib/openzfs/module/zfs/fm.c | 1 + sys/contrib/openzfs/module/zfs/metaslab.c | 20 +- sys/contrib/openzfs/module/zfs/mmp.c | 18 +- sys/contrib/openzfs/module/zfs/range_tree.c | 1 + sys/contrib/openzfs/module/zfs/spa.c | 74 +- sys/contrib/openzfs/module/zfs/spa_checkpoint.c | 4 +- sys/contrib/openzfs/module/zfs/spa_log_spacemap.c | 40 +- sys/contrib/openzfs/module/zfs/spa_misc.c | 14 +- sys/contrib/openzfs/module/zfs/vdev.c | 57 +- sys/contrib/openzfs/module/zfs/vdev_indirect.c | 9 +- sys/contrib/openzfs/module/zfs/vdev_initialize.c | 18 +- sys/contrib/openzfs/module/zfs/vdev_queue.c | 4 +- sys/contrib/openzfs/module/zfs/vdev_raidz_math.c | 23 +- sys/contrib/openzfs/module/zfs/vdev_rebuild.c | 22 +- sys/contrib/openzfs/module/zfs/vdev_trim.c | 5 +- sys/contrib/openzfs/module/zfs/zap_leaf.c | 4 +- sys/contrib/openzfs/module/zfs/zap_micro.c | 247 ++++--- sys/contrib/openzfs/module/zfs/zcp.c | 14 +- sys/contrib/openzfs/module/zfs/zcp_get.c | 4 +- sys/contrib/openzfs/module/zfs/zfs_chksum.c | 38 +- sys/contrib/openzfs/module/zfs/zfs_fm.c | 2 - sys/contrib/openzfs/module/zfs/zfs_ioctl.c | 8 +- sys/contrib/openzfs/module/zfs/zfs_log.c | 88 ++- sys/contrib/openzfs/module/zfs/zfs_onexit.c | 4 +- sys/contrib/openzfs/module/zfs/zfs_replay.c | 153 +++- sys/contrib/openzfs/module/zfs/zfs_vnops.c | 20 +- sys/contrib/openzfs/module/zfs/zil.c | 46 +- sys/contrib/openzfs/module/zfs/zio.c | 43 +- sys/contrib/openzfs/module/zfs/zio_compress.c | 2 +- sys/contrib/openzfs/module/zfs/zvol.c | 5 +- sys/contrib/openzfs/scripts/Makefile.am | 20 +- sys/contrib/openzfs/scripts/cstyle.pl | 13 +- sys/contrib/openzfs/scripts/debian-packaging.sh | 36 + sys/contrib/openzfs/scripts/enum-extract.pl | 2 +- sys/contrib/openzfs/tests/runfiles/common.run | 14 +- sys/contrib/openzfs/tests/runfiles/linux.run | 8 + .../openzfs/tests/test-runner/bin/zts-report.py.in | 15 + sys/contrib/openzfs/tests/zfs-tests/cmd/.gitignore | 2 + .../openzfs/tests/zfs-tests/cmd/Makefile.am | 5 +- sys/contrib/openzfs/tests/zfs-tests/cmd/badsend.c | 4 + .../openzfs/tests/zfs-tests/cmd/btree_test.c | 48 +- .../tests/zfs-tests/cmd/checksum/edonr_test.c | 18 +- .../tests/zfs-tests/cmd/checksum/sha2_test.c | 20 +- .../tests/zfs-tests/cmd/checksum/skein_test.c | 16 +- sys/contrib/openzfs/tests/zfs-tests/cmd/ctime.c | 1 - sys/contrib/openzfs/tests/zfs-tests/cmd/draid.c | 5 +- .../tests/zfs-tests/cmd/file/largest_file.c | 2 + .../openzfs/tests/zfs-tests/cmd/idmap_util.c | 808 +++++++++++++++++++++ sys/contrib/openzfs/tests/zfs-tests/cmd/mkbusy.c | 8 +- .../openzfs/tests/zfs-tests/cmd/mmap_libaio.c | 2 +- .../openzfs/tests/zfs-tests/cmd/mmapwrite.c | 14 +- .../openzfs/tests/zfs-tests/cmd/nvlist_to_lua.c | 5 + .../openzfs/tests/zfs-tests/cmd/renameat2.c | 128 ++++ .../openzfs/tests/zfs-tests/cmd/stride_dd.c | 4 +- .../openzfs/tests/zfs-tests/cmd/user_ns_exec.c | 1 - .../openzfs/tests/zfs-tests/include/commands.cfg | 7 +- .../tests/zfs-tests/include/properties.shlib | 3 +- .../openzfs/tests/zfs-tests/tests/Makefile.am | 15 +- .../zfs_receive/zfs_receive_to_encrypted.ksh | 31 +- .../functional/cli_root/zpool_add/add-o_ashift.ksh | 6 +- .../cli_root/zpool_add/add_prop_ashift.ksh | 4 +- .../cli_root/zpool_add/zpool_add_004_pos.ksh | 4 + .../cli_root/zpool_attach/attach-o_ashift.ksh | 4 +- .../cli_root/zpool_replace/replace-o_ashift.ksh | 4 +- .../cli_root/zpool_replace/replace_prop_ashift.ksh | 4 +- .../cli_root/zpool_set/zpool_set_ashift.ksh | 4 +- .../functional/fault/auto_offline_001_pos.ksh | 5 + .../tests/functional/idmap_mount/cleanup.ksh | 25 + .../tests/functional/idmap_mount/idmap_mount.cfg | 25 + .../functional/idmap_mount/idmap_mount_001.ksh | 76 ++ .../functional/idmap_mount/idmap_mount_002.ksh | 97 +++ .../functional/idmap_mount/idmap_mount_003.ksh | 121 +++ .../functional/idmap_mount/idmap_mount_004.ksh | 106 +++ .../functional/idmap_mount/idmap_mount_005.ksh | 138 ++++ .../idmap_mount/idmap_mount_common.kshlib | 23 + .../tests/functional/idmap_mount/setup.ksh | 30 + .../functional/inheritance/inherit_001_pos.ksh | 10 +- .../tests/functional/renameat2/Makefile.am | 7 + .../tests/functional/renameat2/cleanup.ksh | 34 + .../functional/renameat2/renameat2_exchange.ksh | 61 ++ .../functional/renameat2/renameat2_noreplace.ksh | 51 ++ .../functional/renameat2/renameat2_whiteout.ksh | 50 ++ .../zfs-tests/tests/functional/renameat2/setup.ksh | 37 + .../tests/functional/rsend/rsend_009_pos.ksh | 43 +- .../functional/rsend/send-c_zstream_recompress.ksh | 58 ++ .../tests/functional/slog/slog_replay_fs_001.ksh | 23 + .../tests/functional/tmpfile/tmpfile_002_pos.c | 7 +- .../tests/functional/tmpfile/tmpfile_stat_mode.c | 30 +- .../functional/userquota/13709_reproducer.bz2 | Bin 0 -> 135829 bytes .../userquota/userspace_encrypted_13709.ksh | 45 ++ .../tests/perf/regression/random_readwrite.ksh | 2 +- sys/modules/zfs/zfs_config.h | 19 +- sys/modules/zfs/zfs_gitrev.h | 2 +- 351 files changed, 7611 insertions(+), 2695 deletions(-) diff --cc cddl/usr.bin/zstream/Makefile index 7ed79e8149bf,000000000000..537dde424f8f mode 100644,000000..100644 --- a/cddl/usr.bin/zstream/Makefile +++ b/cddl/usr.bin/zstream/Makefile @@@ -1,37 -1,0 +1,38 @@@ +# $FreeBSD$ + +ZFSTOP= ${SRCTOP}/sys/contrib/openzfs + +.PATH: ${ZFSTOP}/cmd/zstream +.PATH: ${ZFSTOP}/man/man8 + +PACKAGE= zfs +PROG= zstream +MAN= zstream.8 +MLINKS= zstream.8 zstreamdump.8 +INCS= zstream.h +SRCS= \ + zstream.c \ + zstream_decompress.c \ + zstream_dump.c \ ++ zstream_recompress.c \ + zstream_redup.c \ + zstream_token.c + +SYMLINKS= ${BINDIR}/zstream ${BINDIR}/zstreamdump + +WARNS?= 2 +CFLAGS+= \ + -DIN_BASE \ + -I${ZFSTOP}/include \ + -I${ZFSTOP}/lib/libspl/include \ + -I${ZFSTOP}/lib/libspl/include/os/freebsd \ + -I${SRCTOP}/sys \ + -I${SRCTOP}/cddl/compat/opensolaris/include \ + -I${ZFSTOP}/module/icp/include \ + -include ${ZFSTOP}/include/os/freebsd/spl/sys/ccompile.h \ + -DHAVE_ISSETUGID \ + -include ${SRCTOP}/sys/modules/zfs/zfs_config.h + +LIBADD= geom m nvpair umem uutil avl spl zfs_core zfs zutil zpool + +.include <bsd.prog.mk> diff --cc sys/conf/kern.pre.mk index edde63e6850f,000000000000..d1c1f9d09dbc mode 100644,000000..100644 --- a/sys/conf/kern.pre.mk +++ b/sys/conf/kern.pre.mk @@@ -1,370 -1,0 +1,371 @@@ +# $FreeBSD$ + +# Part of a unified Makefile for building kernels. This part contains all +# of the definitions that need to be before %BEFORE_DEPEND. + +# Allow user to configure things that only effect src tree builds. +# Note: This is duplicated from src.sys.mk to ensure that we include +# /etc/src.conf when building the kernel. Kernels can be built without +# the rest of /usr/src, but they still always process SRCCONF even though +# the normal mechanisms to prevent that (compiling out of tree) won't +# work. To ensure they do work, we have to duplicate thee few lines here. +SRCCONF?= /etc/src.conf +.if (exists(${SRCCONF}) || ${SRCCONF} != "/etc/src.conf") && !target(_srcconf_included_) +.include "${SRCCONF}" +_srcconf_included_: +.endif + +.include <bsd.own.mk> +.include <bsd.compiler.mk> +.include "kern.opts.mk" + +# The kernel build always occurs in the object directory which is .CURDIR. +.if ${.MAKE.MODE:Unormal:Mmeta} +.MAKE.MODE+= curdirOk=yes +.endif + +# The kernel build always expects .OBJDIR=.CURDIR. +.OBJDIR: ${.CURDIR} + +.if defined(NO_OBJWALK) || ${MK_AUTO_OBJ} == "yes" +NO_OBJWALK= t +NO_MODULES_OBJ= t +.endif +.if !defined(NO_OBJWALK) +_obj= obj +.endif + +# Can be overridden by makeoptions or /etc/make.conf +KERNEL_KO?= kernel +KERNEL?= kernel +KODIR?= /boot/${KERNEL} +LDSCRIPT_NAME?= ldscript.$M +LDSCRIPT?= $S/conf/${LDSCRIPT_NAME} + +M= ${MACHINE} + +AWK?= awk +CP?= cp +ELFDUMP?= elfdump +NM?= nm +OBJCOPY?= objcopy +SIZE?= size + +.if defined(DEBUG) +CTFFLAGS+= -g +.endif +.if ${MACHINE_CPUARCH} == "amd64" && ${COMPILER_TYPE} != "clang" +_COPTFLAGS_EXTRA=-frename-registers +.else +_COPTFLAGS_EXTRA= +.endif +COPTFLAGS?=-O2 -pipe ${_COPTFLAGS_EXTRA} +.if !empty(COPTFLAGS:M-O[23s]) && empty(COPTFLAGS:M-fno-strict-aliasing) +COPTFLAGS+= -fno-strict-aliasing +.endif +.if !defined(NO_CPU_COPTFLAGS) +COPTFLAGS+= ${_CPUCFLAGS} +.endif +NOSTDINC= -nostdinc + +INCLUDES= ${NOSTDINC} ${INCLMAGIC} -I. -I$S -I$S/contrib/ck/include + +CFLAGS= ${COPTFLAGS} ${DEBUG} +CFLAGS+= ${INCLUDES} -D_KERNEL -DHAVE_KERNEL_OPTION_HEADERS -include opt_global.h +CFLAGS_PARAM_INLINE_UNIT_GROWTH?=100 +CFLAGS_PARAM_LARGE_FUNCTION_GROWTH?=1000 +CFLAGS.gcc+= -fms-extensions -finline-limit=${INLINE_LIMIT} +CFLAGS.gcc+= --param inline-unit-growth=${CFLAGS_PARAM_INLINE_UNIT_GROWTH} +CFLAGS.gcc+= --param large-function-growth=${CFLAGS_PARAM_LARGE_FUNCTION_GROWTH} +CFLAGS.gcc+= -fms-extensions +.if defined(CFLAGS_ARCH_PARAMS) +CFLAGS.gcc+=${CFLAGS_ARCH_PARAMS} +.endif +WERROR?= -Werror +# The following should be removed no earlier than LLVM11 being imported into the +# tree, to ensure we don't regress the build. LLVM11 and GCC10 will switch the +# default over to -fno-common, making this redundant. +CFLAGS+= -fno-common + +# XXX LOCORE means "don't declare C stuff" not "for locore.s". +ASM_CFLAGS= -x assembler-with-cpp -DLOCORE ${CFLAGS} ${ASM_CFLAGS.${.IMPSRC:T}} + +COMPAT_FREEBSD32_ENABLED!= grep COMPAT_FREEBSD32 opt_global.h || true ; echo + +KASAN_ENABLED!= grep KASAN opt_global.h || true ; echo +.if !empty(KASAN_ENABLED) +SAN_CFLAGS+= -DSAN_NEEDS_INTERCEPTORS -DSAN_INTERCEPTOR_PREFIX=kasan \ + -fsanitize=kernel-address \ + -mllvm -asan-stack=true \ + -mllvm -asan-instrument-dynamic-allocas=true \ + -mllvm -asan-globals=true \ + -mllvm -asan-use-after-scope=true \ + -mllvm -asan-instrumentation-with-call-threshold=0 \ + -mllvm -asan-instrument-byval=false +.endif + +KCSAN_ENABLED!= grep KCSAN opt_global.h || true ; echo +.if !empty(KCSAN_ENABLED) +SAN_CFLAGS+= -DSAN_NEEDS_INTERCEPTORS -DSAN_INTERCEPTOR_PREFIX=kcsan \ + -fsanitize=thread +.endif + +KMSAN_ENABLED!= grep KMSAN opt_global.h || true ; echo +.if !empty(KMSAN_ENABLED) +SAN_CFLAGS+= -DSAN_NEEDS_INTERCEPTORS -DSAN_INTERCEPTOR_PREFIX=kmsan \ + -fsanitize=kernel-memory +.endif + +KUBSAN_ENABLED!= grep KUBSAN opt_global.h || true ; echo +.if !empty(KUBSAN_ENABLED) +SAN_CFLAGS+= -fsanitize=undefined +.endif + +COVERAGE_ENABLED!= grep COVERAGE opt_global.h || true ; echo +.if !empty(COVERAGE_ENABLED) +.if ${COMPILER_TYPE} == "clang" || \ + (${COMPILER_TYPE} == "gcc" && ${COMPILER_VERSION} >= 80100) +SAN_CFLAGS+= -fsanitize-coverage=trace-pc,trace-cmp +.else +SAN_CFLAGS+= -fsanitize-coverage=trace-pc +.endif +.endif + +CFLAGS+= ${SAN_CFLAGS} + +GCOV_ENABLED!= grep GCOV opt_global.h || true ; echo +.if !empty(GCOV_ENABLED) +.if ${COMPILER_TYPE} == "gcc" +GCOV_CFLAGS+= -fprofile-arcs -ftest-coverage +.endif +.endif + +CFLAGS+= ${GCOV_CFLAGS} + +# Put configuration-specific C flags last so that they can override +# the others. +CFLAGS+= ${CONF_CFLAGS} + +.if defined(LINKER_FEATURES) && ${LINKER_FEATURES:Mbuild-id} +LDFLAGS+= --build-id=sha1 +.endif + +.if (${MACHINE_CPUARCH} == "aarch64" || ${MACHINE_CPUARCH} == "amd64" || \ + ${MACHINE_CPUARCH} == "i386" || ${MACHINE} == "powerpc") && \ + defined(LINKER_FEATURES) && ${LINKER_FEATURES:Mifunc} == "" && \ + !make(install) +.error amd64/arm64/i386/ppc* kernel requires linker ifunc support +.endif +.if ${MACHINE_CPUARCH} == "amd64" +LDFLAGS+= -z max-page-size=2097152 +.if ${LINKER_TYPE} != "lld" +LDFLAGS+= -z common-page-size=4096 +.else +.if defined(LINKER_FEATURES) && !${LINKER_FEATURES:Mifunc-noplt} +.warning "Linker ${LD} does not support -z ifunc-noplt -> ifunc calls are unoptimized." +.else +LDFLAGS+= -z notext -z ifunc-noplt +.endif +.endif +.endif # ${MACHINE_CPUARCH} == "amd64" + +.if ${MACHINE_CPUARCH} == "riscv" +# Hack: Work around undefined weak symbols being out of range when linking with +# LLD (address is a PC-relative calculation, and BFD works around this by +# rewriting the instructions to generate an absolute address of 0); -fPIE +# avoids this since it uses the GOT for all extern symbols, which is overly +# inefficient for us. Drop once undefined weak symbols work with medany. +.if ${LINKER_TYPE} == "lld" +CFLAGS+= -fPIE +.endif +.endif + +NORMAL_C= ${CC} -c ${CFLAGS} ${WERROR} ${.IMPSRC} +NORMAL_S= ${CC:N${CCACHE_BIN}} -c ${ASM_CFLAGS} ${WERROR} ${.IMPSRC} +NORMAL_C_NOWERROR= ${CC} -c ${CFLAGS} ${.IMPSRC} + +NORMAL_M= ${AWK} -f $S/tools/makeobjops.awk ${.IMPSRC} -c ; \ + ${CC} -c ${CFLAGS} ${WERROR} ${.PREFIX}.c + +NORMAL_FW= uudecode -o ${.TARGET} ${.ALLSRC} +NORMAL_FWO= ${CC:N${CCACHE_BIN}} -c ${ASM_CFLAGS} ${WERROR} -o ${.TARGET} \ + $S/kern/firmw.S -DFIRMW_FILE="${.ALLSRC:M*.fw}" \ + -DFIRMW_SYMBOL="${.ALLSRC:M*.fw:C/[-.\/]/_/g}" + +# for ZSTD in the kernel (include zstd/lib/freebsd before other CFLAGS) +ZSTD_C= ${CC} -c -DZSTD_HEAPMODE=1 -I$S/contrib/zstd/lib/freebsd ${CFLAGS} \ + -I$S/contrib/zstd/lib -I$S/contrib/zstd/lib/common ${WERROR} \ + -Wno-missing-prototypes -U__BMI__ -DZSTD_NO_INTRINSICS ${.IMPSRC} +# https://github.com/facebook/zstd/commit/812e8f2a [zstd 1.4.1] +# "Note that [GCC] autovectorization still does not do a good job on the +# optimized version, so it's turned off via attribute and flag. I found +# that neither attribute nor command-line flag were entirely successful in +# turning off vectorization, which is why there were both." +.if ${COMPILER_TYPE} == "gcc" +ZSTD_DECOMPRESS_BLOCK_FLAGS= -fno-tree-vectorize +.endif + +ZINCDIR=$S/contrib/openzfs/include +# Common for dtrace / zfs +CDDL_CFLAGS= \ + -DFREEBSD_NAMECACHE \ + -D_SYS_VMEM_H_ \ + -D__KERNEL \ + -D__KERNEL__ \ + -nostdinc \ + -include $S/modules/zfs/static_ccompile.h \ + -I${ZINCDIR} \ + -I${ZINCDIR}/os/freebsd \ + -I${ZINCDIR}/os/freebsd/spl \ + -I${ZINCDIR}/os/freebsd/zfs \ + -I$S/modules/zfs \ + -I$S/contrib/openzfs/module/zstd/include \ + ${CFLAGS} \ + -Wno-cast-qual \ + -Wno-duplicate-decl-specifier \ + -Wno-missing-braces \ + -Wno-missing-prototypes \ + -Wno-nested-externs \ + -Wno-parentheses \ + -Wno-pointer-arith \ + -Wno-strict-prototypes \ + -Wno-switch \ + -Wno-undef \ + -Wno-uninitialized \ + -Wno-unknown-pragmas \ + -Wno-unused \ + -include ${ZINCDIR}/os/freebsd/spl/sys/ccompile.h \ + -I$S/cddl/contrib/opensolaris/uts/common \ + -I$S -I$S/cddl/compat/opensolaris +CDDL_C= ${CC} -c ${CDDL_CFLAGS} ${WERROR} ${.IMPSRC} + +# Special flags for managing the compat compiles for ZFS - ZFS_CFLAGS+= ${CDDL_CFLAGS} -DBUILDING_ZFS -DHAVE_UIO_ZEROCOPY \ ++ZFS_CFLAGS+= -I$S/contrib/openzfs/module/icp/include \ ++ ${CDDL_CFLAGS} -DBUILDING_ZFS -DHAVE_UIO_ZEROCOPY \ + -DWITH_NETDUMP -D__KERNEL__ -D_SYS_CONDVAR_H_ -DSMP \ + -DIN_FREEBSD_BASE + +.if ${MACHINE_ARCH} == "amd64" +ZFS_CFLAGS+= -D__x86_64 -DHAVE_SSE2 -DHAVE_SSSE3 -DHAVE_SSE4_1 -DHAVE_SSE4_2 \ + -DHAVE_AVX -DHAVE_AVX2 -DHAVE_AVX512F -DHAVE_AVX512VL -DHAVE_AVX512BW +.endif + +.if ${MACHINE_ARCH} == "i386" || ${MACHINE_ARCH} == "powerpc" || \ + ${MACHINE_ARCH} == "powerpcspe" || ${MACHINE_ARCH} == "arm" +ZFS_CFLAGS+= -DBITS_PER_LONG=32 +.else +ZFS_CFLAGS+= -DBITS_PER_LONG=64 +.endif + + +ZFS_ASM_CFLAGS= -x assembler-with-cpp -DLOCORE ${ZFS_CFLAGS} +ZFS_C= ${CC} -c ${ZFS_CFLAGS} ${WERROR} ${.IMPSRC} +ZFS_RPC_C= ${CC} -c ${ZFS_CFLAGS} -DHAVE_RPC_TYPES ${WERROR} ${.IMPSRC} +ZFS_S= ${CC} -c ${ZFS_ASM_CFLAGS} ${WERROR} ${.IMPSRC} + +# ATH driver +ATH_CFLAGS= -I${SRCTOP}/sys/dev/ath ${NO_WUNUSED_BUT_SET_VARIABLE} +ATH_C= ${CC} -c ${CFLAGS} ${WERROR} ${ATH_CFLAGS} ${.IMPSRC} + +# Special flags for managing the compat compiles for DTrace +DTRACE_CFLAGS= -DBUILDING_DTRACE ${CDDL_CFLAGS} -I$S/cddl/dev/dtrace -I$S/cddl/dev/dtrace/${MACHINE_CPUARCH} +.if ${MACHINE_CPUARCH} == "amd64" || ${MACHINE_CPUARCH} == "i386" +DTRACE_CFLAGS+= -I$S/cddl/contrib/opensolaris/uts/intel -I$S/cddl/dev/dtrace/x86 +.endif +DTRACE_CFLAGS+= -I$S/cddl/contrib/opensolaris/common/util -I$S -DDIS_MEM -DSMP -I$S/cddl/compat/opensolaris +DTRACE_CFLAGS+= -I$S/cddl/contrib/opensolaris/uts/common +DTRACE_ASM_CFLAGS= -x assembler-with-cpp -DLOCORE ${DTRACE_CFLAGS} +DTRACE_C= ${CC} -c ${DTRACE_CFLAGS} ${WERROR} ${.IMPSRC} +DTRACE_S= ${CC} -c ${DTRACE_ASM_CFLAGS} ${WERROR} ${.IMPSRC} + +# Special flags for managing the compat compiles for DTrace/FBT +FBT_CFLAGS= -DBUILDING_DTRACE -nostdinc -I$S/cddl/dev/fbt/${MACHINE_CPUARCH} -I$S/cddl/dev/fbt ${CDDL_CFLAGS} -I$S/cddl/compat/opensolaris -I$S/cddl/contrib/opensolaris/uts/common +.if ${MACHINE_CPUARCH} == "amd64" || ${MACHINE_CPUARCH} == "i386" +FBT_CFLAGS+= -I$S/cddl/dev/fbt/x86 +.endif +FBT_C= ${CC} -c ${FBT_CFLAGS} ${WERROR} ${.IMPSRC} + +.if ${MK_CTF} != "no" +NORMAL_CTFCONVERT= ${CTFCONVERT} ${CTFFLAGS} ${.TARGET} +.elif ${MAKE_VERSION} >= 5201111300 +NORMAL_CTFCONVERT= +.else +NORMAL_CTFCONVERT= @: +.endif + +# Linux Kernel Programming Interface C-flags +LINUXKPI_INCLUDES= -I$S/compat/linuxkpi/common/include \ + -I$S/compat/linuxkpi/dummy/include +LINUXKPI_C= ${NORMAL_C} ${LINUXKPI_INCLUDES} + +# Infiniband C flags. Correct include paths and omit errors that linux +# does not honor. +OFEDINCLUDES= -I$S/ofed/include -I$S/ofed/include/uapi ${LINUXKPI_INCLUDES} +OFEDNOERR= -Wno-cast-qual -Wno-pointer-arith +OFEDCFLAGS= ${CFLAGS:N-I*} -DCONFIG_INFINIBAND_USER_MEM \ + ${OFEDINCLUDES} ${CFLAGS:M-I*} ${OFEDNOERR} +OFED_C_NOIMP= ${CC} -c -o ${.TARGET} ${OFEDCFLAGS} ${WERROR} +OFED_C= ${OFED_C_NOIMP} ${.IMPSRC} + +# mlxfw C flags. +MLXFW_C= ${OFED_C_NOIMP} \ + -I${SRCTOP}/sys/contrib/xz-embedded/freebsd \ + -I${SRCTOP}/sys/contrib/xz-embedded/linux/lib/xz \ + ${.IMPSRC} + +GEN_CFILES= $S/$M/$M/genassym.c ${MFILES:T:S/.m$/.c/} +SYSTEM_CFILES= config.c env.c hints.c vnode_if.c +SYSTEM_DEP= Makefile ${SYSTEM_OBJS} +SYSTEM_OBJS= locore.o ${MDOBJS} ${OBJS} +SYSTEM_OBJS+= ${SYSTEM_CFILES:.c=.o} +SYSTEM_OBJS+= force-dynamic-hack.pico + +KEYMAP=kbdcontrol -P ${SRCTOP}/share/vt/keymaps -P ${SRCTOP}/share/syscons/keymaps +KEYMAP_FIX=sed -e 's/^static keymap_t.* = /static keymap_t key_map = /' -e 's/^static accentmap_t.* = /static accentmap_t accent_map = /' + +MD_ROOT_SIZE_CONFIGURED!= grep MD_ROOT_SIZE opt_md.h || true ; echo +.if ${MFS_IMAGE:Uno} != "no" +.if empty(MD_ROOT_SIZE_CONFIGURED) +SYSTEM_OBJS+= embedfs_${MFS_IMAGE:T:R}.o +.endif +.endif +SYSTEM_LD_BASECMD= \ + ${LD} -m ${LD_EMULATION} -Bdynamic -T ${LDSCRIPT} ${_LDFLAGS} \ + --no-warn-mismatch --warn-common --export-dynamic \ + --dynamic-linker /red/herring -X +SYSTEM_LD= @${SYSTEM_LD_BASECMD} -o ${.TARGET} ${SYSTEM_OBJS} vers.o +SYSTEM_LD_TAIL= @${OBJCOPY} --strip-symbol gcc2_compiled. ${.TARGET} ; \ + ${SIZE} ${.TARGET} ; chmod 755 ${.TARGET} +SYSTEM_DEP+= ${LDSCRIPT} + +# Calculate path for .m files early, if needed. +.if !defined(NO_MODULES) && !defined(__MPATH) && !make(install) && \ + (empty(.MAKEFLAGS:M-V) || defined(NO_SKIP_MPATH)) +__MPATH!=find ${S:tA}/ -name \*_if.m +.endif + +# MKMODULESENV is set here so that port makefiles can augment +# them. + +MKMODULESENV+= MAKEOBJDIRPREFIX=${.OBJDIR}/modules KMODDIR=${KODIR} +MKMODULESENV+= MACHINE_CPUARCH=${MACHINE_CPUARCH} +MKMODULESENV+= MACHINE=${MACHINE} MACHINE_ARCH=${MACHINE_ARCH} +MKMODULESENV+= MODULES_EXTRA="${MODULES_EXTRA}" WITHOUT_MODULES="${WITHOUT_MODULES}" +MKMODULESENV+= ARCH_FLAGS="${ARCH_FLAGS}" +.if (${KERN_IDENT} == LINT) +MKMODULESENV+= ALL_MODULES=LINT +.endif +.if defined(MODULES_OVERRIDE) +MKMODULESENV+= MODULES_OVERRIDE="${MODULES_OVERRIDE}" +.endif +.if defined(DEBUG) +MKMODULESENV+= DEBUG_FLAGS="${DEBUG}" +.endif +.if !defined(NO_MODULES) +MKMODULESENV+= __MPATH="${__MPATH}" +.endif + +# Detect kernel config options that force stack frames to be turned on. +DDB_ENABLED!= grep DDB opt_ddb.h || true ; echo +DTR_ENABLED!= grep KDTRACE_FRAME opt_kdtrace.h || true ; echo +HWPMC_ENABLED!= grep HWPMC opt_hwpmc_hooks.h || true ; echo diff --cc sys/contrib/openzfs/.github/workflows/codeql.yml index 000000000000,c8a49a7f00bc..c8a49a7f00bc mode 000000,100644..100644 --- a/sys/contrib/openzfs/.github/workflows/codeql.yml +++ b/sys/contrib/openzfs/.github/workflows/codeql.yml diff --cc sys/contrib/openzfs/cmd/zstream/zstream_recompress.c index 000000000000,b7370587fc6a..b7370587fc6a mode 000000,100644..100644 --- a/sys/contrib/openzfs/cmd/zstream/zstream_recompress.c +++ b/sys/contrib/openzfs/cmd/zstream/zstream_recompress.c diff --cc sys/contrib/openzfs/config/kernel-dentry-alias.m4 index 000000000000,f0ddb8d010b0..f0ddb8d010b0 mode 000000,100644..100644 --- a/sys/contrib/openzfs/config/kernel-dentry-alias.m4 +++ b/sys/contrib/openzfs/config/kernel-dentry-alias.m4 diff --cc sys/contrib/openzfs/config/kernel-iattr-vfsid.m4 index 000000000000,75bc4613b838..75bc4613b838 mode 000000,100644..100644 --- a/sys/contrib/openzfs/config/kernel-iattr-vfsid.m4 +++ b/sys/contrib/openzfs/config/kernel-iattr-vfsid.m4 diff --cc sys/contrib/openzfs/config/kernel-idmap_mnt_api.m4 index 000000000000,47ddc5702fb7..47ddc5702fb7 mode 000000,100644..100644 --- a/sys/contrib/openzfs/config/kernel-idmap_mnt_api.m4 +++ b/sys/contrib/openzfs/config/kernel-idmap_mnt_api.m4 diff --cc sys/contrib/openzfs/contrib/debian/changelog index 000000000000,6273d603834a..6273d603834a mode 000000,100644..100644 --- a/sys/contrib/openzfs/contrib/debian/changelog +++ b/sys/contrib/openzfs/contrib/debian/changelog diff --cc sys/contrib/openzfs/contrib/debian/clean index 000000000000,3100d693aeba..3100d693aeba mode 000000,100644..100644 --- a/sys/contrib/openzfs/contrib/debian/clean +++ b/sys/contrib/openzfs/contrib/debian/clean diff --cc sys/contrib/openzfs/contrib/debian/control index 000000000000,a0db4985ed1a..a0db4985ed1a mode 000000,100644..100644 --- a/sys/contrib/openzfs/contrib/debian/control +++ b/sys/contrib/openzfs/contrib/debian/control diff --cc sys/contrib/openzfs/contrib/debian/control.modules.in index 000000000000,70a165266d16..70a165266d16 mode 000000,100644..100644 --- a/sys/contrib/openzfs/contrib/debian/control.modules.in +++ b/sys/contrib/openzfs/contrib/debian/control.modules.in diff --cc sys/contrib/openzfs/contrib/debian/copyright index 000000000000,65c7d209d8eb..65c7d209d8eb mode 000000,100644..100644 --- a/sys/contrib/openzfs/contrib/debian/copyright +++ b/sys/contrib/openzfs/contrib/debian/copyright diff --cc sys/contrib/openzfs/contrib/debian/not-installed index 000000000000,ad14776f3b7e..ad14776f3b7e mode 000000,100644..100644 --- a/sys/contrib/openzfs/contrib/debian/not-installed +++ b/sys/contrib/openzfs/contrib/debian/not-installed diff --cc sys/contrib/openzfs/contrib/debian/openzfs-libnvpair3.docs index 000000000000,4302f1b2ab6a..4302f1b2ab6a mode 000000,100644..100644 --- a/sys/contrib/openzfs/contrib/debian/openzfs-libnvpair3.docs +++ b/sys/contrib/openzfs/contrib/debian/openzfs-libnvpair3.docs diff --cc sys/contrib/openzfs/contrib/debian/openzfs-libnvpair3.install.in index 000000000000,ed7b541e3607..ed7b541e3607 mode 000000,100644..100644 --- a/sys/contrib/openzfs/contrib/debian/openzfs-libnvpair3.install.in +++ b/sys/contrib/openzfs/contrib/debian/openzfs-libnvpair3.install.in diff --cc sys/contrib/openzfs/contrib/debian/openzfs-libpam-zfs.install index 000000000000,c33123f69a8d..c33123f69a8d mode 000000,100644..100644 --- a/sys/contrib/openzfs/contrib/debian/openzfs-libpam-zfs.install +++ b/sys/contrib/openzfs/contrib/debian/openzfs-libpam-zfs.install diff --cc sys/contrib/openzfs/contrib/debian/openzfs-libpam-zfs.postinst index 000000000000,2db86744e4e6..2db86744e4e6 mode 000000,100644..100644 --- a/sys/contrib/openzfs/contrib/debian/openzfs-libpam-zfs.postinst +++ b/sys/contrib/openzfs/contrib/debian/openzfs-libpam-zfs.postinst diff --cc sys/contrib/openzfs/contrib/debian/openzfs-libpam-zfs.prerm index 000000000000,21e827001c23..21e827001c23 mode 000000,100644..100644 --- a/sys/contrib/openzfs/contrib/debian/openzfs-libpam-zfs.prerm +++ b/sys/contrib/openzfs/contrib/debian/openzfs-libpam-zfs.prerm diff --cc sys/contrib/openzfs/contrib/debian/openzfs-libuutil3.docs index 000000000000,4302f1b2ab6a..4302f1b2ab6a mode 000000,100644..100644 --- a/sys/contrib/openzfs/contrib/debian/openzfs-libuutil3.docs +++ b/sys/contrib/openzfs/contrib/debian/openzfs-libuutil3.docs diff --cc sys/contrib/openzfs/contrib/debian/openzfs-libuutil3.install.in index 000000000000,a197d030d743..a197d030d743 mode 000000,100644..100644 --- a/sys/contrib/openzfs/contrib/debian/openzfs-libuutil3.install.in +++ b/sys/contrib/openzfs/contrib/debian/openzfs-libuutil3.install.in diff --cc sys/contrib/openzfs/contrib/debian/openzfs-libzfs-dev.docs index 000000000000,4302f1b2ab6a..4302f1b2ab6a mode 000000,100644..100644 --- a/sys/contrib/openzfs/contrib/debian/openzfs-libzfs-dev.docs +++ b/sys/contrib/openzfs/contrib/debian/openzfs-libzfs-dev.docs diff --cc sys/contrib/openzfs/contrib/debian/openzfs-libzfs-dev.install.in index 000000000000,eaa8c3925e24..eaa8c3925e24 mode 000000,100644..100644 --- a/sys/contrib/openzfs/contrib/debian/openzfs-libzfs-dev.install.in +++ b/sys/contrib/openzfs/contrib/debian/openzfs-libzfs-dev.install.in diff --cc sys/contrib/openzfs/contrib/debian/openzfs-libzfs4.docs index 000000000000,4302f1b2ab6a..4302f1b2ab6a mode 000000,100644..100644 --- a/sys/contrib/openzfs/contrib/debian/openzfs-libzfs4.docs +++ b/sys/contrib/openzfs/contrib/debian/openzfs-libzfs4.docs diff --cc sys/contrib/openzfs/contrib/debian/openzfs-libzfs4.install.in index 000000000000,6765aaee59cc..6765aaee59cc mode 000000,100644..100644 --- a/sys/contrib/openzfs/contrib/debian/openzfs-libzfs4.install.in +++ b/sys/contrib/openzfs/contrib/debian/openzfs-libzfs4.install.in diff --cc sys/contrib/openzfs/contrib/debian/openzfs-libzfsbootenv1.docs index 000000000000,4302f1b2ab6a..4302f1b2ab6a mode 000000,100644..100644 --- a/sys/contrib/openzfs/contrib/debian/openzfs-libzfsbootenv1.docs +++ b/sys/contrib/openzfs/contrib/debian/openzfs-libzfsbootenv1.docs diff --cc sys/contrib/openzfs/contrib/debian/openzfs-libzfsbootenv1.install.in index 000000000000,49216742433f..49216742433f mode 000000,100644..100644 --- a/sys/contrib/openzfs/contrib/debian/openzfs-libzfsbootenv1.install.in +++ b/sys/contrib/openzfs/contrib/debian/openzfs-libzfsbootenv1.install.in diff --cc sys/contrib/openzfs/contrib/debian/openzfs-libzpool5.docs index 000000000000,4302f1b2ab6a..4302f1b2ab6a mode 000000,100644..100644 --- a/sys/contrib/openzfs/contrib/debian/openzfs-libzpool5.docs +++ b/sys/contrib/openzfs/contrib/debian/openzfs-libzpool5.docs diff --cc sys/contrib/openzfs/contrib/debian/openzfs-libzpool5.install.in index 000000000000,b9e872df9ba8..b9e872df9ba8 mode 000000,100644..100644 --- a/sys/contrib/openzfs/contrib/debian/openzfs-libzpool5.install.in +++ b/sys/contrib/openzfs/contrib/debian/openzfs-libzpool5.install.in diff --cc sys/contrib/openzfs/contrib/debian/openzfs-python3-pyzfs.install index 000000000000,4606faae20a7..4606faae20a7 mode 000000,100644..100644 --- a/sys/contrib/openzfs/contrib/debian/openzfs-python3-pyzfs.install +++ b/sys/contrib/openzfs/contrib/debian/openzfs-python3-pyzfs.install diff --cc sys/contrib/openzfs/contrib/debian/openzfs-zfs-dkms.config index 000000000000,ad7e160a2b11..ad7e160a2b11 mode 000000,100644..100644 --- a/sys/contrib/openzfs/contrib/debian/openzfs-zfs-dkms.config +++ b/sys/contrib/openzfs/contrib/debian/openzfs-zfs-dkms.config diff --cc sys/contrib/openzfs/contrib/debian/openzfs-zfs-dkms.dkms index 000000000000,3ac8677b7cde..3ac8677b7cde mode 000000,100644..100644 --- a/sys/contrib/openzfs/contrib/debian/openzfs-zfs-dkms.dkms +++ b/sys/contrib/openzfs/contrib/debian/openzfs-zfs-dkms.dkms diff --cc sys/contrib/openzfs/contrib/debian/openzfs-zfs-dkms.docs index 000000000000,4302f1b2ab6a..4302f1b2ab6a mode 000000,100644..100644 --- a/sys/contrib/openzfs/contrib/debian/openzfs-zfs-dkms.docs +++ b/sys/contrib/openzfs/contrib/debian/openzfs-zfs-dkms.docs diff --cc sys/contrib/openzfs/contrib/debian/openzfs-zfs-dkms.install index 000000000000,b601f22c481a..b601f22c481a mode 000000,100644..100644 --- a/sys/contrib/openzfs/contrib/debian/openzfs-zfs-dkms.install +++ b/sys/contrib/openzfs/contrib/debian/openzfs-zfs-dkms.install diff --cc sys/contrib/openzfs/contrib/debian/openzfs-zfs-dkms.postinst index 000000000000,0ecb9674d559..0ecb9674d559 mode 000000,100644..100644 --- a/sys/contrib/openzfs/contrib/debian/openzfs-zfs-dkms.postinst +++ b/sys/contrib/openzfs/contrib/debian/openzfs-zfs-dkms.postinst diff --cc sys/contrib/openzfs/contrib/debian/openzfs-zfs-dkms.prerm index 000000000000,fea2aee8b902..fea2aee8b902 mode 000000,100644..100644 --- a/sys/contrib/openzfs/contrib/debian/openzfs-zfs-dkms.prerm +++ b/sys/contrib/openzfs/contrib/debian/openzfs-zfs-dkms.prerm *** 1292 LINES SKIPPED ***