summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* zfs label bootenv should store data as nvlistToomas Soome2020-09-1529-67/+885
| | | | | | | | | | | | | nvlist does allow us to support different data types and systems. To encapsulate user data to/from nvlist, the libzfsbootenv library is provided. Reviewed-by: Arvind Sankar <[email protected]> Reviewed-by: Allan Jude <[email protected]> Reviewed-by: Paul Dagnelie <[email protected]> Reviewed-by: Igor Kozhukhov <[email protected]> Signed-off-by: Toomas Soome <[email protected]> Closes #10774
* Linux: Prevent destruction while showing mount devnameRyan Moeller2020-09-151-0/+2
| | | | | | | | | Use ZFS_ENTER and ZFS_EXIT to protect datasets while their mount devname is being retrieved. Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Ryan Moeller <[email protected]> Closes #10892 Closes #10927
* Add L2ARC arcstats for MFU/MRU buffers and buffer content typeGeorge Amanakis2020-09-1426-71/+656
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently the ARC state (MFU/MRU) of cached L2ARC buffer and their content type is unknown. Knowing this information may prove beneficial in adjusting the L2ARC caching policy. This commit adds L2ARC arcstats that display the aligned size (in bytes) of L2ARC buffers according to their content type (data/metadata) and according to their ARC state (MRU/MFU or prefetch). It also expands the existing evict_l2_eligible arcstat to differentiate between MFU and MRU buffers. L2ARC caches buffers from the MRU and MFU lists of ARC. Upon caching a buffer, its ARC state (MRU/MFU) is stored in the L2 header (b_arcs_state). The l2_m{f,r}u_asize arcstats reflect the aligned size (in bytes) of L2ARC buffers according to their ARC state (based on b_arcs_state). We also account for the case where an L2ARC and ARC cached MRU or MRU_ghost buffer transitions to MFU. The l2_prefetch_asize reflects the alinged size (in bytes) of L2ARC buffers that were cached while they had the prefetch flag set in ARC. This is dynamically updated as the prefetch flag of L2ARC buffers changes. When buffers are evicted from ARC, if they are determined to be L2ARC eligible then their logical size is recorded in evict_l2_eligible_m{r,f}u arcstats according to their ARC state upon eviction. Persistent L2ARC: When committing an L2ARC buffer to a log block (L2ARC metadata) its b_arcs_state and prefetch flag is also stored. If the buffer changes its arcstate or prefetch flag this is reflected in the above arcstats. However, the L2ARC metadata cannot currently be updated to reflect this change. Example: L2ARC caches an MRU buffer. L2ARC metadata and arcstats count this as an MRU buffer. The buffer transitions to MFU. The arcstats are updated to reflect this. Upon pool re-import or on/offlining the L2ARC device the arcstats are cleared and the buffer will now be counted as an MRU buffer, as the L2ARC metadata were not updated. Bug fix: - If l2arc_noprefetch is set, arc_read_done clears the L2CACHE flag of an ARC buffer. However, prefetches may be issued in a way that arc_read_done() is bypassed. Instead, move the related code in l2arc_write_eligible() to account for those cases too. Also add a test and update manpages for l2arc_mfuonly module parameter, and update the manpages and code comments for l2arc_noprefetch. Move persist_l2arc tests to l2arc. Reviewed-by: Ryan Moeller <[email protected]> Reviewed-by: Richard Elling <[email protected]> Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: George Amanakis <[email protected]> Closes #10743
* config/zfs-build.m4: never define _initramfs in RPM_DEFINE_UTILHarald van Dijk2020-09-123-6/+17
| | | | | | | | | | | | | | | | | | | The zfs-initramfs package has never worked as no RPM-based distribution uses initramfs-tools, which is listed as a dependency of zfs-initramfs. This would not ordinarily be a problem, as it is only enabled when /usr/share/initramfs-tools is present, which should not normally be the case on RPM-based distributions. However, other packages may install unused files there even if initramfs-tools is not used, so remove this auto-detection for the rpm-utils target. This does not fully remove the logic for the zfs-initramfs package. This splits it out into a separate rpm-utils-initramfs target so that the Debian builds can still use it. Reviewed-by: Kjeld Schouten <[email protected]> Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Harald van Dijk <[email protected]> Closes #10898
* libzutil depends on libnvpairMatthew Ahrens2020-09-122-2/+7
| | | | | | | | | | | | libzutil depends on libnvpair, but this dependency is undeclared in the build system. Therefore it isn't possible to make a new command that depends on libzutil, but does not (directly) depend on libnvpair. This commit makes this dependency explicit. Reviewed-by: Brian Behlendorf <[email protected]> Reivewed-by: Ryan Moeller <[email protected]> Signed-off-by: Matthew Ahrens <[email protected]> Closes #10915
* FreeBSD: convert teardown inactive lock to a read-mostly sleepable lockMateusz Guzik2020-09-094-19/+82
| | | | | | | | | | | | | | | | | The lock is taken all the time and as a regular read-write lock avoidably serves as a mount point-wide contention point. This forward ports FreeBSD revision r357322. To quote aforementioned commit: Sample result doing an incremental -j 40 build: before: 173.30s user 458.97s system 2595% cpu 24.358 total after: 168.58s user 254.92s system 2211% cpu 19.147 total Reviewed-by: Alexander Motin <[email protected]> Reviewed-by: Ryan Moeller <[email protected]> Signed-off-by: Mateusz Guzik <[email protected]> Closes #10896
* Force the use of '.' as decimal separator.xdch472020-09-093-0/+3
| | | | | | | | | This solves issues occurring with a different decimal operator and keeps the command line interface consistent for all locales . E.g. `zfs set quota=0.5T` Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Felix Neumärker <[email protected]> Closes #10878
* Initialize mmp_last_write when the mmp thread startsOlaf Faaland2020-09-091-8/+12
| | | | | | | | | | | | | | | | | | | | | A great deal of time may go by between when mmp_init() is called and the MMP thread starts, particularly if there are bad devices, because there is I/O checking configs etc. If this time is too long, (gethrtime() - mmp_last_write) > mmp_fail_ns at the time the MMP thread starts. If MMP is configured to suspend the pool, the pool will be suspended immediately. This can be seen in issue #10838 The value of mmp_last_write doesn't matter before the mmp thread starts. To give the MMP thread time to issue and land MMP writes, initialize mmp_last_write when the MMP thread starts. Reviewed-by: Giuseppe Di Natale <[email protected]> Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Olaf Faaland <[email protected]> Closes #10873
* FreeBSD: drop dependency on cryptodev moduleRyan Moeller2020-09-091-1/+0
| | | | | | | | | We only need the kernel interfaces in crypto, not the device node in cryptodev. Reviewed-by: Alexander Motin <[email protected]> Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Ryan Moeller <[email protected]> Closes #10901
* Introduce ZFS module parameter l2arc_mfuonlyGeorge Amanakis2020-09-082-0/+34
| | | | | | | | | | | In certain workloads it may be beneficial to reduce wear of L2ARC devices by not caching MRU metadata and data into L2ARC. This commit introduces a new tunable l2arc_mfuonly for this purpose. Reviewed-by: Matthew Ahrens <[email protected]> Reviewed-by: Richard Elling <[email protected]> Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: George Amanakis <[email protected]> Closes #10710
* Avoid possibility of division by zeroRyan Moeller2020-09-082-4/+4
| | | | | | | | | | | When hz > 1000, msec / (1000 / hz) results in division by zero. I found somewhere in FreeBSD using howmany(msec * hz, 1000) to convert ms to ticks, avoiding the potential for a zero in the divisor. Reviewed-by: Alexander Motin <[email protected]> Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Ryan Moeller <[email protected]> Closes #10894
* dnode_special_open() error: unchecked function return 'zrl_tryenter'Toomas Soome2020-09-081-1/+1
| | | | | Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Toomas Soome <[email protected]> Closes #10876
* Add a missing option prefix `-` in zfs-tests.sh usage()Peter Dave Hello2020-09-081-1/+1
| | | | | | Reviewed-by: Giuseppe Di Natale <[email protected]> Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Peter Dave Hello <[email protected]> Closes #10893
* Display pbkdf2iters property as plain numberFabio Buso2020-09-081-2/+3
| | | | | | | | | The pbkdf2iters property is an iteration counter and should be displayed as plain number rather than in binary unit. Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Fabio Buso <[email protected]> Closes #10871
* libshare: Add missing headers for nfs.calaviss2020-09-041-0/+1
| | | | | | | | | | On musl libc, zfs failed to compile due to the missing <fcntl.h> include, which is required for `open()` per POSIX. This commit add the missing <fcntl.h> include. Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Hiếu Lê <[email protected]> Closes #10880
* FreeBSD: reduce priority of ZIO_TASKQ_ISSUE writes by a larger valueMatthew Macy2020-09-041-5/+17
| | | | | | | | | | On FreeBSD, if priorities divided by four (RQ_PPQ) are equal then a difference between them is insignificant. In other words, incrementing pri by only one as on Linux is insufficient. Reviewed-by: Alexander Motin <[email protected]> Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Matt Macy <[email protected]> Closes #10872
* Spruce up pkg-config files for libzfs/libzfs_coreRyan Moeller2020-09-043-4/+9
| | | | | | | | | | | | Several of the listed library dependencies are not relevant on FreeBSD. Have ./configure save libraries that are found via pkg-config as ${LIB}_PC and use the configured automake variables instead of hard coded names so we only get what was actually needed. While here, update the URL to point at the OpenZFS Github repo. Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Ryan Moeller <[email protected]> Closes #10869
* man: Cross-reference zfs-load-key(8) for ENCRYPTION mentionRyan Moeller2020-09-041-3/+4
| | | | | | | | Reviewed-by: George Melikov <[email protected]> Reviewed-by: Brian Behlendorf <[email protected]> Submitted-by: Harry Schmalzbauer Signed-off-by: Ryan Moeller <[email protected]> Closes #10866
* man: Add `zfs rename -r` to zfs-rename(8) SYNOPSISRyan Moeller2020-09-041-3/+6
| | | | | | | Reviewed-by: George Melikov <[email protected]> Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Ryan Moeller <[email protected]> Closes #10866
* Sequential scrub and resilver updated commentsBrian Behlendorf2020-09-043-0/+3
| | | | | | | | Commit d4a72f2 which introduced multi-phase scrubs and resilvers continued the work presented by Nexenta at the 2016 ZFS developer summit. Update the source to reflect their contribution. Signed-off-by: Brian Behlendorf <[email protected]>
* Avoid posting duplicate zpool eventsDon Brady2020-09-0422-79/+799
| | | | | | | | | | | | | | | | | | | Duplicate io and checksum ereport events can misrepresent that things are worse than they seem. Ideally the zpool events and the corresponding vdev stat error counts in a zpool status should be for unique errors -- not the same error being counted over and over. This can be demonstrated in a simple example. With a single bad block in a datafile and just 5 reads of the file we end up with a degraded vdev, even though there is only one unique error in the pool. The proposed solution to the above issue, is to eliminate duplicates when posting events and when updating vdev error stats. We now save recent error events of interest when posting events so that we can easily check for duplicates when posting an error. Reviewed by: Brad Lewis <[email protected]> Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Don Brady <[email protected]> Closes #10861
* nowait synctask must succeedMatthew Ahrens2020-09-0410-41/+26
| | | | | | | | | | | | | | If a `zfs_space_check_t` other than `ZFS_SPACE_CHECK_NONE` is used with `dsl_sync_task_nowait()`, the sync task may fail due to ENOSPC. However, there is no way to notice or communicate this failure, so it's extremely difficult to use this functionality correctly, and in fact almost all callers use `ZFS_SPACE_CHECK_NONE`. This commit removes the `zfs_space_check_t` argument from `dsl_sync_task_nowait()`, and always uses `ZFS_SPACE_CHECK_NONE`. Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Matthew Ahrens <[email protected]> Closes #10855
* Retain thread name when resuming a zthrRyan Moeller2020-09-031-3/+8
| | | | | | | | | | | | When created, a zthr is given a name to identify it by. This name is lost when a cancelled zthr is resumed. Retain the name of a zthr so it can be used when resuming. Reviewed-by: Serapheim Dimitropoulos <[email protected]> Reviewed-by: Alexander Motin <[email protected]> Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Ryan Moeller <[email protected]> Closes #10881
* Fixes for running FreeBSD buildworld on Linux/macOS hostsAlexander Richardson2020-09-032-1/+7
| | | | | | | | | | | Adding an #ifdef __FreeBSD__ to a FreeBSD-specific header may seem odd, but these headers are used on non-FreeBSD systems during the bootstrap tools phase. Originally submitted downstream as https://reviews.freebsd.org/D26193 Reviewed-by: Ryan Moeller <[email protected]> Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Alex Richardson <[email protected]> Closes #10863
* Replace cv_{timed}wait_sig with cv_{timed}wait_idle where appropriateMatthew Macy2020-09-0311-25/+73
| | | | | | | | | | | | | | | | There are a number of places where cv_?_sig is used simply for accounting purposes but the surrounding code has no ability to cope with actually receiving a signal. On FreeBSD it is possible to send signals to individual kernel threads so this could enable undesirable behavior. This patch adds routines on Linux that will do the same idle accounting as _sig without making the task interruptible. On FreeBSD cv_*_idle are all aliases for cv_* Reviewed-by: Alexander Motin <[email protected]> Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Matt Macy <[email protected]> Closes #10843
* Remove 'ZFS on Linux' references from PR TemplateGarrett Fields2020-09-031-4/+4
| | | | | | | | | | | As mentioned in the #OpenZFS IRC channel (thanks "Toomas Soome"): The OpenZFS PR Template still mentions "ZFS on Linux". This changes that reference and updates the URLs. Reviewed-by: Ryan Moeller <[email protected]> Reviewed-by: George Melikov <[email protected]> Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Garrett Fields <[email protected]> Closes #10868
* Links in Source FilesSpencer Kinny2020-09-024-0/+20
| | | | | | | | | | | | | | | Added comments in following files with links to Illumos manual pages: ./module/avl/avl.c ./module/nvpair/nvpair.c ./module/os/linux/spl/spl-kstat.c ./module/os/freebsd/spl/spl_kstat.c Reviewed-by: Ryan Moeller <[email protected]> Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Spencer Kinny <[email protected]> Closes #5113 Closes #10859
* zvol: unsigned off can not be less than zeroToomas Soome2020-09-021-1/+1
| | | | | | | Reviewed-by: Richard Elling <[email protected]> Reviewed-by: Brian Behlendorf <[email protected]> Reviewed-by: Ryan Moeller <[email protected]> Signed-off-by: Toomas Soome <[email protected]> Closes #10867
* Fix -Werror,-Wmacro-redefined in limits.hAlexander Richardson2020-09-011-0/+5
| | | | | | | | | | | Those macros are also defined by the compiler-provided float.h which will be included later on (at least in the FreeBSD buildworld case) and triggers these -Werror warnings. Including <float.h> first and only defining the macros when DBL_DIG/FLT_DIG is missing fixes this problem. Reviewed-by: Ryan Moeller <[email protected]> Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Alex Richardson <[email protected]> Closes #10864
* Make spa_stats.c tunables visible on FreeBSDRyan Moeller2020-09-012-20/+14
| | | | | | | | Use ZFS_MODULE_PARAM for cross-platform tunables in spa_stats.c, and add update tunables.cfg in tests for the newly supported ones. Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Ryan Moeller <[email protected]> Closes #10858
* FreeBSD: Fix up after spa_stats.c moveMatthew Macy2020-09-012-61/+116
| | | | | | | | | | | | | | Moving spa_stats added the additional burden of supporting KSTAT_TYPE_IO. spa_state_addr will always return a valid value regardless of the value of 'n'. On FreeBSD this will cause an infinite loop as it relies on the raw ops addr routine to indicate that there is no more data. Reviewed-by: Brian Behlendorf <[email protected]> Reviewed-by: Ryan Moeller <[email protected]> Signed-off-by: Matt Macy <[email protected]> Closes #10860
* Add 'zfs rename -u' to rename without remountingRyan Moeller2020-09-0121-39/+284
| | | | | | | | | | | | | | | | | | | | | | | | | | | Allow to rename file systems without remounting if it is possible. It is possible for file systems with 'mountpoint' property set to 'legacy' or 'none' - we don't have to change mount directory for them. Currently such file systems are unmounted on rename and not even mounted back. This introduces layering violation, as we need to update 'f_mntfromname' field in statfs structure related to mountpoint (for the dataset we are renaming and all its children). In my opinion it is worth it, as it allow to update FreeBSD in even cleaner way - in ZFS-only configuration root file system is ZFS file system with 'mountpoint' property set to 'legacy'. If root dataset is named system/rootfs, we can snapshot it (system/rootfs@upgrade), clone it (system/oldrootfs), update FreeBSD and if it doesn't boot we can boot back from system/oldrootfs and rename it back to system/rootfs while it is mounted as /. Before it was not possible, because unmounting / was not possible. Authored by: Pawel Jakub Dawidek <[email protected]> Reviewed-by: Allan Jude <[email protected]> Reviewed-by: Brian Behlendorf <[email protected]> Ported by: Matt Macy <[email protected]> Signed-off-by: Ryan Moeller <[email protected]> Closes #10839
* FreeBSD: Remove unused SECLABEL codeRyan Moeller2020-08-311-193/+0
| | | | | | | SECLABEL is undefined on FreeBSD and should be pruned. Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Ryan Moeller <[email protected]> Closes #10847
* libspl: Provide platform-specific zone implementationsRyan Moeller2020-08-314-43/+50
| | | | | | | | | | | | | | | | | FreeBSD has the concept of jails, a precursor to Solaris's zones, which can be mapped to the required zones interface with relative ease. The previous ZFS implementation in FreeBSD did so, and we should continue to provide an appropriate implementation in OpenZFS as well. Move lib/libspl/zone.c into platform code and adopt the correct implementation for FreeBSD. While here, prune unused code. Reviewed-by: Alexander Motin <[email protected]> Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Ryan Moeller <[email protected]> Closes #10851
* FreeBSD: Simplify INGLOBALZONERyan Moeller2020-08-312-11/+4
| | | | | | | | | | | | | | | | | FreeBSD's previous ZFS implemented INGLOBALZONE(thread) as (!jailed((thread)->td_ucred)) and passed curthread to INGLOBALZONE. We pass curproc instead of curthread, so we can achieve the same effect with (!jailed((proc)->p_ucred)). The implementation is trivial enough to fit on a single line in a define. We don't really need a whole separate function for something that's already macros all the way down. Eliminate in_globalzone. Reviewed-by: Alexander Motin <[email protected]> Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Ryan Moeller <[email protected]> Closes #10851
* FreeBSD: Define crgetzoneid appropriatelyRyan Moeller2020-08-311-1/+1
| | | | | | | | | | | The previous ZFS implementation on FreeBSD had ifdefs to use jailed() instead of crgetzoneid() in dsl_dir.c, however we can simply provide an appropriate definition of crgetzoneid for the same effect. Reviewed-by: Alexander Motin <[email protected]> Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Ryan Moeller <[email protected]> Closes #10851
* zio_ereport_post() and zio_ereport_start() return values are ignoredToomas Soome2020-08-318-20/+24
| | | | | | | | use (void) to silence analyzers. Reviewed-by: Ryan Moeller <[email protected]> Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Toomas Soome <[email protected]> Closes #10857
* Typo CorrectionSpencer Kinny2020-08-301-1/+1
| | | | | | | | | | Corrected the typo in zfs/cmd/zfs/zfs_main.c line number 404 pbkfd2iters to pbkdf2iters Reviewed-by: Ryan Moeller <[email protected]> Reviewed-by: George Melikov <[email protected]> Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Spencer Kinny <[email protected]> Closes #10850
* Move spa_stats.c to common codeMatthew Macy2020-08-304-115/+1
| | | | | | | | | | | Initially it was considered simplest to stub out all of the functions on FreeBSD. Now that FreeBSD supports KSTAT_TYPE_RAW at least some of the functionality should be made available. Reviewed-by: Brian Behlendorf <[email protected]> Reviewed-by: Richard Elling <[email protected]> Signed-off-by: Matt Macy <[email protected]> Closes #10842
* FreeBSD: Fix spurious failure in zvol_geom_openMatthew Macy2020-08-301-0/+20
| | | | | | | | | | In zvol_geom_open on first open we need to guarantee that the namespace lock is held to avoid spurious failures in zvol_first_open. Reviewed-by: Brian Behlendorf <[email protected]> Reviewed-by: Ryan Moeller <[email protected]> Signed-off-by: Matt Macy <[email protected]> Closes #10841
* Auto close "Status: Feedback requested" after a monthKjeld Schouten-Lebbing2020-08-301-0/+13
| | | | | | | | | | | | This commit closes issues labeled with: "Status: Feedback requested" after 1 month, if the label is not removed or the author has not responded Reviewed-by: George Melikov <[email protected]> Reviewed-by: Brian Behlendorf <[email protected]> Reviewed-by: Richard Laager <[email protected]> Signed-off-by: Kjeld Schouten-Lebbing <[email protected]> Closes #10807 Closes #10808
* FreeBSD: add support for KSTAT_TYPE_RAWMatthew Macy2020-08-291-17/+128
| | | | | | | | | | | A few kstats use KSTAT_TYPE_RAW to provide a string generated on demand. Implementing these as sysctls was punted until now. Reviewed by: Toomas Soome <[email protected]> Reviewed-by: Allan Jude <[email protected]> Reviewed-by: Ryan Moeller <[email protected]> Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Matt Macy <[email protected]> Closes #10836
* Linux 5.9 compat: NR_SLAB_RECLAIMABLEBrian Behlendorf2020-08-294-47/+1
| | | | | | | | | | | | | | | | | | | Commit dcdc12e added compatibility code to treat NR_SLAB_RECLAIMABLE_B as if it were the same as NR_SLAB_RECLAIMABLE. However, the new value is in bytes while the old value was in pages which means they are not interchangeable. The only place the reclaimable slab size is used is as a component of the calculation done by arc_free_memory(). This function returns the amount of memory the ARC considers to be free or reclaimable at little cost. Rather than switch to a new interface to get this value it has been removed it from the calculation. It is normally a minor component compared to the number of inactive or free pages, and removing it aligns the behavior with the FreeBSD version of arc_free_memory(). Reviewed-by: Matthew Ahrens <[email protected]> Reviewed-by: Coleman Kane <[email protected]> Signed-off-by: Brian Behlendorf <[email protected]> Closes #10834
* Fix another dependency loopRichard Laager2020-08-281-0/+4
| | | | | | | | | | | | | | | | | | zfs-load-key-DATASET.service was gaining an After=systemd-journald.socket due to its stdout/stderr going to the journal (which is the default). systemd-journald.socket has an After (via RequiresMountsFor=/run/systemd/journal) on -.mount. If the root filesystem is encrypted, -.mount gets an After zfs-load-key-DATASET.service. By setting stdout and stderr to null on the key load services, we avoid this loop. Reviewed-by: Antonio Russo <[email protected]> Reviewed-by: InsanePrawn <[email protected]> Signed-off-by: Richard Laager <[email protected]> Closes #10356 Closes #10388
* Fix a dependency loopRichard Laager2020-08-282-7/+25
| | | | | | | | | | | | | | | | | When generating units with zfs-mount-generator, if the pool is already imported, zfs-import.target is not needed. This avoids a dependency loop on root-on-ZFS systems: systemd-random-seed.service After (via RequiresMountsFor) var-lib.mount After zfs-import.target After zfs-import-{cache,scan}.service After cryptsetup.service After systemd-random-seed.service Reviewed-by: Antonio Russo <[email protected]> Reviewed-by: InsanePrawn <[email protected]> Signed-off-by: Richard Laager <[email protected]> Closes #10388
* config/zfs-build.m4: add --with-vendor flagGeorgy Yakovlev2020-08-281-27/+37
| | | | | | | | | | | | | | | | | | | | This will allow an override of auto-detection of distribution, which is based on checking presence of /etc/*-release files. Build systems makes a lot of file location assumptions based on detected distribution. Some distributions (like gentoo) may prefer explicitly setting --with-vendor=gentoo to avoid auto-detection. Since auto-detection checks all files in order, current script may misdetect even on gentoo system if /etc/redhat-release file is present Default behavior is unchanged and default is --with-vendor=check Reviewed-by: Ryan Moeller <[email protected]> Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Georgy Yakovlev <[email protected]> Closes #10835
* Fix definition of BLKGETSIZE64 on FreeBSDAlexander Richardson2020-08-271-5/+1
| | | | | | | | | The matching ioctl is DIOCGMEDIASIZE. Reviewed-by: Alexander Motin <[email protected]> Reviewed-by: Brian Behlendorf <[email protected]> Reviewed-by: Ryan Moeller <[email protected]> Signed-off-by: Alex Richardson <[email protected]> Closes #10818
* module/zstd: pass -U__BMI__Georgy Yakovlev2020-08-272-1/+4
| | | | | | | | | | | | | | If kernel is compiled with -march=znver1 or -march=znver2 zstd module compilation will fail due to SSE register return with SSE disabled. What's interesting, is that -march=skylake also implies -mbmi which defines __BMI__ but compilation succeeds. It is probably due to different BMI implementations on AMD and INTEL processors and the way compiler uses instructions. Reviewed-by: Ryan Moeller <[email protected]> Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Georgy Yakovlev <[email protected]> Closes #10758 Closes #10829
* Add the Xr's to the SEE ALSO as wellJohn-Mark Gurney2020-08-262-3/+70
| | | | | | | | | | | | | There are a ton of zfs-* and zpool-* man pages. This adds them to the SEE ALSO section so that people can more quickly look through what all the options are, now that the pages have been split. Reviewed-by: Richard Laager <[email protected]> Reviewed-by: Ryan Moeller <[email protected]> Reviewed-by: George Melikov <[email protected]> Reviewed-by: Brian Behlendorf <[email protected]> Reviewed-by: Allan Jude <[email protected]> Signed-off-by: John-Mark Gurney <[email protected]> Closes #10589
* dnode_sync is careless with range treePatrick Mooney2020-08-261-2/+12
| | | | | | | | | | | | | | Because dnode_sync_free_range() must drop dn_mtx during its processing, using it as a callback to range_tree_vacate() is not safe. No other operations (besides destroy) are allowed once range_tree_vacate() has begun, and dropping dn_mtx would leave a window open for another thread to observe that invalid (and unsafe) state via dnode_block_freed(). Reviewed-by: Matthew Ahrens <[email protected]> Reviewed-by: Brian Behlendorf <[email protected]> Reviewed-by: Igor Kozhukhov <[email protected]> Signed-off-by: Patrick Mooney <[email protected]> Closes #10708 Closes #10823