aboutsummaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* zfs-send(8): Restore sorting of flagsRyan Moeller2021-04-151-9/+9
| | | | | | | | | Before #11710 the flags in zfs-send(8) were sorted. Restore order and bump the date. Reviewed-by: George Melikov <[email protected]> Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Ryan Moeller <[email protected]> Closes #11905
* linux/spl: proc: use global table_{min,max} values instead of local onesнаб2021-04-151-6/+6
| | | | | | Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Ahelenia Ziemiańska <[email protected]> Closes #11879
* linux/libspl: gethostid: read from /proc/sys/kernel/spl/hostid, simplifyнаб2021-04-151-24/+17
| | | | | | | | | | Fixes get_system_hostid() if it was set via the aforementioned sysctl and simplifies the code a bit. The kernel and user-space must agree, after all. Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Ahelenia Ziemiańska <[email protected]> Closes #11879
* linux/spl: base proc_dohostid() on proc_dostring()наб2021-04-151-76/+17
| | | | | | | | | | | | | | | | | | | | | | This fixes /proc/sys/kernel/spl/hostid on kernels with mainline commit 32927393dc1ccd60fb2bdc05b9e8e88753761469 ("sysctl: pass kernel pointers to ->proc_handler") ‒ 5.7-rc1 and up The access_ok() check in copy_to_user() in proc_copyout_string() would always fail, so all userspace reads and writes would fail with EINVAL proc_dostring() strips only the final new-line, but simple_strtoul() doesn't actually need a back-trimmed string ‒ writing "012345678 \n" is still allowed, as is "012345678zupsko", &c. This alters what happens when an invalid value is written ‒ previously it'd get set to what-ever simple_strtoul() returned (probably 0, thereby resetting it to default), now it does nothing Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Ahelenia Ziemiańska <[email protected]> Closes #11878 Closes #11879
* libspl: lift common bits of getexecname()наб2021-04-155-72/+99
| | | | | | | | | Merge the actual implementations of getexecname() and slightly clean up the FreeBSD one. Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Ahelenia Ziemiańska <[email protected]> Closes #11879
* module/zfs/zvol.c: purge unused zvol_volmode_cb_argнаб2021-04-151-4/+0
| | | | | | Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Ahelenia Ziemiańska <[email protected]> Closes #11879
* ZFS traverse_visitbp optimization to limit prefetchJitendra Patidar2021-04-152-14/+66
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Traversal code, traverse_visitbp() does visit blocks recursively. Indirect (Non L0) Block of size 128k could contain, 1024 block pointers of 128 bytes. In case of full traverse OR incremental traverse, where all blocks were modified, it could traverse large number of blocks pointed by indirect. Traversal code does issue prefetch of blocks traversed below indirect. This could result into large number of async reads queued on vdev queue. So, account for prefetch issued for blocks pointed by indirect and limit max prefetch in one go. Module Param: zfs_traverse_indirect_prefetch_limit: Limit of prefetch while traversing an indirect block. Local counters: prefetched: Local counter to account for number prefetch done. pidx: Index for which next prefetch to be issued. ptidx: Index at which next prefetch to be triggered. Keep "ptidx" somewhere in the middle of blocks prefetched, so that blocks prefetch read gets the enough time window before their demand read is issued. Reviewed-by: Brian Behlendorf <[email protected]> Reviewed-by: Alexander Motin <[email protected]> Signed-off-by: Jitendra Patidar <[email protected]> Closes #11802 Closes #11803
* ZTS: add zed_fd_spill to verify the fds ZEDLETs inheritнаб2021-04-158-11/+127
| | | | | | Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Ahelenia Ziemiańska <[email protected]> Closes #11891
* zed: set O_CLOEXEC on persistent fds, remove closefrom() from pre-execнаб2021-04-153-13/+9
| | | | | | | | Also don't dup /dev/null over stdio if daemonised Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Ahelenia Ziemiańska <[email protected]> Closes #11891
* Add SIGSTOP and SIGTSTP handling to issigPaul Dagnelie2021-04-157-17/+134
| | | | | | | | | | | | | | | | This change adds SIGSTOP and SIGTSTP handling to the issig function; this mirrors its behavior on Solaris. This way, long running kernel tasks can be stopped with the appropriate signals. Note that doing so with ctrl-z on the command line doesn't return control of the tty to the shell, because tty handling is done separately from stopping the process. That can be future work, if people feel that it is a necessary addition. Reviewed-by: Brian Behlendorf <[email protected]> Reviewed-by: Matthew Ahrens <[email protected]> Signed-off-by: Paul Dagnelie <[email protected]> Issue #810 Issue #10843 Closes #11801
* Fix 'make checkbashisms` warningsBrian Behlendorf2021-04-151-1/+1
| | | | | | | | | | | | | | | | | | | | | | The awk command used by the checkbashisms target incorrectly adds the escape character before the ! and # characters. This results in the following warnings because these characters do not need to be escaped. awk: cmd. line:1: warning: regexp escape sequence `\!' is not a known regexp operator awk: cmd. line:1: warning: regexp escape sequence `\#' is not a known regexp operator Remove the unneeded escape character before ! and #. Valid escape sequences are: https://www.gnu.org/software/gawk/manual/html_node/Escape-Sequences.html Reviewed-by: George Melikov <[email protected]> Reviewed-by: Ryan Moeller <[email protected]> Signed-off-by: Brian Behlendorf <[email protected]> Closes #11902
* Fix vdev health padding in zpool list -vYuri Pankov2021-04-141-1/+1
| | | | | | | | | Do not (incorrectly, right instead left) pad health string itself, it will be taken care of when printing property value below. Reviewed-by: Brian Behlendorf <[email protected]> Reviewed-by: Ryan Moeller <[email protected]> Signed-off-by: Yuri Pankov <[email protected]> Closes #11899
* Obsolete earlier packages due to version bumpBrian Behlendorf2021-04-131-0/+4
| | | | | | | | | | | | Follow up to d5ef91af which adds a missing 'obsoletes' for the libzfs-devel package. Add a comment to the zfs.spec file as a reminder that previous versions of the package should be marked as obsolete. Reviewed-by: Olaf Faaland <[email protected]> Signed-off-by: Brian Behlendorf <[email protected]> Closes #11844 Closes #11895
* libzfs: get rid of unused libzfs_handle::libzfs_{storeerr,chassis_id}наб2021-04-132-121/+113
| | | | | | Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Ahelenia Ziemiańska <[email protected]> Closes #11868
* libzfs: get rid of libzfs_handle::libzfs_mnttabнаб2021-04-137-2759/+2609
| | | | | | | | | | | | | | All users did a freopen() on it. Even some non-users did! This is point-less ‒ just open the mtab when needed If I understand Solaris' getextmntent(3C) correctly, the non-user freopen()s are very likely an odd, twisted vestigial tail of that ‒ but it's got a completely different calling convention and caching semantics than any platform we support Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Ahelenia Ziemiańska <[email protected]> Closes #11868
* linux/libspl: getextmntent(): don't leak mnttab FILE*наб2021-04-131-0/+1
| | | | | | Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Ahelenia Ziemiańska <[email protected]> Closes #11868
* libzfs: zfs_mount_at(): load key for encryption root if MS_CRYPTнаб2021-04-121-1/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | zfs_crypto_load_key() only works on encryption roots, and zfs mount -la would fail if it encounters a datasets that is sorted before their encroots. To trigger: truncate -s 40G /tmp/test dd if=/dev/urandom of=/tmp/k bs=128 count=1 status=none zpool create -O encryption=on -O keylocation=file:///tmp/k \ -O keyformat=passphrase test /tmp/test zfs create -o mountpoint=/a test/a zfs create -o mountpoint=/b test/b zfs umount test zfs unload-key test zfs mount -la The final mount errored out with: Key load error: Keys must be loaded for encryption root of 'test/a' (test). Key load error: Keys must be loaded for encryption root of 'test/b' (test). And only /test was mounted This technically breaks the libzfs API, but the previous behavior was decidedly a bug. Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Ahelenia Ziemiańska <[email protected]> Closes #11870 Closes #11875
* FreeBSD: use vnlru_free_vfsops if availableMateusz Guzik2021-04-121-1/+21
| | | | | | | | Fixes issues when zfs is used along with other filesystems. External-issue: https://cgit.freebsd.org/src/commit/?id=e9272225e6bed840b00eef1c817b188c172338ee Reviewed-by: Ryan Moeller <[email protected]> Signed-off-by: Mateusz Guzik <[email protected]> Closes #11881
* FreeBSD: add missing seqc write begin/end around zfs_acl_chown_setattrMateusz Guzik2021-04-121-0/+2
| | | | | | | | It happens to trip over an assert but does not matter for correctness at this time. Done for future proofing. Reviewed-by: Ryan Moeller <[email protected]> Signed-off-by: Mateusz Guzik <[email protected]> Closes #11884
* FreeBSD: add support for lockless symlink lookupMateusz Guzik2021-04-123-2/+100
| | | | | Reviewed-by: Ryan Moeller <[email protected]> Signed-off-by: Mateusz Guzik <[email protected]> Closes #11883
* .gitmodules: link to openzfs github repositoryнаб2021-04-121-1/+1
| | | | | | | | Update the test images link to reference the openzfs github repository. Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Ahelenia Ziemiańska <[email protected]> Issue #11868
* cmd/zfs receive: allow dry-run (-n) to check property argsPrawn2021-04-121-20/+20
| | | | | | | | | | zfs recv -n does not report some errors it could. The code to bail out of the receive if in dry-run mode came a little early, skipping validation of cmdprops (recv -x and -o) among others. Move the check down to enable these additional checks. Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: InsanePrawn <[email protected]> Closes #11862
* libuutil: purge unused functionsнаб2021-04-127-1177/+1102
| | | | | | | | | | | | | | | | | | | | | | | | | | | Remove vestigial uu_open_tmp(). The problems with this implementation are many, but the primary one is the TMPPATHFMT macro, which is unused, and always has been. Searching around for any users leads only to earlier imports of the same, identical file, i.a. into an apple repository (which does patch gethrtime() into it and gives us a copyright date of 2007), and a MidnightBSD one from 2008. Searching illumos-gate, uu_open_tmp appears, in current HEAD, three times: in the header, libuutil's mapfile ABI, and the implementation. This slowly grows up to eight occurrences as one moves back to the root "OpenSolaris Launch" commit: the header, implementation, twice in libuutil's spec ABI, twice (with multilib and non-multilib paths) in libuutil.so's i386 and SPARC binary db ABIs. That's 2005, and this file was abandonware even then, it's dead code. The situation is similar for the uu_dprintf() family of functions and uu_dump(). Nothing in accessibly recorded history has ever used them. Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Ahelenia Ziemiańska <[email protected]> Closes #11873
* Improvements to the 'compatibility' propertyColm2021-04-127-2711/+2935
| | | | | | | | | | | | | | | | | | | | | | | | | | Several improvements to the operation of the 'compatibility' property: 1) Improved handling of unrecognized features: Change the way unrecognized features in compatibility files are handled. * invalid features in files under /usr/share/zfs/compatibility.d only get a warning (as these may refer to future features not yet in the library), * invalid features in files under /etc/zfs/compatibility.d get an error (as these are presumed to refer to the current system). 2) Improved error reporting from zpool_load_compat. Note: slight ABI change to zpool_load_compat for better error reporting. 3) compatibility=legacy inhibits all 'zpool upgrade' operations. 4) Detect when features are enabled outside current compatibility set * zpool set compatibility=foo <-- print a warning * zpool set feature@xxx=enabled <-- error * zpool status <-- indicate this state Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Colm Buckley <[email protected]> Closes #11861
* ZTS: fix removal_condense_export test caseBrian Behlendorf2021-04-115-3/+21
| | | | | | | | | | | | | It's been observed in the CI that the required 25% of obsolete bytes in the mapping can be to high a threshold for this test resulting in condensing never being triggered and a test failure. To prevent these failures make the existing zfs_condense_indirect_obsolete_pct tuning available so the obsolete percentage can be reduced from 25% to 5% during this test. Reviewed-by: Ryan Moeller <[email protected]> Reviewed-by: George Melikov <[email protected]> Signed-off-by: Brian Behlendorf <[email protected]> Closes #11869
* Update libzfs.abi for zfs_send() changeBrian Behlendorf2021-04-111-2602/+2537
| | | | | | | | | Commit 099fa7e4 intentionally modified the libzfs ABI. However, it failed to include an update for the libzfs.abi file. This commit resolves the `make checkabi` warning due to that omission. Signed-off-by: Brian Behlendorf <[email protected]> Closes #11710
* Balance parentheses in parameter descriptionspstef2021-04-112-2/+2
| | | | | Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Piotr Paweł Stefaniak <[email protected]> Closes #11882
* ZTS: Add known exceptionsBrian Behlendorf2021-04-111-0/+3
| | | | | | | | | | | The fault/auto_spare_shared, l2arc/persist_l2arc_007_pos, and alloc_class/alloc_class_013_pos test cases are not entirely reliable and may occasionally fail resulting in a false positive in the CI. Add these tests to known list of possible failures until they can be made 100% reliable. Reviewed-by: George Melikov <[email protected]> Signed-off-by: Brian Behlendorf <[email protected]> Closes #11890
* lib/: set O_CLOEXEC on all fdsнаб2021-04-1122-62/+51
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | As found by git grep -E '(open|setmntent|pipe2?)\(' | grep -vE '((zfs|zpool)_|fd|dl|lzc_re|pidfile_|g_)open\(' FreeBSD's pidfile_open() says nothing about the flags of the files it opens, but we can't do anything about it anyway; the implementation does open all files with O_CLOEXEC Consider this output with zpool.d/media appended with "pid=$$; (ls -l /proc/$pid/fd > /dev/tty)": $ /sbin/zpool iostat -vc media lrwx------ 0 -> /dev/pts/0 l-wx------ 1 -> 'pipe:[3278500]' l-wx------ 2 -> /dev/null lrwx------ 3 -> /dev/zfs lr-x------ 4 -> /proc/31895/mounts lrwx------ 5 -> /dev/zfs lr-x------ 10 -> /usr/lib/zfs-linux/zpool.d/media vs $ ./zpool iostat -vc vendor,upath,iostat,media lrwx------ 0 -> /dev/pts/0 l-wx------ 1 -> 'pipe:[3279887]' l-wx------ 2 -> /dev/null lr-x------ 10 -> /usr/lib/zfs-linux/zpool.d/media Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Ahelenia Ziemiańska <[email protected]> Closes #11866
* libzfs{,_core}: set O_CLOEXEC on persistent (ZFS_DEV and MNTTAB) fdsнаб2021-04-114-7/+7
| | | | | | | | | | | These were fd 3, 4, and 5 by the time zfs change-key hit execute_key_fob() glibc appends "e" to setmntent() mode, but musl's just returns fopen() Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Ahelenia Ziemiańska <[email protected]> Closes #11866
* libzfs: zfs_crypto_create() requires a new key by definition: set newkeyнаб2021-04-111-1/+1
| | | | | | | | | | | | | | | | This changes the password prompt for new encryption roots from Enter passphrase: Re-enter passphrase: to Enter new passphrase: Re-enter new passphrase: which makes more sense and is more consistent with "new passphrase" now always meaning "come up with something" and plain "passphrase" "remember that thing" Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Ahelenia Ziemiańska <[email protected]> Closes #11866
* libzfs_crypto.c: remove unused key_locator enumнаб2021-04-111-6/+0
| | | | | | Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Ahelenia Ziemiańska <[email protected]> Closes #11866
* zfprops(8): fix spacing in jailed= argumentsнаб2021-04-111-1/+1
| | | | | | Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Ahelenia Ziemiańska <[email protected]> Closes #11866
* zfs-[un]jail(8): fix "zfs-jail [un]jail" leftoversнаб2021-04-111-2/+2
| | | | | | Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Ahelenia Ziemiańska <[email protected]> Closes #11866
* zed: untangle _zed_conf_parse_path()наб2021-04-111-7/+10
| | | | | | | | Dunno, maybe it's just me, but the previous style was /really/ confusing Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Ahelenia Ziemiańska <[email protected]> Closes #11860
* zed: don't malloc() global zed_conf instance, optimise zed_conf layoutнаб2021-04-113-63/+48
| | | | | | | | | | It's all of 40 bytes with 4-byte pointers and 64 with 8-byte ones (previously 44 and 88, respectively) ‒ there's no reason it can't live on the stack Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Ahelenia Ziemiańska <[email protected]> Closes #11860
* zed: remove zed_conf::{min,max}_events and ZED_{MIN,MAX}_EVENTSнаб2021-04-113-14/+0
| | | | | | | | No users, fields marked "reserved for future use", macros defined to 0 Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Ahelenia Ziemiańska <[email protected]> Closes #11860
* zed: remove zed_conf::syslog_facilityнаб2021-04-112-2/+0
| | | | | | | | | No users, nobody sets it, main() hard-codes LOG_DAEMON, which is the only correct value for this Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Ahelenia Ziemiańska <[email protected]> Closes #11860
* zed: _zed_conf_display_help(): be consistent about what got_err meansнаб2021-04-111-4/+4
| | | | | | | | Users passed in EXIT_SUCCESS and EXIT_FAILURE, despite it being a bool Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Ahelenia Ziemiańska <[email protected]> Closes #11860
* zed: untangle -h option listingнаб2021-04-111-32/+40
| | | | | | Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Ahelenia Ziemiańska <[email protected]> Closes #11860
* zed: print out licence string as one big chunkнаб2021-04-111-13/+7
| | | | | | Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Ahelenia Ziemiańska <[email protected]> Closes #11860
* Allow zfs to send replication streams with missing snapshotspablofsf2021-04-117-18/+126
| | | | | | | | | | | | A tentative implementation and discussion was done in #5285. According to it a send --skip-missing|-s flag has been added. In a replication stream, when there are snapshots missing in the hierarchy, if -s is provided print a warning and ignore dataset (and its children) instead of throwing an error Reviewed-by: Paul Dagnelie <[email protected]> Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Pablo Correa Gómez <[email protected]> Closes #11710
* kmod-zfs should obsolete kmod-spl as well as spl-kmodOlaf Faaland2021-04-111-0/+1
| | | | | | | | | Without this Obsoletes, using packages built --with-spec=redhat, an upgrade from zfs-0.7 to zfs-2.x does not cause the kmod-spl-0.7 package to be removed. Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Olaf Faaland <[email protected]> Closes #11865
* zvol_wait: properly handle zvol_volmode sysctl being 3/noneнаб2021-04-111-6/+6
| | | | | | | | Reviewed-by: Brian Behlendorf <[email protected]> Reviewed-by: Pavel Zakharov <[email protected]> Reviewed-by: Ryan Moeller <[email protected]> Signed-off-by: Ahelenia Ziemiańska <[email protected]> Closes #11859
* zfs_ids_to_path: print correct wrong valuesнаб2021-04-111-3/+3
| | | | | | | | Reviewed-by: Brian Behlendorf <[email protected]> Reviewed-by: Pavel Zakharov <[email protected]> Reviewed-by: Ryan Moeller <[email protected]> Signed-off-by: Ahelenia Ziemiańska <[email protected]> Closes #11859
* zfs_ids_to_path: the -v comes after the executable nameнаб2021-04-111-1/+1
| | | | | | | | Reviewed-by: Brian Behlendorf <[email protected]> Reviewed-by: Pavel Zakharov <[email protected]> Reviewed-by: Ryan Moeller <[email protected]> Signed-off-by: Ahelenia Ziemiańska <[email protected]> Closes #11859
* contrib/bpftrace: exec bpftrace, remove useless catнаб2021-04-111-2/+2
| | | | | | | | Reviewed-by: Brian Behlendorf <[email protected]> Reviewed-by: Pavel Zakharov <[email protected]> Reviewed-by: Ryan Moeller <[email protected]> Signed-off-by: Ahelenia Ziemiańska <[email protected]> Closes #11859
* arc_summary3: just read /s/m/{mod}/version instead of spawning catнаб2021-04-111-15/+5
| | | | | | | | Reviewed-by: Brian Behlendorf <[email protected]> Reviewed-by: Pavel Zakharov <[email protected]> Reviewed-by: Ryan Moeller <[email protected]> Signed-off-by: Ahelenia Ziemiańska <[email protected]> Closes #11859
* zvol_wait: fix for zvols with spaces in name, optimiseнаб2021-04-111-16/+12
| | | | | | | | | | | | | | | list_zvols() would happily, for zvols with spaces in their names, assign the second half to volmode, &c., so use a normal read and set IFS to a tab instead of using 4 separate AWK processes(?) Similarly, in filter_out_deleted_zvols(), run zfs(8) once and use the output directly instead of spawning a zfs(8) process per zvol Reviewed-by: Brian Behlendorf <[email protected]> Reviewed-by: Pavel Zakharov <[email protected]> Reviewed-by: Ryan Moeller <[email protected]> Signed-off-by: Ahelenia Ziemiańska <[email protected]> Closes #11859
* zstreamdump: exec zstream dumpнаб2021-04-111-1/+1
| | | | | | | | Reviewed-by: Brian Behlendorf <[email protected]> Reviewed-by: Pavel Zakharov <[email protected]> Reviewed-by: Ryan Moeller <[email protected]> Signed-off-by: Ahelenia Ziemiańska <[email protected]> Closes #11859