aboutsummaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* Make dracut fail if essential files cannot be installedSavyasachee Jha2022-02-161-10/+30
| | | | | | | | | | Dracut will now fail in initramfs generation if essential files cannot be installed. Reviewed-by: Ahelenia Ziemiańska <[email protected]> Reviewed-by: Andrew J. Hesford <[email protected]> Signed-off-by: Savyasachee Jha <[email protected]> Closes #13010
* Make better use of dracut functions when building initramfsSavyasachee Jha2022-02-161-53/+24
| | | | | | | | | | | | | | | | | | Setting up the module involves multiple redundant calls to a bunch of dracut functions wheich can be combined into one. Additionally, the mass of code required to load libgcc_s.so* can be replaced with one dracut function. This has the additional effect of removing errors involving the non-installation of libgcc_s.so* which are seen on debian bullseye when using version 2.1.2-1~bpo11+1 from the backports repository. The systemd binaries are separated out into their own `dracut_install` function call so they do not get pulled in when dracut does not load the systemd module. Reviewed-by: Ahelenia Ziemiańska <[email protected]> Reviewed-by: Andrew J. Hesford <[email protected]> Signed-off-by: Savyasachee Jha <[email protected]> Closes #13010
* Fix Linux kernel directories detectionDamian Szuberski2022-02-161-30/+75
| | | | | | | | | | | | | | | | | | | | | | | | | Most modern Linux distributions have separate locations for bare source and prebuilt ("build") files. Additionally, there are `source` and `build` symlinks in `/lib/modules/$(KERNEL_VERSION)` pointing to them. The order of directory search is now: - `configure` command line values if both `--with-linux` and `--with-linux-obj` were defined - If only `--with-linux` was defined, `--with-linux-obj` is assumed to have the same value as `--with-linux` - If neither `--with-linux` nor `--with-linux-obj` were defined autodetection is used: - `/lib/modules/$(uname -r)/{source,build}` respectively, if exist - The first directory in `/lib/modules` with the highest version number according to `sort -V` which contains `source` and `build` symlinks/directories - The first directory matching `/usr/src/kernels/*` and `/usr/src/linux-*` with the highest version number according to `sort -V`. Here the source and prebuilt directories are assumed to be the same. Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: szubersk <[email protected]> Closes #9935 Closes #13096
* Enable encrypted raw sending to pools with greater ashiftGeorge Amanakis2022-02-164-2/+202
| | | | | | | | | | | | | | | | | | | | | | Raw sending from pool1/encrypted with ashift=9 to pool2/encrypted with ashift=12 results to failure when mounting pool2/encrypted (Input/Output error). Notably, the opposite, raw sending from a greater ashift to a lower one does not fail. This happens because zio_compress_write() falsely checks only ZIO_FLAG_RAW_COMPRESS and not ZIO_FLAG_RAW_ENCRYPT which is also set in encrypted raw send streams. In this case it rounds up the psize and if not equal to the zio->io_size it modifies the block by zeroing out the extra bytes. Because this happens in a SA attr. registration object (type=46), the decryption fails upon mounting the filesystem, and zpool status falsely reports an error. Fix this by checking both ZIO_FLAG_RAW_COMPRESS and ZIO_FLAG_RAW_ENCRYPT before deciding whether to zero-pad a block. Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: George Amanakis <[email protected]> Closes #13067 Closes #13074
* `checkabi`/`storeabi` relevant only to x86_64Damian Szuberski2022-02-162-15/+24
| | | | | | | | | The stored ABI files are for the x86_64 architecture. Reviewed-by: Brian Behlendorf <[email protected]> Reviewed-by: George Melikov <[email protected]> Signed-off-by: szubersk <[email protected]> Closes #11345 Closes #13104
* Colorize the Github test outputRich Ercolani2022-02-164-3/+35
| | | | | | | | | Let's color our workflow test output for better readability. Reviewed by: George Melikov <[email protected]> Reviewed-by: Brian Behlendorf <[email protected]> Reviewed-by: Ahelenia Ziemiańska <[email protected]> Signed-off-by: Rich Ercolani <[email protected]> Closes #13000
* libzfs: calculate receive times with sub-second precisionнаб2022-02-151-8/+20
| | | | | | | | | Provide two digits of precision when reporting send/receive times. Tiny snapshots may take significantly less than a second and rounding up to a full second can introduce a significant error. Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Ahelenia Ziemiańska <[email protected]> Closes #13047
* Cross-platform xattr user namespace compatibilityRyan Moeller2022-02-159-124/+453
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ZFS on Linux originally implemented xattr namespaces in a way that is incompatible with other operating systems. On illumos, xattrs do not have namespaces. Every xattr name is visible. FreeBSD has two universally defined namespaces: EXTATTR_NAMESPACE_USER and EXTATTR_NAMESPACE_SYSTEM. The system namespace is used for protected FreeBSD-specific attributes such as MAC labels and pnfs state. These attributes have the namespace string "freebsd:system:" prefixed to the name in the encoding scheme used by ZFS. The user namespace is used for general purpose user attributes and obeys normal access control mechanisms. These attributes have no namespace string prefixed, so xattrs written on illumos are accessible in the user namespace on FreeBSD, and xattrs written to the user namespace on FreeBSD are accessible by the same name on illumos. Linux has several xattr namespaces. On Linux, ZFS encodes the namespace in the xattr name for every namespace, including the user namespace. As a consequence, an xattr in the user namespace with the name "foo" is stored by ZFS with the name "user.foo" and therefore appears on FreeBSD and illumos to have the name "user.foo" rather than "foo". Conversely, none of the xattrs written on FreeBSD or illumos are accessible on Linux unless the name happens to be prefixed with one of the Linux xattr namespaces, in which case the namespace is stripped from the name. This makes xattrs entirely incompatible between Linux and other platforms. We want to make the encoding of user namespace xattrs compatible across platforms. A critical requirement of this compatibility is for xattrs from existing pools from FreeBSD and illumos to be accessible by the same names in the user namespace on Linux. It is also necessary that existing pools with xattrs written by Linux retain access to those xattrs by the same names on Linux. Making user namespace xattrs from Linux accessible by the correct names on other platforms is important. The handling of other namespaces is not required to be consistent. Add a fallback mechanism for listing and getting xattrs to treat xattrs as being in the user namespace if they do not match a known prefix. Do not allow setting or getting xattrs with a name that is prefixed with one of the namespace names used by ZFS on supported platforms. Allow choosing between legacy illumos and FreeBSD compatibility and legacy Linux compatibility with a new tunable. This facilitates replication and migration of pools between hosts with different compatibility needs. The tunable controls whether or not to prefix the namespace to the name. If the xattr is already present with the alternate prefix, remove it so only the new version persists. By default the platform's existing convention is used. Reviewed-by: Christian Schwarz <[email protected]> Reviewed-by: Ahelenia Ziemiańska <[email protected]> Reviewed-by: Alexander Motin <[email protected]> Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Ryan Moeller <[email protected]> Closes #11919
* module: icp: remove provider statsнаб2022-02-154-135/+1
| | | | | | | | | | | These were all folded into a single kstat at /proc/spl/kstat/kcf/NONAME_provider_stats with no way to know which one it actually was, and only the AES and SHA (so not Skein) ones were ever updated Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Ahelenia Ziemiańska <[email protected]> Closes #12901
* module: icp: enforce KCF_{OPS_CLASSSIZE,MAXMECHTAB}наб2022-02-151-1/+7
| | | | | | Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Ahelenia Ziemiańska <[email protected]> Closes #12901
* module: icp: remove unused pd_{remove_cv,hash_limit}наб2022-02-152-8/+0
| | | | | | Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Ahelenia Ziemiańska <[email protected]> Closes #12901
* module: icp: remove vestigia of crypto sessionsнаб2022-02-158-126/+50
| | | | | | Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Ahelenia Ziemiańska <[email protected]> Closes #12901
* module: icp: remove unused (and mostly faked) ↵наб2022-02-1510-83/+21
| | | | | | | | cm_{{min,max}_key_length,mech_flags} Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Ahelenia Ziemiańska <[email protected]> Closes #12901
* module: icp: remove unused crypto_provider_handle_tнаб2022-02-157-93/+54
| | | | | | Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Ahelenia Ziemiańska <[email protected]> Closes #12901
* module: icp: remove pre-set entries from mechtabsнаб2022-02-151-22/+2
| | | | | | | | They don't do anything except clogging up the AVL tree Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Ahelenia Ziemiańska <[email protected]> Closes #12901
* module: icp: rip out insane crypto_req_handle_t mechanism, inline KM_SLEEPнаб2022-02-1516-339/+187
| | | | | | Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Ahelenia Ziemiańska <[email protected]> Closes #12901
* include: crypto: clean out api.hнаб2022-02-153-86/+3
| | | | | | Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Ahelenia Ziemiańska <[email protected]> Closes #12901
* module: icp: remove unused headers. Migrate {ops => sched}_implнаб2022-02-154-354/+5
| | | | | | Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Ahelenia Ziemiańska <[email protected]> Closes #12901
* include: crypto: clean out unused SYSCALL32 and flagsнаб2022-02-152-72/+0
| | | | | | Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Ahelenia Ziemiańska <[email protected]> Closes #12901
* module: icp: remove algorithm name defines used only in the default mechtabнаб2022-02-152-27/+1
| | | | | | Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Ahelenia Ziemiańska <[email protected]> Closes #12901
* include: crypto: remove unused algorithm name definesнаб2022-02-151-13/+0
| | | | | | Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Ahelenia Ziemiańska <[email protected]> Closes #12901
* module: icp: remove set-but-unused cd_miscdataнаб2022-02-156-72/+22
| | | | | | Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Ahelenia Ziemiańska <[email protected]> Closes #12901
* module: icp: fold away all key formats except CRYPTO_KEY_RAWнаб2022-02-1514-264/+28
| | | | | | | | It's the only one actually used Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Ahelenia Ziemiańska <[email protected]> Closes #12901
* module: icp: remove unused CRYPTO_* error codesнаб2022-02-155-94/+12
| | | | | | Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Ahelenia Ziemiańska <[email protected]> Closes #12901
* module: icp: rip out modhash. Replace the one user with AVLнаб2022-02-158-1271/+39
| | | | | | Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Ahelenia Ziemiańska <[email protected]> Closes #12901
* module: icp: remove unused me_mutexнаб2022-02-154-24/+1
| | | | | | | | It only needs to be locked if dynamic changes can occur. They can't. Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Ahelenia Ziemiańska <[email protected]> Closes #12901
* module: icp: remove unused me_thresholdнаб2022-02-152-94/+21
| | | | | | Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Ahelenia Ziemiańska <[email protected]> Closes #12901
* module: icp: remove unused struct crypto_ctx::cc_{session,flags,opstate}наб2022-02-154-37/+5
| | | | | | Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Ahelenia Ziemiańska <[email protected]> Closes #12901
* module: icp: remove unused gswq, kcfpool, [as]req_cache, reqid_table, ↵наб2022-02-153-464/+0
| | | | | | | | obsolete kstat Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Ahelenia Ziemiańska <[email protected]> Closes #12901
* module: icp: remove unused notification frameworkнаб2022-02-158-237/+25
| | | | | | Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Ahelenia Ziemiańska <[email protected]> Closes #12901
* module: icp: remove unused kcf_op_{group,type}, req_params, ...наб2022-02-157-897/+0
| | | | | | Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Ahelenia Ziemiańska <[email protected]> Closes #12901
* module: icp: remove unused p[di]_flagsнаб2022-02-154-47/+1
| | | | | | Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Ahelenia Ziemiańska <[email protected]> Closes #12901
* module: icp: remove unused CRYPTO_{NOTIFY_OPDONE,SKIP_REQID,RESTRICTED}наб2022-02-156-29/+9
| | | | | | Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Ahelenia Ziemiańska <[email protected]> Closes #12901
* module: icp: remove unused CRYPTO_ALWAYS_QUEUEнаб2022-02-157-357/+42
| | | | | | Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Ahelenia Ziemiańska <[email protected]> Closes #12901
* module: icp: remove unused kcf_digest.cнаб2022-02-154-384/+0
| | | | | | Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Ahelenia Ziemiańska <[email protected]> Closes #12901
* module: icp: drop software provider generation numbersнаб2022-02-155-84/+10
| | | | | | | | We register all providers at once, before anything happens Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Ahelenia Ziemiańska <[email protected]> Closes #12901
* module: icp: remove unused kcf_mac operationsнаб2022-02-152-52/+2
| | | | | | Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Ahelenia Ziemiańska <[email protected]> Closes #12901
* module: icp: remove unused kcf_cipher operationsнаб2022-02-152-544/+3
| | | | | | Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Ahelenia Ziemiańska <[email protected]> Closes #12901
* module: icp: remove other provider typesнаб2022-02-1521-1423/+237
| | | | | | Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Ahelenia Ziemiańska <[email protected]> Closes #12901
* module: icp: use original mechanismsнаб2022-02-155-20/+11
| | | | | | Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Ahelenia Ziemiańska <[email protected]> Closes #12901
* module: icp: use original descriptionнаб2022-02-154-37/+3
| | | | | | Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Ahelenia Ziemiańska <[email protected]> Closes #12901
* module: icp: guarantee the ops vector is persistentнаб2022-02-152-80/+4
| | | | | | Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Ahelenia Ziemiańska <[email protected]> Closes #12901
* module: icp: have a static 8 providersнаб2022-02-151-14/+3
| | | | | | | | | | | | | This is currently twice the amount we actually have (sha[12], skein, aes), and 512 * sizeof(void*) = 4096: 128x more than we need and a waste of most of a page in the kernel address space Plus, there's no need to actually allocate it dynamically: it's always got a static size. Put it in .data Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Ahelenia Ziemiańska <[email protected]> Closes #12901
* module: icp: spi: crypto_ops_t: remove unused op typesнаб2022-02-1517-3862/+74
| | | | | | Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Ahelenia Ziemiańska <[email protected]> Closes #12901
* module: icp: spi: flatten struct crypto_ops, crypto_provider_infoнаб2022-02-156-108/+19
| | | | | | Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Ahelenia Ziemiańska <[email protected]> Closes #12901
* module: icp: spi: remove crypto_control_ops_tнаб2022-02-157-93/+0
| | | | | | Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Ahelenia Ziemiańska <[email protected]> Closes #12901
* module: icp: spi: remove crypto_{provider,op}_notification()наб2022-02-153-139/+0
| | | | | | Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Ahelenia Ziemiańska <[email protected]> Closes #12901
* Add spa _os() hooksJorgen Lundman2022-02-155-0/+88
| | | | | | | | | | | Add hooks for when spa is created, exported, activated and deactivated. Used by macOS to attach iokit, and lock kext as busy (to stop unloads). Userland, Linux, and, FreeBSD have empty stubs. Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Jorgen Lundman <[email protected]> Closes #12801
* Avoid dirtying the final TXGs when exporting a poolGeorge Amanakis2022-02-151-17/+43
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There are two codepaths than can dirty final TXGs: 1) If calling spa_export_common()->spa_unload()-> spa_unload_log_sm_flush_all() after the spa_final_txg is set, then spa_sync()->spa_flush_metaslabs() may end up dirtying the final TXGs. Then we have the following panic: Call Trace: <TASK> dump_stack_lvl+0x46/0x62 spl_panic+0xea/0x102 [spl] dbuf_dirty+0xcd6/0x11b0 [zfs] zap_lockdir_impl+0x321/0x590 [zfs] zap_lockdir+0xed/0x150 [zfs] zap_update+0x69/0x250 [zfs] feature_sync+0x5f/0x190 [zfs] space_map_alloc+0x83/0xc0 [zfs] spa_generate_syncing_log_sm+0x10b/0x2f0 [zfs] spa_flush_metaslabs+0xb2/0x350 [zfs] spa_sync_iterate_to_convergence+0x15a/0x320 [zfs] spa_sync+0x2e0/0x840 [zfs] txg_sync_thread+0x2b1/0x3f0 [zfs] thread_generic_wrapper+0x62/0xa0 [spl] kthread+0x127/0x150 ret_from_fork+0x22/0x30 </TASK> 2) Calling vdev_*_stop_all() for a second time in spa_unload() after spa_export_common() unnecessarily delays the final TXGs beyond what spa_final_txg is set at. Fix this by performing the check and call for spa_unload_log_sm_flush_all() before the spa_final_txg is set in spa_export_common(). Also check if the spa_final_txg has already been set in spa_unload() and skip those calls in this case. Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: George Amanakis <[email protected]> External-issue: https://www.illumos.org/issues/9081 Closes #13048 Closes #13098
* Rename fallthrough to zfs_fallthroughJorgen Lundman2022-02-1529-44/+44
| | | | | | | | Unfortunately macOS has obj-C keyword "fallthrough" in the OS headers. Reviewed-by: Brian Behlendorf <[email protected]> Reviewed-by: Damian Szuberski <[email protected]> Signed-off-by: Jorgen Lundman <[email protected]> Closes #13097