aboutsummaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* 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
* libzfs: sendrecv: fix missing error output for invalid propertiesнаб2022-02-141-3/+2
| | | | | | | | | | | | Fixes: 7633c0aedd20f48646409b16b0e4524da24f7f9a ("libzfs: sendrecv: fix unused, remove argsused") Reviewed-by: Brian Behlendorf <[email protected]> Reviewed-by: George Amanakis <[email protected]> Reviewed-by: Ryan Moeller <[email protected]> Signed-off-by: Ahelenia Ziemiańska <[email protected]> Closes #13100 Closes #13101
* zfs-receive.8: properly unlight = in option settingнаб2022-02-141-1/+1
| | | | | | | | Reviewed-by: Brian Behlendorf <[email protected]> Reviewed-by: George Amanakis <[email protected]> Reviewed-by: Ryan Moeller <[email protected]> Signed-off-by: Ahelenia Ziemiańska <[email protected]> Closes #13101
* zfs-receive.8: fix Op Fl x Ar encryption in running textнаб2022-02-141-1/+1
| | | | | | | | Reviewed-by: Brian Behlendorf <[email protected]> Reviewed-by: George Amanakis <[email protected]> Reviewed-by: Ryan Moeller <[email protected]> Signed-off-by: Ahelenia Ziemiańska <[email protected]> Closes #13101
* Silence uninitialized warnings in dsl_dataset.cRich Ercolani2022-02-141-6/+6
| | | | | | | | On newer compilers, dsl_dataset.c now warns (or, on DEBUG, errors) on uninitialized variable usage. Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Rich Ercolani <[email protected]> Closes #13083
* ZTS: Fix checkpoint_ro_rewind.kshBrian Behlendorf2022-02-131-2/+2
| | | | | | | | | | Related to commit 90b77a036. Retry the `zpool export` if the pool is "busy" indicating there is a process accessing the mount point. This can happen after an import and allowing it to be retried will avoid spurious test failures. Reviewed by: George Melikov <[email protected]> Signed-off-by: Brian Behlendorf <[email protected]> Closes #13092
* ZTS: Fix zpool_expand_001_posBrian Behlendorf2022-02-132-4/+2
| | | | | | | | | | | | | | | | | The dRAID section of the zpool_expand_001_pos test would reliably fail because the calculated expansion size assumed the dRAID top-level vdev was created with a distributed spare. Create the vdev as expected to resolve the test failure. This test case flaw was accidentally caused by changing the default number of dRAID distributed spares from one to zero while dRAID was being developed. Additionally, remove zpool_expand_005_pos from the list of possible faulty tests. It appears to be passing consistently in my testing. Reviewed by: George Melikov <[email protected]> Signed-off-by: Brian Behlendorf <[email protected]> Closes #13091
* Fix gcc warning in kfpu_begin()Brian Behlendorf2022-02-111-3/+2
| | | | | | | | | | | | Observed when building on CentOS 8 Stream. Remove the `out` label at the end of the function and instead return. linux/simd_x86.h: In function 'kfpu_begin': linux/simd_x86.h:337:1: error: label at end of compound statement Reviewed-by: Tony Hutter <[email protected]> Reviewed-by: Attila Fülöp <[email protected]> Signed-off-by: Brian Behlendorf <[email protected]> Closes #13089
* ZTS: Fix problem with zdb_objset_id testPaul Zuchowski2022-02-111-14/+16
| | | | | | | | | Use large numbers for datasets with numeric names to avoid name and id collisions. Sporadic test failures were observed when the test would create $TESTPOOL/100 with an objset ID of 100. Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Paul Zuchowski <[email protected]> Closes #13087
* zpool-import.8: WARNING should be emphasisedнаб2022-02-111-1/+2
| | | | | | | Reviewed-by: George Melikov <[email protected]> Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Ahelenia Ziemiańska <[email protected]> Closes #13082
* zpool-import.8: newpool is Ar, not Syнаб2022-02-111-2/+2
| | | | | | | Reviewed-by: George Melikov <[email protected]> Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Ahelenia Ziemiańska <[email protected]> Closes #13082
* zpoolprops.7: document leakedнаб2022-02-111-0/+4
| | | | | | | | | | | | | | | | | | | | It's noted very scarcely in the code as it stands, indeed the only actual comment on this is /* * We have finished background destroying, but there is still * some space left in the dp_free_dir. Transfer this leaked * space to the dp_leak_dir. */ Introduced in fbeddd60b79690b6a6ececc9b00b6014d21405aa ("Illumos 4390 - I/O errors can corrupt space map when deleting fs/vol"), which explains, alongside the references, that this can only happen with a corrupted pool Reviewed-by: Brian Behlendorf <[email protected]> Reviewed-by: George Melikov <[email protected]> Signed-off-by: Ahelenia Ziemiańska <[email protected]> Closes #13081
* Correct a typo in zfs-receive.8Zhu Chuang2022-02-111-1/+1
| | | | | | | Should be `-o keyformat=passphrase` instead of `-o -keyformat=passphrase` Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Chuang Zhu <[email protected]> Closes #13072
* contrib: rename initrd READMEs to README.mdнаб2022-02-115-5/+4
| | | | | | | | It's an unhelpful naming scheme and one that breaks GitHub autoreadme. Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Ahelenia Ziemiańska <[email protected]> Closes #13017
* contrib: dracut: zfs-{rollback,snapshot}-bootfs: don't shell for testнаб2022-02-112-2/+2
| | | | | | Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Ahelenia Ziemiańska <[email protected]> Closes #13017
* dracut: README: rewriteнаб2022-02-111-225/+46
| | | | | | | | | | The documentation in the dracut README has grown stale and inaccurate. Remove the stale content and write a short and useful reference manual. Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Ahelenia Ziemiańska <[email protected]> Closes #13012 Closes #13017
* ZTS: Fix zvol_misc_volmode testBrian Behlendorf2022-02-091-18/+31
| | | | | | | | | | | | Changing volmode may need to remove minors, which could be open, so call udev_wait() before we "zfs set volmode=<value>". This ensures no udev process has the zvol open (i.e. blkid) and the kernel zvol_remove_minor_impl() function won't skip removing the in use device. Reviewed-by: John Kennedy <[email protected]> Reviewed-by: George Melikov <[email protected]> Signed-off-by: Brian Behlendorf <[email protected]> Closes #13075
* Add dataset_kstats_update.. to mmap read/write pathsdrowfx2022-02-092-0/+10
| | | | | | | | | | | This allows reads/writes caused by accesses to mmap files to be accounted correctly in the per-dataset kstats for both Linux and FreeBSD. Reviewed-by: Brian Behlendorf <[email protected]> Reviewed-by: Ryan Moeller <[email protected]> Signed-off-by: Matthias Blankertz <[email protected]> Closes #12994 Closes #13044
* Receive checks should allow unencrypted child datasetsAttila Fülöp2022-02-095-7/+102
| | | | | | | | | | | | | | | | | | | | dmu_recv_begin_check() unconditionally sets the DS_HOLD_FLAG_DECRYPT flag before calling dsl_dataset_hold_flags(). If the key on the receiving side isn't loaded or the send stream contains embedded blocks, the receive check fails for a stream which is perfectly valid and could be received without any problem. This seems like a remnant of the initial design, where unencrypted datasets below encrypted ones weren't allowed. Add a condition to set `DS_HOLD_FLAG_DECRYPT` only for encrypted datasets, modify an existing test to detect this regression and add a test for raw replication streams. Reviewed-by: Brian Behlendorf <[email protected]> Reviewed-by: George Amanakis <[email protected]> Co-authored-by: George Amanakis <[email protected]> Signed-off-by: Attila Fülöp <[email protected]> Closes #13033 Closes #13076
* Rename EMPTY_TASKQ into taskq_emptyJorgen Lundman2022-02-095-11/+18
| | | | | | | | To follow a change in illumos taskq Reviewed-by: Brian Behlendorf <[email protected]> Reviewed-by: Tony Nguyen <[email protected]> Signed-off-by: Jorgen Lundman <[email protected]> Closes #12802
* Propagate KERNEL_* to *.specDamian Szuberski2022-02-093-2/+11
| | | | | | | Reviewed-by: Brian Behlendorf <[email protected]> Authored-by: Damian Szuberski <[email protected]> Signed-off-by: Peter Levine <[email protected]> Closes #13046
* Add support for $KERNEL_{CC,LD,LLVM} variablesPeter Levine2022-02-092-2/+10
| | | | | | | | | | | | | | | | | | Currently, $(CC), $(LD), and $(LLVM) variables aren't passed to kbuild while building modules. This causes modules to build with the default GNU GCC toolchain and prevents experimenting with other toolchains such as CLANG/LLVM. It can also lead to build failure if the CFLAGS/LDFLAGS passed are incompatible with gcc/ld. Pass $KERNEL_CC, $KERNEL_LD, and $KERNEL_LLVM as $(CC), $(LD), and $(LLVM), respectively, to kbuild for each that is defined in the environment. This should take care of the majority of alternative toolchain use cases. Reviewed-by: Damian Szuberski <[email protected]> Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Peter Levine <[email protected]> Closes #13046
* Linux 5.16 compat: don't use XSTATE_XSAVE to save FPU stateAttila Fülöp2022-02-099-6/+300
| | | | | | | | | | | | | | | | | | | | | | | | | | | Linux 5.16 moved XSTATE_XSAVE and XSTATE_XRESTORE out of our reach, so add our own XSAVE{,OPT,S} code and use it for Linux 5.16. Please note that this differs from previous behavior in that it won't handle exceptions created by XSAVE an XRSTOR. This is sensible for three reasons. - Exceptions during XSAVE and XRSTOR can only occur if the feature is not supported or enabled or the memory operand isn't aligned on a 64 byte boundary. If this happens something else went terribly wrong, and it may be better to stop execution. - Previously we just printed a warning and didn't handle the fault, this is arguable for the above reason. - All other *SAVE instruction also don't handle exceptions, so this at least aligns behavior. Finally add a test to catch such a regression in the future. Reviewed-by: Tony Hutter <[email protected]> Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Attila Fülöp <[email protected]> Closes #13042 Closes #13059
* Remove unused files from GitHub runnersDamian Szuberski2022-02-093-12/+32
| | | | | | | | | | | | | | | | | | | | | | | | Majority of the software installed by default in GitHub runners is irrelevant to OpenZFS. Reclaimed space could be used for more/bigger vdev files. File deletion happens in the background, leveraging `systemd-run` - the workflow is not significantly slowed down. Before ``` Filesystem Size Used Avail Use% Mounted on /dev/root 84G 53G 31G 63% / ``` After ``` Filesystem Size Used Avail Use% Mounted on /dev/root 84G 15G 70G 18% / ``` Reviewed-by: George Melikov <[email protected]> Reviewed-by: Brian Behlendorf <[email protected]> Reviewed-by: Ahelenia Ziemiańska <[email protected]> Signed-off-by: szubersk <[email protected]> Closes #13066
* `mount.zfs -o zfsutil` leverages `zfs_mount_at()`Damian Szuberski2022-02-081-13/+34
| | | | | | | | | | | | | | Using `zfs_mount_at()` gives opportunity to properly propagate mountopts from what's stored in a pool to the `mount(2)` syscall invocation. It fixes cases when mount options are set to incorrect values and rectification is impossible (e. g. Linux initrd boot sequence in #7947). Moved debug information printing after all variables are initialized - printed text reflects what is passed to `mount(2)`. Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: szubersk <[email protected]> Issue #7947 Closes #13021
* Remove unneeded "extern inline" function declarationsTomohiro Kusumi2022-02-086-15/+0
| | | | | | | | | All of these externs are already #included as static inline functions via corresponding headers. Reviewed-by: Igor Kozhukhov <[email protected]> Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Tomohiro Kusumi <[email protected]> Closes #13073
* Add `--enable=all` to ShellCheck by defaultDamian Szuberski2022-02-0721-25/+13
| | | | | | | | | | | Change enforced shell type from `dash` to `sh` and excluded `SC2039` and `SC3043` by default. `local` keyword is accepted by all POSIX shells from practical point of view. There is no need anymore to enforce dash so `local` is accepted. Reviewed-by: George Melikov <[email protected]> Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: szubersk <[email protected]> Closes #13020
* Extract workflows dependenciesDamian Szuberski2022-02-075-51/+96
| | | | | | | | | | | | | | | | | | | | - Move build dependencies moved to `.github/workflows/build-dependencies.txt` shared among workflows. - Change `ubuntu-latest` -> `ubuntu-20.04` to avoid unexpected runner environment updates in `zloop` workflow. - Change `ubuntu-20.04` -> `ubuntu-latest` to track changes in runner environment in `checkstyle` workflow. - Kernel buffer is flushed before ZTS invocation to avoid storing the same data after each test case run. - `make` is invoked with consistent set of options to reduce clutter in logs. Reviewed-by: George Melikov <[email protected]> Signed-off-by: szubersk <[email protected]> Closes #13037
* zvol: make calls to platform ops staticChristian Schwarz2022-02-074-97/+62
| | | | | | | | | | | | | | | | | | | | | There's no need to make the platform ops dynamic dispatch. This change replaces the dynamic dispatch with static calls to the platform-specific functions. To avoid name collisions, prefix all platform-specific functions with `zvol_os_`. I actually find `zvol_..._os` slightly nicer to read in the calling code, but having it as a prefix is useful. Advantage: - easier jump-to-definition / grepping - potential benefits to static analysis - better legibility Future work: also prefix remaining `static` functions in zvol_os.c. Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Christian Schwarz <[email protected]> Closes #12965
* Add more control/visibility to spa_load_verify().Alexander Motin2022-02-042-3/+18
| | | | | | | | | | | | | | | | | Use error thresholds from policy to control whether to scrub data and/or metadata. If threshold is set to UINT64_MAX, then caller probably does not care about result and we may skip that part. By default import neither set the data error threshold nor read the error counter, so skip the data scrub for faster import. Metadata are still scrubbed and fail if even single error found. While there just for symmetry return number of metadata errors in case threshold is not set to zero and we haven't reached it. Reviewed-by: Brian Behlendorf <[email protected]> Reviewed-by: Pavel Zakharov <[email protected]> Signed-off-by: Alexander Motin <[email protected]> Closes #13022
* zfs_set_prop_nvlist: make it easier to spot the call to dsl_props_setChristian Schwarz2022-02-041-37/+44
| | | | | Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Christian Schwarz <[email protected]> Closes #12963
* dsl_dir_tempreserve_impl: remove unused `deferred` variableChristian Schwarz2022-02-041-2/+1
| | | | | | | | | | | | | | | | The following commit moved the users of `deferred` into function dsl_pool_unreserved_space: commit d2734cce68cf740e015312314415f9034c67851c Author: Serapheim Dimitropoulos <[email protected]> Date: Fri Dec 16 14:11:29 2016 -0800 OpenZFS 9166 - zfs storage pool checkpoint Reviewed-by: Brian Behlendorf <[email protected]> Reviewed-by: Ryan Moeller <[email protected]> Reviewed-by: George Melikov <[email protected]> Signed-off-by: Christian Schwarz <[email protected]> Closes #13056
* ZTS: Update enospc_002_pos test caseBrian Behlendorf2022-02-042-4/+0
| | | | | | | | | | | The on-disk cost of creating a snapshot or bookmark is sufficiently low that it is difficult to make it reliably fail even when the pool is "full". In order to avoid false positives remove these two checks from the test case. Reviewed-by: George Melikov <[email protected]> Reviewed-by: John Kennedy <[email protected]> Signed-off-by: Brian Behlendorf <[email protected]> Closes #13060
* Fix clearing set-uid and set-gid bits on a file when replying a writePawel Jakub Dawidek2022-02-039-104/+261
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | POSIX requires that set-uid and set-gid bits to be removed when an unprivileged user writes to a file and ZFS does that during normal operation. The problem arrises when the write is stored in the ZIL and replayed. During replay we have no access to original credentials of the process doing the write, so zfs_write() will be performed with the root credentials. When root is doing the write set-uid and set-gid bits are not removed from the file. To correct that, log a separate TX_SETATTR entry that removed those bits on first write to such file. Idea from: Christian Schwarz Add test for ZIL replay of setuid/setgid clearing. Improve various edge cases when clearing setid bits: - The setid bits can be readded during a single write, so make sure to check for them on every chunk write. - Log TX_SETATTR record at most once per transaction group (if the setid bits are keep coming back). - Move zfs_log_setattr() outside of zp->z_acl_lock. Reviewed-by: Dan McDonald <[email protected]> Reviewed-by: Brian Behlendorf <[email protected]> Co-authored-by: Christian Schwarz <[email protected]> Signed-off-by: Pawel Jakub Dawidek <[email protected]> Closes #13027