aboutsummaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* tcp: Missing mfree in rack and bbrRandall Stewart2021-06-142-1/+6
| | | | | | | | | | | | | | | | | Recently (Nov) we added logic that protects against a peer negotiating a timestamp, and then not including a timestamp. This involved in the input path doing a goto done_with_input label. Now I suspect the code was cribbed from one in Rack that has to do with the SYN. This had a bug, i.e. it should have a m_freem(m) before going to the label (bbr had this missing m_freem() but rack did not). This then caused the missing m_freem to show up in both BBR and Rack. Also looking at the code referencing m->m_pkthdr.lro_nsegs later (after processing) is not a good idea, even though its only for logging. Best to copy that off before any frees can take place. Reviewed by: mtuexen Sponsored by: Netflix Inc Differential Revision: https://reviews.freebsd.org/D30727 (cherry picked from commit ba1b3e48f5be320f0590bc357ea53fdc3e4edc65)
* tcp: Mbuf leak while holding a socket buffer lock.Randall Stewart2021-06-144-52/+84
| | | | | | | | | | | | | | | | | | | | | | | When running at NF the current Rack and BBR changes with the recent commits from Richard that cause the socket buffer lock to be held over the ip_output() call and then finally culminating in a call to tcp_handle_wakeup() we get a lot of leaked mbufs. I don't think that this leak is actually caused by holding the lock or what Richard has done, but is exposing some other bug that has probably been lying dormant for a long time. I will continue to look (using his changes) at what is going on to try to root cause out the issue. In the meantime I can't leave the leaks out for everyone else. So this commit will revert all of Richards changes and move both Rack and BBR back to just doing the old sorwakeup_locked() calls after messing with the so_rcv buffer. We may want to look at adding back in Richards changes after I have pinpointed the root cause of the mbuf leak and fixed it. Reviewed by: mtuexen,rscheff Sponsored by: Netflix Inc Differential Revision: https://reviews.freebsd.org/D30704 (cherry picked from commit 67e892819b26c198e4232c7586ead7f854f848c5)
* tcp: LRO timestamps have lost their previous precisionRandall Stewart2021-06-143-12/+26
| | | | | | | | | | | | | Recently we had a rewrite to tcp_lro.c that was tested but one subtle change was the move to a less precise timestamp. This causes all kinds of chaos in tcp's that do pacing and needs to be fixed to use the more precise time that was there before. Reviewed by: mtuexen, gallatin, hselasky Sponsored by: Netflix Inc Differential Revision: https://reviews.freebsd.org/D30695 (cherry picked from commit b45daaea95abd8bda52caaacf120f9197caab3e7)
* arm64: Fix pmap_copy()'s handling of 2MB mappingsMark Johnston2021-06-141-5/+2
| | | | | | | | | | | | | | | | | | | | When copying mappings from parent to child, we clear the accessed and dirty bits. This is done for both 4KB and 2MB PTEs. However, pmap_demote_l2() asserts that writable superpages must be dirty. This is to avoid races with the MMU setting the dirty bit during promotion and demotion. pmap_copy() can create clean, writable superpage mappings, so it violates this assertion. Modify pmap_copy() to preserve the accessed and dirty bits when copying 2MB mappings, like we do on amd64. Fixes: ca2cae0b4dd Reported by: Jenkins via mhorne Reviewed by: alc, kib Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D30643 (cherry picked from commit 4e4035ef1fb5e2f9da6b658ffae8a54862b4d018)
* Fix handling of D_GIANTOKMark Johnston2021-06-141-4/+7
| | | | | | | | | | | | It was meant to suppress only the printf(), not the subsequent injection of Giant-protected thunks for various file operations. Fixes: fbeb4ccac9 Reported by: pho Tested by: pho Pointy hat: markj (cherry picked from commit 887c753c9f451322cae3efbf9b63f53f3d9011c8)
* riscv: Rename pmap_fault_fixup() to pmap_fault()Mark Johnston2021-06-143-3/+3
| | | | | | | | | | This is consistent with other platforms, specifically arm and arm64. No functional change intended. Reviewed by: jrtc27 Sponsored by: The FreeBSD Foundation (cherry picked from commit 317113bb125166f6ba3035a29408339af38cca54)
* arm: Remove last_fault_codeMark Johnston2021-06-141-8/+0
| | | | | | | | It is unused since the removal of pmap-v4.c in commit b88b275145. Sponsored by: The FreeBSD Foundation (cherry picked from commit 62ba0def5584bc1fc84fc7df6d7a1256e4a34fb8)
* riscv: Handle hardware-managed dirty bit updates in pmap_promote_l2()Mark Johnston2021-06-141-9/+32
| | | | | | | | | | | | | | | | | | | pmap_promote_l2() failed to handle implementations which set the accessed and dirty flags. In particular, when comparing the attributes of a run of 512 PTEs, we must handle the possibility that the hardware will set PTE_D on a clean, writable mapping. Following the example of amd64 and arm64, change riscv's pmap_promote_l2() to downgrade clean, writable mappings to read-only, so that updates are synchronized by the pmap lock. Fixes: f6893f09d Reported by: Nathaniel Filardo <nwf20@cl.cam.ac.uk> Tested by: Nathaniel Filardo <nwf20@cl.cam.ac.uk> Reviewed by: jrtc27, alc, Nathaniel Filardo Sponsored by: The FreeBSD Foundation (cherry picked from commit c05748e028b84c216d0161e70418f8cb09e074e4)
* Suppress D_NEEDGIANT warnings for some driversMark Johnston2021-06-144-3/+4
| | | | | | | | | | | | | | | | During boot we warn that the kbd and openfirm drivers are Giant-locked and may be deleted. Generally, the warning helps signal that certain old drivers are not being maintained and are subject to removal, but this doesn't really apply to certain drivers which are harder to detangle from Giant. Add a flag, D_GIANTOK, that devices can specify to suppress the misleading warning. Use it in the kbd and openfirm drivers. Reviewed by: imp, jhb Sponsored by: The FreeBSD Foundation (cherry picked from commit fbeb4ccac990fdb3bc26ab925a3ca8e7d2f89721)
* iwn: adjust EEPROM read timeout for Intel 4965AGN M2Radosław Chmielarz2021-06-141-2/+2
| | | | | | | | | | Reading EEPROM from Intel 4965AGN M2 takes 60 us which was causing panic on system startup. PR: 255465 Reviewed by: markj (cherry picked from commit 03d4b58feee396d392668f192ecdde08ecc8036c)
* ngatm: Handle errors from uni_msg_extend()Mark Johnston2021-06-141-2/+4
| | | | | | | | | | | uni_msg_extend() may fail due to a memory allocation failure. In this case, though, the message is freed, so callers shouldn't touch it. PR: 255861 Reviewed by: harti Sponsored by: The FreeBSD Foundation (cherry picked from commit e755e2776ddff729ae4102f3273473aa33b00077)
* arm64: Use the right PTE when downgrading perms in pmap_promote_l2()Mark Johnston2021-06-141-1/+10
| | | | | | | | | | | | | | | | | | When promoting a run of small mappings to a superpage, we have to downgrade clean, writable mappings to read-only, to handle the possibility that the MMU will concurrently mark one of the mappings as dirty. The code which performed this operation for the first PTE in the run used the wrong PTE pointer. As a result, the comparison would always fail, aborting the promotion. This only occurs when promoting writable, clean mappings. Fixes: ca2cae0b4dd Reviewed by: alc, kib Sponsored by: The FreeBSD Foundation (cherry picked from commit a48f51b3d396664f9b0a91f016159f4e4324da85)
* linuxkpi: Add list_for_each_entry_lockless() macroNeel Chauhan2021-06-142-1/+3
| | | | | | | | | This is needed by the drm-kmod 5.7 update. Approved by: hselasky (src) Differential Revision: https://reviews.freebsd.org/D30708 (cherry picked from commit b47f461c8e67253fdb394968428b760e880baa08)
* pf: Convenience function for optional (numeric) argumentsKristof Provost2021-06-142-21/+29
| | | | | | | | | | | | | | | | | Add _opt() variants for the uint* functions. These functions set the provided default value if the nvlist doesn't contain the relevant value. This is helpful for optional values (e.g. when the API is extended to add new fields). While here simplify the header by also using macros to create the prototypes for the macro-generated function implementations. Reviewed by: scottl MFC after: 2 weeks Sponsored by: Rubicon Communications, LLC ("Netgate") Differential Revision: https://reviews.freebsd.org/D30510 (cherry picked from commit 7c4342890bf17b72f0d79ada1326d9cbf34e736c)
* LinuxKPI: add pr_err_onceGreg V2021-06-141-0/+2
| | | | | | | | Reviewed by: hselasky, emaste MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D30672 (cherry picked from commit 05c2d94a081d5948560a01c26c7f432960cde606)
* tcp: fix two bugs in new renoMichael Tuexen2021-06-131-2/+4
| | | | | | | | | | | * Completely initialise the CC module specific data * Use beta_ecn in case of an ECN event whenever ABE is enabled or it is requested by the stack. Reviewed by: rscheff, rrs Sponsored by: Netflix, Inc. (cherry picked from commit fa3746be4203fc9a3414afb21d964eec8bad74f8)
* tcp: remove debug output from RACKMichael Tuexen2021-06-131-2/+0
| | | | | | | | | | Reported by: iron.udjin@gmail.com, Marek Zarychta Reviewed by: rrs PR: 256538 Differential Revision: https://reviews.freebsd.org/D30723 Sponsored by: Netflix, Inc. (cherry picked from commit f1536bb53898b12e2d19938f8fe2d04b5e5d12a6)
* tcp: fix compilation of IPv4-only buildsMichael Tuexen2021-06-131-0/+2
| | | | | | | | PR: 256538 Reported by: iron.udjin@gmail.com Sponsored by: Netflix, Inc. (cherry picked from commit 224cf7b35b9bbe8d075f6004249d850c620b7855)
* iwmbtfw(8): Improve Intel 7260/7265 adaptors handlingVladimir Kondratyev2021-06-133-48/+91
| | | | | | | | | | | | | | | - Allow firmware downloading for hw_variant #8; - Enter manufacturer mode for setting of event mask; - Handle multi-event response on HCI commands for 7260; This allows to remove kludge with skipping of 0xfc2f opcode. - Disable patch and exit manufacturer mode on downloading failure; - Use default firmware if correct firmware file is not found; Reviewed by: Philippe Michaud-Boudreault <pitwuu_AT_gmail_DOT_com> Tested by: arrowd Differential revision: https://reviews.freebsd.org/D30543 (cherry picked from commit da93a73f834612b659b37b513c8296e1178d249b)
* ums(4): Do not stop USB xfers on FIFO close when evdev is still activeVladimir Kondratyev2021-06-131-5/+8
| | | | | | | | | | | This fixes lose of evdev events after moused has been killed. While here use bitwise operations for UMS_EVDEV_OPENED flag. Reviewed by: hselasky Differential revision: https://reviews.freebsd.org/D30342 (cherry picked from commit 05ab03a31798d4cc96c22a8f30b1d9a0d7a3dd35)
* ums(4): Start USB xfers on opening of evdev node unconditionally.Vladimir Kondratyev2021-06-131-1/+1
| | | | | | | | | | This fixes inability to start USB xfers in a case when FIFO has been already open()-ed but no read() or poll() calls has been issued yet. MFC after: 2 weeks Differential revision: https://reviews.freebsd.org/D30343 (cherry picked from commit 47791339f0cfe3282a6f64b5607047f7bca968ad)
* usbhid(4): Add second set of USB transfers to work in polled mode.Vladimir Kondratyev2021-06-134-19/+73
| | | | | | | | | | The second set of USB transfer is requested by hkbd(4) and should improve HID keyboard handling in kdb and panic contexts. Reviewed by: hselasky Differential revision: https://reviews.freebsd.org/D30486 (cherry picked from commit 9aa0e5af75d033aa2dff763dd2886daaa7213612)
* usbhid(4): Fix NULL pointer dereference in usbd_xfer_max_len()Vladimir Kondratyev2021-06-131-15/+49
| | | | | | | | | | Which happens when USB transfer setup is failed. PR: 254974 Reviewed by: hselasky Differential revision: https://reviews.freebsd.org/D30485 (cherry picked from commit e889a462d878675551b227a382764c3879e6c2b3)
* Create VM_MEMATTR_DEVICE on all architecturesAndrew Turner2021-06-136-5/+6
| | | | | | | | | | | | | This is intended to be used with memory mapped IO, e.g. from bus_space_map with no flags, or pmap_mapdev. Use this new memory type in the map request configured by resource_init_map_request, and in pciconf. Reviewed by: kib Differential Revision: https://reviews.freebsd.org/D29692 (cherry picked from commit 5d2d599d3f3494d813e51e1bcd1c9693eb9c098b)
* pciconf: Use VM_MEMATTR_DEVICE on supported architecturesMarcin Wojtas2021-06-131-1/+5
| | | | | | | | | | | | | | | Some architectures - armv7, armv8 and riscv use VM_MEMATTR_DEVICE when mapping device registers in kernel. Do the same in pciconf. On armada8k SoC all reads from BARs mapped with hitherto attribute (VM_MEMATTR_UNCACHEABLE) return 0xff's. Submitted by: Kornel Duleba <mindal@semihalf.com> Reviewed by: kib Obtained from: Semihalf Sponsored by: Marvell Differential revision: https://reviews.freebsd.org/D29603 (cherry picked from commit 1c1ead9b94a1a731646327ec3b09e8f3acd577b8)
* zfs: merge openzfs/zfs@c3b60eded (zfs-2.1-release) into stable/13Martin Matuska2021-06-13250-13940/+11645
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Notable upstream pull request merges: #12015 Replace zstreamdump with zstream link #12046 Improve scrub maxinflight_bytes math. #12052 FreeBSD: incorporate changes to the VFS_QUOTACTL(9) KPI #12072 Let zfs diff be more permissive #12091 libzfs: On FreeBSD, use MNT_NOWAIT with getfsstat #12104 Reminder to update boot code after zpool upgrade #12114 Introduce write-mostly sums #12125 Modernise all (most) remaining .TH manpages #12145 More aggsum optimizations #12149 Multiple man-pages: Move to appropriate section #12158 Re-embed multilist_t storage #12177 Livelist logic should handle dedup blkptrs #12196 Unify manpage makefiles, move pages to better sexions, revisit some #12212 Remove pool io kstats Obtained from: OpenZFS OpenZFS commit: c3b60ededa6e6ce36a457a54451ca153c4c630dc OpenZFS tag: zfs-2.1.0-rc7
| * Tag 2.1.0-rc7Brian Behlendorf2021-06-101-1/+1
| | | | | | | | Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
| * Re-embed multilist_t storageAlexander Motin2021-06-1012-104/+99
| | | | | | | | | | | | | | | | | | | | | | | | | | This commit partially reverts changes to multilists in PR 7968 (multi-threaded spa-sync()) and adds some cache line alignments to separate read-only multilists and heavily modified refcount's to different cache lines. Reviewed-by: Matthew Ahrens <mahrens@delphix.com> Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Signed-off-by: Alexander Motin <mav@FreeBSD.org> Sponsored-by: iXsystems, Inc. Closes #12158
| * dracut: 90zfs: respect zfs_force=1 on systemd systemsнаб2021-06-106-22/+30
| | | | | | | | | | | | | | | | | | | | On systemd systems provide an environment generator in order to respect the zfs_force=1 kernel command line option. Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Reviewed-by: Tony Nguyen <tony.nguyen@delphix.com> Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz> Closes #11403 Closes #12195
| * Remove pool io kstatsAlexander Motin2021-06-1010-276/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This mostly reverts "3537 want pool io kstats" commit of 8 years ago. From one side this code using pool-wide locks became pretty bad for performance, creating significant lock contention in I/O pipeline. From another, there are more efficient ways now to obtain detailed statistics, while this statistics is illumos-specific and much less usable on Linux and FreeBSD, reported only via procfs/sysctls. This commit does not remove KSTAT_TYPE_IO implementation, that may be removed later together with already unused KSTAT_TYPE_INTR and KSTAT_TYPE_TIMER. Reviewed-by: Matthew Ahrens <mahrens@delphix.com> Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Signed-off-by: Alexander Motin <mav@FreeBSD.org> Sponsored-By: iXsystems, Inc. Closes #12212
| * Added error for writing to /dev/ on LinuxRich Ercolani2021-06-102-2/+37
| | | | | | | | | | | | | | | | | | | | | | | | Starting in Linux 5.10, trying to write to /dev/{null,zero} errors out. Prefer to inform people when this happens rather than hoping they guess what's wrong. Reviewed-by: Antonio Russo <aerusso@aerusso.net> Reviewed-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz> Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Reviewed-by: John Kennedy <john.kennedy@delphix.com> Signed-off-by: Rich Ercolani <rincebrain@gmail.com> Closes: #11991
| * libzfs: format safetyнаб2021-06-106-65/+52
| | | | | | | | | | | | | | Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Reviewed-by: Ryan Moeller <ryan@iXsystems.com> Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz> Closes #12116
| * zgenhostid.8: revisitнаб2021-06-101-27/+33
| | | | | | | | | | | | | | Reviewed-by: Richard Laager <rlaager@wiktel.com> Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz> Closes #12212
| * Consistentify miscellaneous style on remaining manpagesнаб2021-06-108-64/+65
| | | | | | | | | | | | | | | | | | Most notably this fixes the vdev_id(8) non-.Xrs in vdev_id.conf.5 Reviewed-by: Richard Laager <rlaager@wiktel.com> Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz> Closes #12212
| * Move properties, parameters, events, and concepts around manual sectionsнаб2021-06-1050-582/+543
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The pages moved as follows: zpool-features.{5 => 7} spl{-module-parameters.5 => .4} zfs{-module-parameters.5 => .4} zfs-events.5 => into zpool-events.8 zfsconcepts.{8 => 7} zfsprops.{8 => 7} zpoolconcepts.{8 => 7} zpoolprops.{8 => 7} Reviewed-by: Richard Laager <rlaager@wiktel.com> Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz> Co-authored-by: Daniel Ebdrup Jensen <debdrup@FreeBSD.org> Closes #12149 Closes #12212
| * man: use one Makefile, use OpenZFS for .Osнаб2021-06-105-134/+116
| | | | | | | | | | | | | | | | | | | | | | | | | | The prevailing style is to use either nothing, or the originating organisational umbrella (here: OpenZFS), and these aren't Linux manpages This also deduplicates the substitution code, and makes adding/removing sexions simpler in future Reviewed-by: Richard Laager <rlaager@wiktel.com> Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz> Closes #12212
| * Fix minor shellcheck 0.7.2 warningsBrian Behlendorf2021-06-103-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The first warning of a misspelling is a false positive, so we annotate the script accordingly. As for the x-prefix warnings update the check to use the conventional '[ -z <string> ]' syntax. all-syslog.sh:46:47: warning: Possible misspelling: ZEVENT_ZIO_OBJECT may not be assigned, but ZEVENT_ZIO_OBJSET is. [SC2153] make_gitrev.sh:53:6: note: Avoid x-prefix in comparisons as it no longer serves a purpose [SC2268] man-dates.sh:10:7: note: Avoid x-prefix in comparisons as it no longer serves a purpose [SC2268] Reviewed-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz> Reviewed-by: John Kennedy <john.kennedy@delphix.com> Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov> Closes #12208
| * zed.d/history_event-zfs-list-cacher.sh.in: parallelise, simplifyнаб2021-06-091-10/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This: (a) improves the error log message, (b) locks per pool instead of globally, (c) locks the actual output file instead of /var/lock/zfs-list, which would otherwise linger there forever (well, still will, but you can remove it and it won't come back), and (d) preserves attributes of the output file instead of reverting them to 0:0 644 It is imperative that the previous commit ("zed-functions.sh: zed_lock(): don't truncate lock") be included in any series that contains this one Reviewed-by: Tony Hutter <hutter2@llnl.gov> Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz> Closes #12042
| * zed.d/all-debug.sh: simplifyнаб2021-06-092-10/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | By locking the log file itself, we can omit arduous rebinding and explicit umask setting, but, perhaps more importantly, avoid permanently littering /var/lock/ with zed.debug.log.lock we will never delete It is imperative that the previous commit ("zed-functions.sh: zed_lock(): don't truncate lock") be included in any series that contains this one Reviewed-by: Tony Hutter <hutter2@llnl.gov> Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz> Closes #12042
| * zed-functions.sh: zed_lock(): don't truncate lockнаб2021-06-091-1/+1
| | | | | | | | | | | | | | | | | | | | | | By appending instead of truncating, we can lock on any file (with write permissions) instead of only dedicated lock files, since the locking process itself no longer alters the file in any way Reviewed-by: Tony Hutter <hutter2@llnl.gov> Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz> Closes #12042
| * libzfs: On FreeBSD, use MNT_NOWAIT with getfsstatAlan Somers2021-06-095-2/+53
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | `getfsstat(2)` is used to retrieve the list of mounted file systems, which libzfs uses when fetching properties like mountpoint, atime, setuid, etc. The `mode` parameter may be `MNT_NOWAIT`, which uses information in the VFS's cache, or `MNT_WAIT`, which effectively does a `statfs` on every single mounted file system in order to fetch the most up-to-date information. As far as I can tell, the only fields that libzfs cares about are the filesystem's name, mountpoint, fstypename, and mount flags. Those things are always updated on mount and unmount, so they will always be accurate in the VFS's mount cache except in two circumstances: 1) When a file system is busy unmounting 2) When a ZFS file system changes the value of a mount-overridable property like atime or setuid, but doesn't remount the file system. Right now that only happens when the property is changed by an unprivileged user who has delegated authority to change the property but not to mount the dataset. But perhaps libzfs could choose to do it for other reasons in the future. Switching to `MNT_NOWAIT` will greatly improve speed with no downside, as long as we explicitly update the mount cache whenever we change a mount-overridable property. For comparison, Illumos gets this information using the native `getmntany` and `getmntent` functions, which also use cached information. The illumos function that would refresh the cache, `resetmnttab`, is never called by libzfs. And on GNU/Linux, `getmntany` and `getmntent` don't even communicate with the kernel directly. They simply parse the file they are given, which is usually /etc/mtab or /proc/mounts. Perhaps the implementation of /proc/mounts is synchronous, ala MNT_WAIT; I don't know. Sponsored-by: Axcient Reviewed-by: Ryan Moeller <ryan@iXsystems.com> Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Signed-off-by: Alan Somers <asomers@gmail.com> Closes: #12091
| * Modernise/fix/rewrite unlinted manpagesнаб2021-06-0911-5530/+3144
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | zpool-destroy.8: flatten, fix description zfs-wait.8: flatten, fix description, use list for events zpool-reguid.8: flatten, fix description zpool-history.8: flatten, fix description zpool-export.8: flatten, fix description, remove -f "unmount" reference AFAICT no such command exists even in Illumos (as of today, anyway), and we definitely don't call it zpool-labelclear.8: flatten, fix description zpool-features.5: modernise spl-module-parameters.5: modernise zfs-mount-generator.8: rewrite zfs-module-parameters.5: modernise Reviewed-by: Richard Laager <rlaager@wiktel.com> Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz> Closes #12169
| * Force --enable-debug on FreeBSD if INVARIANTS is setRich Ercolani2021-06-091-0/+17
| | | | | | | | | | | | | | | | | | | | | | There's already logic to force INVARIANTS on for building if it's present in the running kernel; however, not having DEBUG enabled when DEBUG and INVARIANTS are can cause strange panics. Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Reviewed-by: Ryan Moeller <ryan@iXsystems.com> Signed-off-by: Rich Ercolani <rincebrain@gmail.com> Closes #12185 Closes #12163
| * Livelist logic should handle dedup blkptrsSerapheim Dimitropoulos2021-06-094-64/+210
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Update the logic to handle the dedup-case of consecutive FREEs in the livelist code. The logic still ensures that all the FREE entries are matched up with a respective ALLOC by keeping a refcount for each FREE blkptr that we encounter and ensuring that this refcount gets to zero by the time we are done processing the livelist. zdb -y no longer panics when encountering double frees Reviewed-by: Matthew Ahrens <mahrens@delphix.com> Reviewed-by: John Kennedy <john.kennedy@delphix.com> Reviewed-by: Don Brady <don.brady@delphix.com> Signed-off-by: Serapheim Dimitropoulos <serapheim@delphix.com> Closes #11480 Closes #12177
| * More aggsum optimizationsAlexander Motin2021-06-095-63/+129
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Avoid atomic_add() when updating as_lower_bound/as_upper_bound. Previous code was excessively strong on 64bit systems while not strong enough on 32bit ones. Instead introduce and use real atomic_load() and atomic_store() operations, just an assignments on 64bit machines, but using proper atomics on 32bit ones to avoid torn reads/writes. - Reduce number of buckets on large systems. Extra buckets not as much improve add speed, as hurt reads. Unlike wmsum for aggsum reads are still important. Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Reviewed-by: Ryan Moeller <ryan@iXsystems.com> Signed-off-by: Alexander Motin <mav@FreeBSD.org> Sponsored-By: iXsystems, Inc. Closes #12145
| * libzfs: write_inuse_diffs_one: format strerror() with "%s"наб2021-06-091-2/+3
| | | | | | | | | | | | | | | | | | Fixes 50353dbd ("Let zfs diff be more permissive") which accidentally introduced a build warning. Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Reviewed-by: Tony Nguyen <tony.nguyen@delphix.com> Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz> Closes #12197
| * i-t: don't try to import from empty cacheнаб2021-06-091-1/+2
| | | | | | | | | | | | | | | | | | Chases 7c64ee9e7731b7ad39e300b4a422892dbe8d4b23 ("zfs-import-{cache,scan}: change condition to FileNotEmpty") Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz> Closes #12108
| * Use %%/* instead of awk -F/ {print $1} to strip datasetsнаб2021-06-093-3/+3
| | | | | | | | | | | | Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz> Closes #12108
| * dracut: 90zfs: zfs-load-key: don't load unencrypted bootfs' keylocationнаб2021-06-091-3/+2
| | | | | | | | | | | | | | Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz> Closes #11800 Closes #12108
| * dracut: 90zfs: module-setup: try /lib*/libgcc_s.so*, relax /u/l/gcc pathнаб2021-06-091-3/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | SUSE stores the library at /lib64/libgcc_s.so.1 (/lib/libgcc_s.so.1 for i686 glibc), which is in the search path Also relax the /usr/lib path to catch systems similar to SUSE (/usr/lib64/gcc/x86_64-suse-linux/10/libgcc_s.so) but without the top-level lib64 Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz> Closes #11750 Closes #12108