aboutsummaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* zed: don't malloc() global zed_conf instance, optimise zed_conf layoutнаб2021-04-143-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-143-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-142-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-141-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-141-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-141-13/+7
| | | | | | Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Ahelenia Ziemiańska <[email protected]> Closes #11860
* zed: only go up to current limit in close_from() fallbackнаб2021-04-141-7/+1
| | | | | | | | | | | | | | | | | | | | | | | | | Consider the following strace log: prlimit64(0, RLIMIT_NOFILE, NULL, {rlim_cur=1024, rlim_max=1024*1024}) = 0 dup2(0, 30) = 30 dup2(0, 300) = 300 dup2(0, 3000) = -1 EBADF (Bad file descriptor) dup2(0, 30000) = -1 EBADF (Bad file descriptor) dup2(0, 300000) = -1 EBADF (Bad file descriptor) prlimit64(0, RLIMIT_NOFILE, {rlim_cur=1024*1024, rlim_max=1024*1024}, NULL) = 0 dup2(0, 30) = 30 dup2(0, 300) = 300 dup2(0, 3000) = 3000 dup2(0, 30000) = 30000 dup2(0, 300000) = 300000 Even a privileged process needs to bump its rlimit before being able to use fds higher than rlim_cur. Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Ahelenia Ziemiańska <[email protected]> Closes #11834
* zed.8: the Diagnosis Engine is implementedнаб2021-04-141-2/+0
| | | | | | Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Ahelenia Ziemiańska <[email protected]> Closes #11834
* zed: replace zed_file_write_n() with write(2), purge itнаб2021-04-143-30/+1
| | | | | | | | | | | We set SA_RESTART early on, which will prevent EINTRs (indeed, to the point of needing to clear it in the reaper, since it interferes with pause(2)), which is the only error zed_file_write_n() actually handled (plus, the pid write is no bigger than 12 bytes anyway) Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Ahelenia Ziemiańska <[email protected]> Closes #11834
* zed: merge all _NOT_IMPLEMENTED_ eventsнаб2021-04-142-20/+5
| | | | | | | | | | | | | These events should currently never be generated. Also untag _zed_event_add_nvpair() from merge with zpool_do_events_nvprint() ‒ they serve different purposes (machine, usually script vs human consumption) and format the output differently as it stands Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Ahelenia Ziemiańska <[email protected]> Closes #11834
* zed: remove unused zed_file_read_n()наб2021-04-142-31/+0
| | | | | | | | Same deal as zed_file_close_on_exec() Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Ahelenia Ziemiańska <[email protected]> Closes #11834
* zed: bump zfs_zevent_len_max if we miss any eventsнаб2021-04-141-8/+41
| | | | | | Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Ahelenia Ziemiańska <[email protected]> Closes #11834
* zed.8: don't pretend an unprivileged user could change the script ownerнаб2021-04-142-11/+4
| | | | | | | | | | | | | | | | And add a note on /why/ ZEDLETs need to be owned by root Quoth chown(2), Linux man-pages project: Only a privileged process (Linux: one with the CAP_CHOWN capability) may change the owner of a file. Quoth chown(2), FreeBSD: [EPERM] The operation would change the ownership, but the effective user ID is not the super-user. Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Ahelenia Ziemiańska <[email protected]> Closes #11834
* zed: purge all mentions of a configuration fileнаб2021-04-145-45/+1
| | | | | | | | | | | | There simply isn't a need for one, since the flags the daemon takes are all short (mostly just toggles) and administrative in nature, and are therefore better served by the age-old tradition of sourcing an environment file and preparing the cmdline in the init-specific handler itself, if needed at all Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Ahelenia Ziemiańska <[email protected]> Closes #11834
* zed: implement close_from() in terms of /proc/self/fd, if availableнаб2021-04-141-9/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | /dev/fd on Darwin Consider the following strace output: prlimit64(0, RLIMIT_NOFILE, NULL, {rlim_cur=1024, rlim_max=1024*1024}) = 0 Yes, that is well over a million file descriptors! This reduces the ZED start-up time from "at least a second" to "instantaneous", and, under strace, from "don't even try" to "usable" by simple virtue of doing five syscalls instead of over a million; in most cases the main loop does nothing Recent Linuxes (5.8+) have close_range(2) for this, but that's an overoptimisation (and libcs don't have wrappers for it yet) This is also run by the ZEDLET pre-exec. Compare: Finished "all-syslog.sh" eid=13 pid=6717 time=1.027100s exit=0 Finished "history_event-zfs-list-cacher.sh" eid=13 pid=6718 time=1.046923s exit=0 to Finished "all-syslog.sh" eid=12 pid=4834 time=0.001836s exit=0 Finished "history_event-zfs-list-cacher.sh" eid=12 pid=4835 time=0.001346s exit=0 lol Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Ahelenia Ziemiańska <[email protected]> Closes #11834
* zed: print combined system/user time after ZEDLET deathнаб2021-04-141-6/+25
| | | | | | Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Ahelenia Ziemiańska <[email protected]> Closes #11834
* zed: allow limiting concurrent jobsнаб2021-04-148-23/+59
| | | | | | | | | 200ms time-out is relatively long, but if we already hit the cap, then we'll likely be able to spawn multiple new jobs when we wake up Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Ahelenia Ziemiańska <[email protected]> Closes #11807
* zed: remove unused zed_file_close_on_exec()наб2021-04-142-30/+0
| | | | | | | | | The FIXME comment was there since the initial implementation in 2014, there are no users Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Ahelenia Ziemiańska <[email protected]> Closes #11807
* zed: use separate reaper thread and collect ZEDLETs asynchronouslyнаб2021-04-145-55/+157
| | | | | | Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Ahelenia Ziemiańska <[email protected]> Closes #11807
* zed: set names for all threadsнаб2021-04-143-0/+3
| | | | | | Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Ahelenia Ziemiańska <[email protected]> Closes #11807
* Tag 2.1.0-rc2zfs-2.1.0-rc2Brian Behlendorf2021-04-071-1/+1
| | | | Signed-off-by: Brian Behlendorf <[email protected]>
* fix misplaced quotes in kmod-preambleOlaf Faaland2021-04-071-2/+2
| | | | | | | | | | | | | | | | rpm/redhat/zfs-kmod.spec.in has a typo in the shell code that creates the kmod-preamble file. This typo results in the preamble file having the wrong name, ./SOURCES/kmod-preamblenObsoletes and missing the Obsoletes clause that has become part of the name. Because the filename is incorrect, the built package does not have "obsoletes" or "conflicts" set. Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Olaf Faaland <[email protected]> Closes #11851
* Obsolete earlier packages due to version bumpBrian Behlendorf2021-04-071-0/+2
| | | | | | | | | | | In order for package managers such as dnf to upgrade cleanly after the package SONAME bump the obsolete package names must be known. Update the new packages to correctly obsolete the old ones. Reviewed-by: Olaf Faaland <[email protected]> Reviewed-by: Tony Hutter <[email protected]> Signed-off-by: Brian Behlendorf <[email protected]> Closes #11844 Closes #11847
* i-t: don't brokenly set the scheduler for root pool vdev's disksнаб2021-04-071-24/+0
| | | | | | | | | | | | | | | | | | | | This effectively reverts 4fc411f7a3ecee8a70fc8d6c687fae9a1cf20b31 (part of #6807) and f6fbe25664629d1ae6a3b186f14ec69dbe6c6232 (#9042) ‒ the code itself and latter PR cite symmetry with whole-disk-vdev behaviour (presumably because rootfs vdevs are rarely whole disks), but the code is broken for NVME devices (indeed, it'd strip the controller number instead of the (potential) partition number, turning "nvme0n1p1" into "nvmen1p1", which would then subsequently fail the sysfs existence check); it could be fixed to handle those (and any others) rather easily by dereferencing /sys/class/block/$devname, but this isn't the place for setting this ‒ as noted in the commit that removed setting the scheduler by default (9e17e6f2541c69a7a5e0ed814a7f5e71cbf8b90a) ‒ use an udev rule Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Ahelenia Ziemiańska <[email protected]> Closes #11838
* i-t: fix root=zfs:AUTOнаб2021-04-071-4/+9
| | | | | | | | | | | | | | | | IFS= would break loops in import_pool(), which would fault any automatic import Additionally $ZFS_BOOTFS from cmdline would interfere with find_rootfs() If many pools were present, same thing could happen across multiple find_rootfs() runs, so bail out early and clean up in error path Suggested-by: @nachtgeist Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Ahelenia Ziemiańska <[email protected]> Closes #11278 Closes #11838
* zfs get -p only outputs 3 columns if "clones" property is emptymatt-fidd2021-04-073-4/+21
| | | | | | | | | | get_clones_string currently returns an empty string for filesystem snapshots which have no clones. This breaks parsable `zfs get` output as only three columns are output, instead of 4. Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Matt Fiddaman <[email protected]> Co-authored-by: matt <[email protected]> Closes #11837
* zpool-features.5: remove "booting not possible with this feature"sнаб2021-04-071-4/+0
| | | | | | | | | | | | The exact limitations on what features are supported when booting vary considerably depending on the environment. In order to minimize confusion avoid categorical statements which assume GRUB2 is being used. The supported GRUB2 features are covered earlier in this man page for easy reference. Reviewed-by: George Melikov <[email protected]> Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Ahelenia Ziemiańska <[email protected]> Closes #11842
* man: fix wrong .Xr macros usagesGeorge Melikov2021-04-077-10/+10
| | | | | | | | In addition, html doc will have working hyperlinks. Reviewed-by: Brian Behlendorf <[email protected]> Reviewed-by: Ryan Moeller <[email protected]> Signed-off-by: George Melikov <[email protected]> Closes #11845
* libzutil: zfs_isnumber(): return false if input emptyнаб2021-04-072-4/+7
| | | | | | | | | | | | | | | | | | | | | | zpool list, which is the only user, would mistakenly try to parse the empty string as the interval in this case: $ zpool list "a" cannot open 'a': no such pool $ zpool list "" interval cannot be zero usage: <usage string follows> which is now symmetric with zpool get: $ zpool list "" cannot open '': name must begin with a letter Avoid breaking the "interval cannot be zero" string. There simply isn't a need for this, and it's user-facing. Reviewed-by: Brian Behlendorf <[email protected]> Reviewed-by: Ryan Moeller <[email protected]> Signed-off-by: Ahelenia Ziemiańska <[email protected]> Closes #11841 Closes #11843
* ZTS: pool_checkpoint improvementsBrian Behlendorf2021-04-074-7/+15
| | | | | | | | | | | | | | | | | | | The pool_checkpoint tests may incorrectly fail because several of them invoke zdb for an imported pool. In this scenario it's not unexpected for zdb to fail if the pool is modified. To resolve this these zdb checks are now done after the pool has been exported. Additionally, the default cleanup functions assumed the pool would be imported when they were run. If this was not the case they're exit early and fail to cleanup all of the test state causing subsequent tests to fail. Add a check to only destroy the pool when it is imported. Reviewed-by: John Kennedy <[email protected]> Reviewed-by: Ryan Moeller <[email protected]> Reviewed-by: George Melikov <[email protected]> Reviewed-by: Serapheim Dimitropoulos <[email protected]> Signed-off-by: Brian Behlendorf <[email protected]> Closes #11832
* Fix various typosAndrea Gelmini2021-04-0757-75/+75
| | | | | | | | | | Correct an assortment of typos throughout the code base. Reviewed-by: Brian Behlendorf <[email protected]> Reviewed-by: Matthew Ahrens <[email protected]> Reviewed-by: Ryan Moeller <[email protected]> Signed-off-by: Andrea Gelmini <[email protected]> Closes #11774
* bash_completion.d: always call zfs/zpool binaries directlyнаб2021-04-073-9/+8
| | | | | | | | | | | | | | | /dev/zfs is 0:0 666 on most systems, so the [ -w /dev/zfs ] check always succeeds, but if zfs isn't in $PATH (e.g. when completing from "/sbin/zfs list" on a regular account) this can lead to error spew like nabijaczleweli@szarotka:~$ /sbin/zfs list bash: zfs: command not found @ bash: zfs: command not found We only do read-only commands, and quite general ones at that, so there's no need to elevate one way or another. Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Ahelenia Ziemiańska <[email protected]> Closes #11828
* Add RELEASES.md fileBrian Behlendorf2021-04-072-2/+39
| | | | | | | | | Document the project's policy regarding publishing and maintaining official OpenZFS releases. Reviewed-by: Tony Hutter <[email protected]> Reviewed-by: Matthew Ahrens <[email protected]> Signed-off-by: Brian Behlendorf <[email protected]> Closes #11821
* ZTS: inheritance/inherit_001_pos is flakyRyan Moeller2021-04-071-0/+1
| | | | | | | | Add inheritance/inherit_001_pos to the maybe fails on FreeBSD list. Reviewed-by: John Kennedy <[email protected]> Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Ryan Moeller <[email protected]> Closes #11830
* FreeBSD: Fix stable/12 after AT_BENEATH removalRyan Moeller2021-04-071-3/+1
| | | | | Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Ryan Moeller <[email protected]> Closes #11827
* Bump libzfs.so and libzpool.so versionsBrian Behlendorf2021-04-074-25/+25
| | | | | | | | | | | | | | | | | | | | | | | | Bump the library versions as advised by the libtool guidelines. https://www.gnu.org/software/libtool/manual/html_node/Updating-version-info.html Two new functions were added but no existing functions were changed, so we increase the version and the age (version:revision:age). Added functions (2): - boolean_t zpool_is_draid_spare(const char *); - zpool_compat_status_t zpool_load_compat(const char *, boolean_t *, char *, char *); Additionally bump the libzpool.so version information. This library is for internal use but we still want to update the version to track major changes to the interfaces. The libzfsbootenv, libuutil, libnvpair and libzfs_core libraries have not been updated. Reviewed-by: Richard Laager <[email protected]> Signed-off-by: Brian Behlendorf <[email protected]> Closes #11817
* Allow pool names that look like Solaris disk namesRyan Moeller2021-04-072-7/+1
| | | | | | | | | | | Nothing bad happens if a prefix of your pool name matches a disk name. This is a bit of a silly restriction at this point. Reviewed-by: Richard Laager <[email protected]> Reviewed-by: Brian Behlendorf <[email protected]> Reviewed-by: George Melikov <[email protected]> Signed-off-by: Ryan Moeller <[email protected]> Closes #11781 Closes #11813
* Don't scale zfs_zevent_len_max by CPU countRyan Moeller2021-04-072-9/+5
| | | | | | | | | | The lower bound for this scaling to too low and the upper bound is too high. Use a fixed default length of 512 instead, which is a reasonable value on any system. Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Ryan Moeller <[email protected]> Closes #11822
* Atomically check and set dropped zevent countRyan Moeller2021-04-071-2/+1
| | | | | | | | | ratelimit_dropped isn't protected by a lock and is expected to be updated atomically. Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Ryan Moeller <[email protected]> Closes #11822
* CI: Increase free space in workflowBrian Behlendorf2021-04-072-0/+12
| | | | | | | | | | | | | Recently we've been running out of free space in the ubuntu 20.04 environment resulting in test failures. This appears to be caused by a change in the default available free space and not because of any change in OpenZFS. Try and avoid this failure by applying a suggested workaround which removes some unnecessary files. https://github.com/actions/virtual-environments/issues/2840 Reviewed-by: George Melikov <[email protected]> Signed-off-by: Brian Behlendorf <[email protected]> Closes #11826
* Fixing m4 iops rename checkBrian Atkinson2021-04-071-0/+1
| | | | | | | | | The configure check for iops->rename wanting flags was missing the AC_MSG_CHECKING() so it would just print yes without saying what was being checked. Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Brian Atkinson <[email protected]> Closes #11825
* fsck.zfs: implement 4/8 exit codes as suggested in manpageнаб2021-04-075-20/+64
| | | | | | | | | | | | | Update the fsck.zfs helper to bubble up some already-known-about errors if they are detected in the pool. health=degraded => 4/"Filesystem errors left uncorrected" health=faulted && dataset in /etc/fstab => 8/"Operational error" pool not found => 8/"Operational error" everything else => 0 Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Ahelenia Ziemiańska <[email protected]> Closes #11806
* Add compatibility file sets (ZoL 0.6.1, 0.6.4, OpenZFS 2.1)Mike Swanson2021-04-075-0/+87
| | | | | | | | | | | ZoL 0.6.1 introduced feature flags with the three features that all implementations at the time were guaranteed to have. 0.6.4 introduced a few more until 0.6.5 added two after that. OpenZFS 2.1 added the dRAID feature. Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Mike Swanson <[email protected]> Closes #11818
* Tag 2.1.0-rc1zfs-2.1.0-rc1Brian Behlendorf2021-03-291-1/+1
| | | | | | | | | New features: - Distributed Spare (dRAID) Feature - Added "compatibility" property for zpool feature sets - Added zpool_influxdb command to collect zpool statistics Signed-off-by: Brian Behlendorf <[email protected]>
* zed: reap child after killing on time-outнаб2021-03-262-2/+3
| | | | | | | | | | | | When a child process is killed waitpid() must be called on the pid the reap the zombie process. Update BUGS section to reflect reality by replacing "zedlets aren't time limited with "zedlets can be interrupted". Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Ahelenia Ziemiańska <[email protected]> Closes #11769 Closes #11798
* Use a helper function to clarify gang block sizeMatthew Ahrens2021-03-264-11/+30
| | | | | | | | | | | | | For gang blocks, `DVA_GET_ASIZE()` is the total space allocated for the gang DVA including its children BP's. The space allocated at each DVA's vdev/offset is `vdev_psize_to_asize(vd, SPA_GANGBLOCKSIZE)`. This commit makes this relationship more clear by using a helper function, `vdev_gang_header_asize()`, for the space allocated at the gang block's vdev/offset. Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Matthew Ahrens <[email protected]> Closes #11744
* When specifying raidz vdev name, parity count should matchMatthew Ahrens2021-03-261-0/+30
| | | | | | | | | | | | | | When specifying the name of a RAIDZ vdev on the command line, it can be specified as raidz-<vdevID> or raidzP-<vdevID>. e.g. `zpool clear poolname raidz-0` or `zpool clear poolname raidz2-0` If the parity is specified in the vdev name, it should match the actual parity of that RAIDZ vdev, otherwise the command should fail. This commit makes it so. Reviewed-by: Brian Behlendorf <[email protected]> Co-authored-by: Stuart Maybee <[email protected]> Signed-off-by: Matthew Ahrens <[email protected]> Closes #11742
* Fix error code on __zpl_ioctl_setflags()Luis Henriques2021-03-261-1/+1
| | | | | | | | | | Other (all?) Linux filesystems seem to return -EPERM instead of -EACCESS when trying to set FS_APPEND_FL or FS_IMMUTABLE_FL without the CAP_LINUX_IMMUTABLE capability. This was detected by generic/545 test in the fstest suite. Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Luis Henriques <[email protected]> Closes #11791
* Support running FreeBSD buildworld on Arm-based macOS hostsJessica Clarke2021-03-261-0/+11
| | | | | | | | | Arm-based Macs are like FreeBSD and provide a full 64-bit stat from the start, so have no stat64 variants. Thus, define stat64 and fstat64 as aliases for the normal versions. Reviewed-by: Ryan Moeller <[email protected]> Signed-off-by: Jessica Clarke <[email protected]> Closes #11771
* Removed duplicated includesAndrea Gelmini2021-03-2215-20/+0
| | | | | | Reviewed-by: Matthew Ahrens <[email protected]> Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Andrea Gelmini <[email protected]> Closes #11775