summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* Mismatched nvlist names in zfs_keys_send_spaceJohn Poduska2020-10-023-8/+17
| | | | | | | | | | | | | | | This causes "zfs send -vt ..." to fail with: cannot resume send: Unknown error 1030 It turns out that some of the name/value pairs in the verification list for zfs_ioc_send_space(), zfs_keys_send_space, had the wrong name, so the ioctl got kicked out in zfs_check_input_nvpairs(). Update the names accordingly. Reviewed-by: Brian Behlendorf <[email protected]> Reviewed-by: Ryan Moeller <[email protected]> Signed-off-by: John Poduska <[email protected]> Closes #10978
* Fix buggy procfs_list_seq_next warningBrian Behlendorf2020-09-301-0/+12
| | | | | | | | | | | | | | | | | | | The kernel seq_read() helper function expects ->next() to update the passed position even there are no more entries. Failure to do so results in the following warning being logged. seq_file: buggy .next function procfs_list_seq_next [spl] did not update position index Functionally there is no issue with the way procfs_list_seq_next() is implemented and the warning is harmless. However, we want to silence this some what scary incorrect warning. This commit updates the Linux procfs code to advance the position even for the last entry. Reviewed-by: Tony Hutter <[email protected]> Signed-off-by: Brian Behlendorf <[email protected]> Closes #10984 Closes #10996
* FreeBSD: Fix legacy compat for platform IOCsRyan Moeller2020-09-301-1/+3
| | | | | | | | | | The request number is out of bounds of the platform table. Subtract the starting offset to get the correct subscript. Reviewed-by: Alexander Motin <[email protected]> Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Ryan Moeller <[email protected]> Closes #10994
* Eliminate gratuitous bzeroing in dbuf_stats_hash_table_dataMatthew Macy2020-09-301-1/+2
| | | | | | | | | | `dbuf_stats_hash_table_data` can take much longer than it needs to by repeatedly bzeroing its buffer when in fact the buffer only needs to be NULL terminated. Reviewed-by: Brian Behlendorf <[email protected]> Reviewed-by: Ryan Moeller <[email protected]> Signed-off-by: Matt Macy <[email protected]> Closes #10993
* do a cyclic seek for unused memory objects in poolSebastian Gottschall2020-09-303-2/+27
| | | | | | | | | | | | | | | | | | | | In non regular use cases allocated memory might stay persistent in memory pool. This small patch checks every minute if there are old objects which can be released from memory pool. Right now with regular use, the pool is checked for old objects on each allocation attempt from this pool. so basically polling by its use. Now consider what happens if someone writes a lot of files and stops use of the volume or even unmounts it. So the code will no longer check if objects can be released from the pool. Already allocated objects will still stay in pool cache. this is no big issue for common use. But someone discovered this issue while doing tests. personally i know this behavior and I'm aware of it. Its no big issue. just a enhancement Reviewed-by: Brian Behlendorf <[email protected]> Reviewed-by: Kjeld Schouten-Lebbing <[email protected]> Signed-off-by: Sebastian Gottschall <[email protected]> Closes #10938 Closes #10969
* Drop references when skipping dmu_send due to EXDEVRyan Moeller2020-09-3011-7/+216
| | | | | | | | | | | | | | When an invalid incremental send is requested where the "to" ds is before the "from" ds, make sure to drop the reference to the pool and the dataset before returning the error. Add an assert on FreeBSD to make sure we don't hold any locks after returning from an ioctl. Add some test coverage. Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Ryan Moeller <[email protected]> Closes #10919
* Add intel_QAT patchesKjeld Schouten-Lebbing2020-09-305-0/+129
| | | | | | | | | | | Add community compatibility patches for Intel QAT Due to incompatibility with higher kernel versions. Also includes basic instructions. Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Kjeld Schouten-Lebbing <[email protected]> Closes #10961 Closes #10962
* Use known license string for zzstdBrian Behlendorf2020-09-281-1/+1
| | | | | | | | | | | The Linux kernel MODULE_LICENSE macro only recognizes a handful of license strings and "BSD" is not one of the them. Update the macro to use "Dual BSD/GPL" which is recognized and what the kernel expects BSD licensed module to use. Reviewed-by: Kjeld Schouten <[email protected]> Signed-off-by: Brian Behlendorf <[email protected]> Closes #10982 Closes #10992
* Fix CONFIG_DEBUG_LOCK_ALLOC configure checkBrian Behlendorf2020-09-281-1/+1
| | | | | | | | | | This check was accidentally broken when the kABI checks were updated to run in parallel, commit 608f874. The check must be for the config_debug_lock_alloc_license name to determine if the symbol is license compatible. Reviewed-by: Tony Hutter <[email protected]> Signed-off-by: Brian Behlendorf <[email protected]> Closes #10991
* Fix objtool configure checkBrian Behlendorf2020-09-282-3/+5
| | | | | | | | | | | | | | | | | | | | | | The m4 objtool configure check can incorrectly fail because of a missing header in the test. This appears to be the result of a recent kernel change and was observed on the Fedora 5.8.11-200 kernel. In file included from /home/fedora/zfs/build/objtool/objtool.c:75: ./arch/x86/include/asm/frame.h:100:57: error: 'struct pt_regs' declared inside parameter list will not be visible outside of this definition or declaration [-Werror] The consequence of this is that the "stack_frame_non_standard" check is never run and HAVE_STACK_FRAME_NON_STANDARD is set incorrectly which results in a build failure. This change adds the appropriate header to the "objtool" check so it now behaves as intended. Reviewed-by: Kjeld Schouten <[email protected]> Reviewed-by: Tony Hutter <[email protected]> Signed-off-by: Brian Behlendorf <[email protected]> Closes #10990
* Note that keys must be loaded for 'zpool remove'grodik2020-09-281-0/+2
| | | | | | | | | | | | | | | The error returned by `zpool remove` when the encryption keys aren't loaded isn't very helpful. Furthermore, the man pages make no mention that the keys need to be loaded. This change doesn't resolve the error message but it does update the man page to mention this requirement. Authored-by: grodik <[email protected]> Reviewed-by: Matthew Ahrens <[email protected]> Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Brian Behlendorf <[email protected]> Closes #10939 Closes #10948
* Document branching structureKjeld Schouten-Lebbing2020-09-281-0/+15
| | | | | | | | This change documents the currently used branching structure. It has been cut down to not include any controversial changes. Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Kjeld Schouten-Lebbing <[email protected]> Closes #10976
* zfetch: Don't issue new streams when old have not completedMatthew Macy2020-09-274-44/+166
| | | | | | | | | | | | | | | | | The current dmu_zfetch code implicitly assumes that I/Os complete within min_sec_reap seconds. With async dmu and a readonly workload (and thus no exponential backoff in operations from the "write throttle") such as L2ARC rebuild it is possible to saturate the drives with I/O requests. These are then effectively compounded with prefetch requests. This change reference counts streams and prevents them from being recycled after their min_sec_reap timeout if they still have outstanding I/Os. Reviewed-by: Alexander Motin <[email protected]> Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Matt Macy <[email protected]> Closes #10900
* zfs userspace: use zfs_path_to_zhandle so argument can be a pathAllan Jude2020-09-252-14/+17
| | | | | | | | | Change zfs userspace subcommand to use zfs_path_to_zhandle() so that the provided dataset can be a path (/usr) or a dataset (rpool/usr). Reviewed-by: Brian Behlendorf <[email protected]> Reviewed-by: Ryan Moeller <[email protected]> Signed-off-by: Allan Jude <[email protected]> Closes #8915
* Add DB_RF_NOPREFETCH to dbuf_read()s in dnode.cAdam D. Moss2020-09-251-2/+4
| | | | | | | | | | | | | | Prefetching of dnodes in dbuf_read() can cause significant mutex contention for some workloads and isn't very helpful. This is because we already get 32 dnodes for each block read, and when iterating over a directory we prefetch the dnodes in the directory. Disable this prefetching to prevent the lock contention. Reviewed-by: Brian Behlendorf <[email protected]> Submitted-by: Adam Moss <[email protected]> Submitted-by: Matthew Ahrens <[email protected]> Signed-off-by: Adam Moss <[email protected]> Closes #10877 Closes #10953
* Fix PREEMPTION=y and BLK_CGROUP=y config on arm64Brian Behlendorf2020-09-251-0/+10
| | | | | | | | | | | | | | | With PREEMPTION=y and BLK_CGROUP=y preempt_schedule_notrace() is being used on arm64 which is a GPL-only function and hence the build of the DKMS kernel module fails. Fix that by redefining preempt_schedule_notrace() to preempt_schedule() which should be safe as long as tracing is not used. Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Juerg Haefliger <[email protected]> Closes #8545 Closes #9948 Closes #10416 Closes #10973
* FreeBSD: update cache_purgevfs usage after 1300117 version bumpMateusz Guzik2020-09-251-0/+4
| | | | | | Reviewed-by: Ryan Moeller <[email protected]> Reviewed-by: Nick Wolff <[email protected]> Signed-off-by: Mateusz Guzik <[email protected]> Closes #10970
* FreeBSD: Code cleanup in zio_cryptRyan Moeller2020-09-251-145/+76
| | | | | | | | | | | | | | | Address some unused value and control flow issues flagged by Coverity. Unreachable code is pruned and unused values are avoided. Some scattered sections are reordered for coherence. We can assume kmem_alloc(n, KM_SLEEP) doesn't fail, so there is no need to check if it returned NULL. The allocated memory doesn't need to be zeroed, other than the last iovec (the MAC). Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Ryan Moeller <[email protected]> Closes #10884
* Prune dead branch reported by CoverityRyan Moeller2020-09-251-5/+1
| | | | | | | | | wkey is NULL at every `goto error;`. dcp is never NULL. Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Ryan Moeller <[email protected]> Closes #10884
* zpool command complains about /etc/exports.dGeorge Wilson2020-09-252-43/+64
| | | | | | | | | | | | | | | If the /etc/exports.d directory does not exist, then we should only create it when we're performing an action which already requires root privileges. This commit moves the directory creation to the enable/disable code path which ensures that we have the appropriate privileges. Reviewed-by: Richard Elling <[email protected]> Reviewed-by: Matthew Ahrens <[email protected]> Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: George Wilson <[email protected]> Closes #10785 Closes #10934
* zfs_log_write: simplify data copying code for WR_COPIED recordsChristian Schwarz2020-09-251-8/+15
| | | | | | | | | | | | | | | | | | lr_write_t records that are WR_COPIED have the record data directly appended to them (see lr_write_t type definition). The data is copied from the debuf using dmu_read_by_dnode. This function was called, only for WR_COPIED records, as part of a short-circuiting if-statement's if-expression. I found this side-effectful call to dmu_read_by_dnode pretty hard to spot. This patch improves readability by moving the call to its own line. Reviewed-by: Brian Behlendorf <[email protected]> Reviewed-by: George Wilson <[email protected]> Signed-off-by: Christian Schwarz <[email protected]> Closes #10956
* FreeBSD: Add support for procfs_listMatthew Macy2020-09-2311-41/+201
| | | | | | | | | | The procfs_list interface is required by several kstats. Implement this functionality for FreeBSD to provide access to these kstats. 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 #10890
* FreeBSD: Don't save user FPU context in kernel threadsMatthew Macy2020-09-232-8/+12
| | | | | | Reviewed-by: Alexander Motin <[email protected]> Reviewed-by: Ryan Moeller <[email protected]> Signed-off-by: Matt Macy <[email protected]> Closes #10899
* Update issue templates, commitcheck and Contributing.mdKjeld Schouten-Lebbing2020-09-233-125/+13
| | | | | | | | | | | | - Removes OpenZFS ports from commit check - Removes OpenZFS ports from CONTRIBUTING.md - Adds mailings lists and IRC to issue template selector - Remove blank issue option from issue creator Reviewed-by: George Melikov <[email protected]> Reviewed-by: Brian Behlendorf <[email protected]> Co-authored-by: George Melikov <[email protected]> Signed-off-by: Kjeld Schouten-Lebbing <[email protected]> Closes #10965
* Don't set numobjs to UINT64_MAX or near itPaul Dagnelie2020-09-221-3/+1
| | | | | | | | | | Resolves an issue with `zfs send` streams from 0.8.4 which prevents them from being received by versions < 0.7. Reviewed-by: Matthew Ahrens <[email protected]> Reviewed-by: Paul Zuchowski <[email protected]> Signed-off-by: Paul Dagnelie <[email protected]> Closes #10911 Closes #10916
* contrib/initramfs: fix shellcheck and checkbashisms errors with shebangнаб2020-09-221-87/+80
| | | | | | | Reviewed-by: Gabriel A. Devenyi <[email protected]> Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Ahelenia Ziemiańska <[email protected]> Closes #10908 Closes #10917
* Restore clearing of L2CACHE flag in arc_read_done()George Amanakis2020-09-221-3/+3
| | | | | | | | | | | Commit 45152dc removed clearing of L2CACHE flag in arc_read_done() and moved related code in l2arc_write_eligible(). After careful code inspection arc_read_done() is not bypassed in the case of prefetches. Thus restore the old behavior. Reviewed-by: Brian Behlendorf <[email protected]> Reviewed-by: adam moss <[email protected]> Signed-off-by: George Amanakis <[email protected]> Closes #10951
* Fix a logic bug in the FreeBSD getpages VOPMark Johnston2020-09-221-2/+4
| | | | | | | | | | | | | | In commit cd32b4f5b79c ("Fix a deadlock in the FreeBSD getpages VOP") I introduced a bug while porting the patch originally committed to FreeBSD: the rangelock pointer may be NULL if the try operation failed, so we must avoid calling zfs_rangelock_unlock() in that case. Reviewed-by: Allan Jude <[email protected]> Reviewed-by: Ryan Moeller <[email protected]> Reviewed-by: Matt Macy <[email protected]> Reported-by: Steve Wills <[email protected]> Signed-off-by: Mark Johnston <[email protected]> Closes #10519 Closes #10960
* FreeBSD: Reduce stack usage of LuaRyan Moeller2020-09-222-13/+0
| | | | | | | | | | | | | Use the same reduced buffer size for lauxlib that is used on Linux. Fixes panic on HEAD in lua gsub test designed to exhaust stack space. With this we can remove the special case to reserve more stack space on FreeBSD. Reviewed-by: Brian Behlendorf <[email protected]> Reviewed-by: Kyle Evans <[email protected]> Signed-off-by: Ryan Moeller <[email protected]> Closes #10959
* Annontate FreeBSD sysctls with CTLFLAG_MPSAFEMark Johnston2020-09-212-26/+31
| | | | | | | | | | | | | Without this, the sysctl system calls will acquire a global lock before invoking the handler. This is noticeable in some situations when running top(1). The global lock is mostly vestigal but continues to see some use and so contention is still a problem; until the default sense of the MPSAFE flag changes, we have to annotate each and every handler. Reviewed-by: Allan Jude <[email protected]> Reviewed-by: Ryan Moeller <[email protected]> Signed-off-by: Mark Johnston <[email protected]> Closes #10836
* Fix switch statement indentation in the FreeBSD kstat codeMark Johnston2020-09-211-105/+102
| | | | | | | | | This is in preparation for some functional changes. Reviewed-by: Allan Jude <[email protected]> Reviewed-by: Ryan Moeller <[email protected]> Signed-off-by: Mark Johnston <[email protected]> Closes #10950
* Update documentation of l2arc_mfuonlyGeorge Amanakis2020-09-211-1/+4
| | | | | | | | | | with regard to evicted_l2_eligibile_mru. Even if l2arc_mfuonly is enabled, this is not reflected in evicted_l2_eligible_mru as this information is useful for deciding whether to toggle l2arc_mfuonly depending on the current workload. Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: George Amanakis <[email protected]> Closes #10945
* vdev_ashift should only be set onceGeorge Wilson2020-09-1819-52/+198
| | | | | | | | | | | | | | | | | | | | | | | | | | | == Motivation and Context The new vdev ashift optimization prevents the removal of devices when a zfs configuration is comprised of disks which have different logical and physical block sizes. This is caused because we set 'spa_min_ashift' in vdev_open and then later call 'vdev_ashift_optimize'. This would result in an inconsistency between spa's ashift calculations and that of the top-level vdev. In addition, the optimization logical ignores the overridden ashift value that would be provided by '-o ashift=<val>'. == Description This change reworks the vdev ashift optimization so that it's only set the first time the device is configured. It still allows the physical and logical ahsift values to be set every time the device is opened but those values are only consulted on first open. Reviewed-by: Matthew Ahrens <[email protected]> Reviewed-by: Brian Behlendorf <[email protected]> Reviewed-by: Cedric Berger <[email protected]> Signed-off-by: George Wilson <[email protected]> External-Issue: DLPX-71831 Closes #10932
* libzfs: Don't leak buf if nvlist is too largeAllan Jude2020-09-182-0/+4
| | | | | | | | | | | | | Resolves FreeBSD Coverity defect: CID 1432398: Resource leaks (RESOURCE_LEAK) libzfs: don't leak hdl if there is an error reading env var Resolves FreeBSD Coverity defect: CID 1432395: Resource leaks (RESOURCE_LEAK) Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Allan Jude <[email protected]> Closes #10882
* pool may become suspended during device expansionGeorge Wilson2020-09-173-35/+149
| | | | | | | | | | | | | | | | | | | | When expanding a device zfs needs to rescan the partition table to get the correct size. This can only happen when we're in the kernel and requires the device to be closed. As part of the rescan, udev is notified and the device links are removed and recreated. This leave a window where the vdev code may try to reopen the device before udev has recreated the link. If that happens, then the pool may end up in a suspended state. To correct this, we leverage the BLKPG_RESIZE_PARTITION ioctl which allows the partition information to be modified even while it's in use. This ioctl also does not remove the device link associated with the zfs data partition so it eliminates the race condition that can occur in the kernel. Reviewed-by: Pavel Zakharov <[email protected]> Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: George Wilson <[email protected]> Closes #10897
* zdb leak detection fails with in-progress device removalMatthew Ahrens2020-09-171-8/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When a device removal is in progress, there are 2 locations for the data that's already been moved: the original location, on the device that's being removed; and the new location, which is pointed to by the indirect mapping. When doing leak detection, zdb needs to know about both locations. To determine what's already been copied, we load the spacemaps of the removing vdev, omit the blocks that are yet to be copied, and then use the vdev's remap op to find the new location. The problem is with an optimization to the spacemap-loading code in zdb. When processing the log spacemaps, we ignore entries that are not relevant because they are past the point that's been copied. However, entries which span the point that's been copied (i.e. they are partly relevant and partly irrelevant) are processed normally. This can lead to an illegal spacemap operation, for example if offsets up to 100KB have been copied, and the spacemap log has the following entries: ALLOC 50KB-150KB (partly relevant) FREE 50KB-100KB (entirely relevant) FREE 100KB-150KB (entirely irrlevant - ignored) ALLOC 50KB-150KB (partly relevant) Because the entirely irrelevant entry was ignored, its space remains in the spacemap. When the last entry is processed, we attempt to add it to the spacemap, but it partially overlaps with the 100-150KB entry that was left over. This problem was discovered by ztest/zloop. One solution would be to also ignore the irrelevant parts of partially-irrelevant entries (i.e. when processing the ALLOC 50-150, to only add 50-100 to the spacemap). However, this commit implements a simpler solution, which is to remove this optimization entirely. I.e. to process the entire spacemap log, without regard for the point that's been copied. After reconstructing the entire allocatable range tree, there's already code to remove the parts that have not yet been copied. Reviewed-by: Serapheim Dimitropoulos <[email protected]> Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Matthew Ahrens <[email protected]> External-issue: DLPX-71820 Closes #10920
* FreeBSD: Do not copy vp into f_data for DTYPE_VNODE filesRyan Moeller2020-09-171-4/+1
| | | | | | | | | | https://reviews.freebsd.org/D26346 Do not copy vp into f_data for DTYPE_VNODE files. The vnode pointer is already stored in f_vnode. Use that so f_data can be reused. Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Ryan Moeller <[email protected]> Closes #10929
* Need a long hold in zpl_mount_implJohn Poduska2020-09-171-0/+4
| | | | | | | | | | | | | | | | | | In zpl_mount_impl, there is: dmu_objset_hold ; returns with pool & ds held dsl_pool_rele sget dsl_dataset_rele As spelled out in the "DSL Pool Configuration Lock" in dsl_pool.c, this requires a long hold. Reviewed-by: Brian Behlendorf <[email protected]> Reviewed-by: Paul Zuchowski <[email protected]> Signed-off-by: John Poduska <[email protected]> Closes #10936
* libzfsbootenv: lzbe_nvlist_set needs to store bootenv version VB_NVLISTToomas Soome2020-09-171-0/+18
| | | | | | | | A small bug did slip into initial libzfsbootenv; while storing nvlist in nvlist, we should make sure the bootenv is using VB_NVLIST format. Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Toomas Soome <[email protected]> Closes #10937
* Rename acltype=posixacl to acltype=posixRyan Moeller2020-09-1615-35/+39
| | | | | | | Prefer acltype=off|posix, retaining the old names as aliases. Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Ryan Moeller <[email protected]> Closes #10918
* cmd/zgenhostid: replace with simple c implementationGeorgy Yakovlev2020-09-167-93/+213
| | | | | | | | | | | | | | | | | | It was discovered that dracut scripts and zgenhostid always generate little-endian /etc/hostid. This commit provides simple endianess-aware binary and updates the scripts to use it. New features include: -f flag to force overwrite. -o flag to write to different file (for dracut) accepting both 0x01234567 and 01234567 values as input Reviewed-by: Brian Behlendorf <[email protected]> Reviewed-by: Olaf Faaland <[email protected]> Signed-off-by: Georgy Yakovlev <[email protected]> Closes #10887 Closes #10925
* Fix stack frame size: dnode_dirty_l1range()Pavel Snajdr2020-09-151-10/+13
| | | | | | | Reviewed-by: Ryan Moeller <[email protected]> Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Pavel Snajdr <[email protected]> Closes #10879
* dmu_redact_snap: fix possible memleakPavel Snajdr2020-09-151-0/+2
| | | | | | | Reviewed-by: Ryan Moeller <[email protected]> Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Pavel Snajdr <[email protected]> Closes #10879
* Fix stack frame size: dmu_redact_snap()Pavel Snajdr2020-09-151-8/+20
| | | | | | | Reviewed-by: Ryan Moeller <[email protected]> Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Pavel Snajdr <[email protected]> Closes #10879
* Fix stack frame size: spa_livelist_delete_cb()Pavel Snajdr2020-09-151-5/+7
| | | | | | | Reviewed-by: Ryan Moeller <[email protected]> Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Pavel Snajdr <[email protected]> Closes #10879
* zpoolprops.8: fix raidz par[i]ty typoнаб2020-09-151-1/+1
| | | | | | Reviewed-by: George Melikov <[email protected]> Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Ahelenia Ziemiańska <[email protected]> Closes #10923
* 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