]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
4 months agoUpdate to bmake-20240108
Simon J. Gerraty [Sun, 14 Jan 2024 01:31:01 +0000 (17:31 -0800)]
Update to bmake-20240108

4 months agoImport bmake-20240108
Simon J. Gerraty [Sun, 14 Jan 2024 01:16:25 +0000 (17:16 -0800)]
Import bmake-20240108

Interesting/relevant changes since bmake-20230909

* VERSION (_MAKE_VERSION): 20240106
Merge with NetBSD make, pick up
o fix duplicate progname when reporting an unknown target
o unit tests for Cmd_Exec using temp file

* VERSION (_MAKE_VERSION): 20240105
Merge with NetBSD make, pick up
o main.c: Cmd_Exec write cmd to a file if too big
avoid blowing commandline/env limits

* VERSION (_MAKE_VERSION): 20240101
o util.c: flesh out more of strftime
* configure.in: add --with-bmake-strftime
it is not a full implementation but enough to pass all
the unit-tests.
* parse.c: LoadFile do not append \n to empty buffer.

* VERSION (_MAKE_VERSION): 20231230
Merge with NetBSD make, pick up
o simplify memory allocation for string buffers
o fix declared types of list nodes
o suff.c: clean up freeing of suffixes
o var.c: simplify debug message for the ':@var@...@' modifier
clean up variable handling

* VERSION (_MAKE_VERSION): 20231226
Merge with NetBSD make, pick up
o compat.c: ensure make's output is correctly ordered with that of
the target when not going to a tty
o main.c: check for shellPath whether to call Shell_Init()

* VERSION (_MAKE_VERSION): 20231224
Merge with NetBSD make, pick up
o compat.c: check for shellPath whether to call Shell_Init()
tweak the unit test to detect the bug thus fixed.
o make.1: do not claim .SHELL is only used by jobs mode.

* VERSION (_MAKE_VERSION): 20231220
Merge with NetBSD make, pick up
o str.c: speed up pattern matching in the ':M' modifier
o var.c: fix confusing debug logging when deleting a variable
use consistent debug messages style when ignoring variables

* VERSION (_MAKE_VERSION): 20231210
Merge with NetBSD make, pick up
o var.c: avoid segfault on empty :C match expression
explain in debug log why variable assignment is ignored.

* VERSION (_MAKE_VERSION): 20231208
Merge with NetBSD make, pick up
o var.c: ensure fromCmd is set correctly for variables set on
command line.

* VERSION (_MAKE_VERSION): 20231124
Merge with NetBSD make, pick up
o main.c: cleanup processing of -j
fix lint warning about strchr
o var.c: more accurate error message for invalid ':mtime' argument
cleanup :[...] modifier
avoid reading beyond substring when comparing
o unit-tests cover all cases of :mtime, test and explain exporting
of variables
o cleanup comments

* bsd.after-import.mk (ECHO_TAG): FreeBSD no longer uses
$FreeBSD$ tag, so avoid adding it.

mk/ChangeLog since bmake-20230909

* dirdeps.mk: for MAKE_VERSION 20240105 we do not have the same
limits on command line length, so skip export of lists to env.

* jobs.mk: avoid C suffix in JOB_MAX_C if factor is floating
point.  This keeps JOB_MAX numeric incase another makefile does
comparisons.

* gendirdeps.mk: if META_XTRAS is passed to us, add to META_FILES

4 months agoAdd a regression test for PR 276191.
Alan Somers [Mon, 8 Jan 2024 01:03:40 +0000 (18:03 -0700)]
Add a regression test for PR 276191.

The bug isn't fusefs-specific, but this is the easiest way to reproduce
it.

PR: 276191
MFC after: 1 week
MFC with: bdb46c21a3e68d4395d6e0b6a205187e655532b0
Differential Revision:  https://reviews.freebsd.org/D43446
Reviewed by:  kib

4 months agovm/vm_object.c: minor cleanup
Konstantin Belousov [Sat, 13 Jan 2024 01:44:39 +0000 (03:44 +0200)]
vm/vm_object.c: minor cleanup

Remove sys/cdefs.h and sys/socket.h includes.
Order sys/ includes alphabetically.
Do not check for NULL before free().

Reviewed by: markj
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
DIfferential revision: https://reviews.freebsd.org/D43444

4 months agoman(1): support spaces in filenames
Wolfram Schneider [Sat, 13 Jan 2024 16:16:55 +0000 (16:16 +0000)]
man(1): support spaces in filenames

The globbing function in exists() needs to handle white spaces.

PR:          275978
Reviewed by: kevans, bapt, emaste
MFC after:   1 week

4 months agopmap_init(9): drop MLINKS reference
Robert Wing [Fri, 12 Jan 2024 17:29:15 +0000 (17:29 +0000)]
pmap_init(9): drop MLINKS reference

fix the build

4 months agolibc: stop exposing __fcntl_compat
Brooks Davis [Sat, 13 Jan 2024 00:00:24 +0000 (00:00 +0000)]
libc: stop exposing __fcntl_compat

It was exposed (under FBSDprivate_1.0) for forward compatability in
threading libraries in 2008 by commit cd7d66a21f1a.  The last consumer
was removed in 2015 by commit 8495e8b1e9e1.  I missed this among the _
and __sys_ symbols in commit e2417a21a025.

Reviewed by: imp, kib
Differential Revision: https://reviews.freebsd.org/D43408

4 months agoStop using expressions in _Alignof()
Minsoo Choo [Fri, 12 Jan 2024 23:37:53 +0000 (15:37 -0800)]
Stop using expressions in _Alignof()

_Alignof(expression) is a non-standard extension.  This is not allowed
in gnu11 and gnu17 which follow the C11 standard _Alignof(type).

Reviewed by: arichardson, imp, jhb
Fixes: 4a9cd9fc22d7 amd64 db_trace: Reject unaligned frame pointers
Fixes: 7ccaf76a27f1 riscv db_trace: Ensure trapframe pointer is suitably aligned.
Fixes: 638c68897fbd arm64 db_trace: Ensure trapframe pointer is suitably aligned.
Differential Revision: https://reviews.freebsd.org/D43409

4 months agomixer.8: Add terse example for increasing volume
Alexander Ziaee [Fri, 12 Jan 2024 17:12:19 +0000 (12:12 -0500)]
mixer.8: Add terse example for increasing volume

Reviewed by: jhb
Pull Request: https://github.com/freebsd/freebsd-src/pull/1044

4 months agocd9660: Add support for mask,dirmask,uid,gid options
Ricardo Branco [Mon, 8 Jan 2024 20:24:53 +0000 (21:24 +0100)]
cd9660: Add support for mask,dirmask,uid,gid options

Reviewed by: jhb
Pull Request: https://github.com/freebsd/freebsd-src/pull/982

4 months agopmap_init(9): sweep references to pmap_init2()
Robert Wing [Tue, 9 Jan 2024 04:50:47 +0000 (19:50 -0900)]
pmap_init(9): sweep references to pmap_init2()

gone since 2005

4 months agopmap_pinit(9): sweep references to pmap_pinit2()
Robert Wing [Tue, 9 Jan 2024 04:07:59 +0000 (19:07 -0900)]
pmap_pinit(9): sweep references to pmap_pinit2()

gone since 2004

4 months agosanitizers: Avoid building genassym.c and genoffset.c with sanitizers
Mark Johnston [Tue, 10 Oct 2023 18:14:46 +0000 (14:14 -0400)]
sanitizers: Avoid building genassym.c and genoffset.c with sanitizers

Some, particularly KASAN, may insert redzones around global symbols,
resulting in incorrect offset definitions because genassym.sh (ab)uses
symbol sizes to assign semantic meaning.

(Ideally I would be able to define this pattern in one place, but I
haven't found a way to define a GENSYM_CFLAGS that actually works for
all of the consumers (kern.post.mk, kmod.mk, sys/conf/files*).)

MFC after: 1 week
Sponsored by: Klara, Inc.
Sponsored by: Juniper Networks, Inc.

4 months agosystm: Relax __result_use_check annotations
Mark Johnston [Fri, 12 Jan 2024 15:07:28 +0000 (10:07 -0500)]
systm: Relax __result_use_check annotations

When compiling with gcc, functions annotated this way can not have their
return values cast away, e.g., with `(void)copyout(...)`.  clang permits
it but gcc does not.  Since we have a number of such casts for calls
which copy data out of the kernel, and since failing to check for errors
when copying *in* is a much more severe bug, remove some of the
annotations in order to make the gcc build happy.

Reviewed by: kib
Reported by: Jenkins
Fixes: 8e36732e6eb5 ("systm: Annotate copyin() and related functions with __result_use_check")
Differential Revision: https://reviews.freebsd.org/D43418

4 months agofb: Check for errors from copyin()
Mark Johnston [Fri, 12 Jan 2024 15:09:22 +0000 (10:09 -0500)]
fb: Check for errors from copyin()

When compiling with gcc, a function annotated with __result_use_check
cannot have its return value ignored with a void cast.  So, try to
handle it.

MFC after: 1 week

4 months agobhyveload(8): document some SECURITY CONSIDERATIONS
Kyle Evans [Fri, 12 Jan 2024 19:57:53 +0000 (13:57 -0600)]
bhyveload(8): document some SECURITY CONSIDERATIONS

The situation is improved now that we're running in a sandbox, but there
is still some host machine access that could be concerning depending on
the context.  These concerns may be somewhat mitigated by the fact that
the host machine usually provides the loader binary, even when the guest
image is providing the loader scripts -- they only bring the lua
scripts, and they have to be able to execute arbitrary syscalls rather
than the interfaces provided by libsa(3).

Reviewed by: jhb, markj
Differential Revision: https://reviews.freebsd.org/D43299

4 months agoMAINTAINERS: Add myself for nvme entries, remove jimharris
Warner Losh [Fri, 12 Jan 2024 19:07:28 +0000 (12:07 -0700)]
MAINTAINERS: Add myself for nvme entries, remove jimharris

Jim Harris no longer has a commit bit and has moved on from being the
FreeBSD nvme driver maintainer at Intel. I've been reviewing things
so I'll take that up.

Sponsored by: Netflix

4 months agoMAINTAINERS, etc: Remove hselasky entries
Warner Losh [Fri, 12 Jan 2024 19:02:28 +0000 (12:02 -0700)]
MAINTAINERS, etc: Remove hselasky entries

Sadly, Hans-Peter has passed away. Remove his entries out of respect for
his many years of service to the project.

4 months agosystem(3): fix typo santized -> sanitized
Steve Kargl [Fri, 12 Jan 2024 18:26:40 +0000 (11:26 -0700)]
system(3): fix typo santized -> sanitized

PR: 276262
Reviewed by: imp

4 months agologin: Missed an instance of getpwnam().
Dag-Erling Smørgrav [Fri, 12 Jan 2024 16:40:55 +0000 (17:40 +0100)]
login: Missed an instance of getpwnam().

Fixes: a3d80dd8aa6ac15877e00102ab174b417ac81d79
MFC after: 1 week
Sponsored by: Klara, Inc.
Reviewed by: allanjude
Differential Revision: https://reviews.freebsd.org/D43423

4 months agouniq: Error out if writing to the output failed.
Dag-Erling Smørgrav [Fri, 12 Jan 2024 15:40:48 +0000 (16:40 +0100)]
uniq: Error out if writing to the output failed.

MFC after: 1 week
Sponsored by: Klara, Inc.
Reviewed by: kevans
Differential Revision: https://reviews.freebsd.org/D43407

4 months agouniq: Clean up and test obsolete options.
Dag-Erling Smørgrav [Fri, 12 Jan 2024 15:40:40 +0000 (16:40 +0100)]
uniq: Clean up and test obsolete options.

MFC after: 1 week
Sponsored by: Klara, Inc.
Reviewed by: kevans
Differential Revision: https://reviews.freebsd.org/D43402

4 months agouniq: Fix interactive use.
Dag-Erling Smørgrav [Fri, 12 Jan 2024 15:40:33 +0000 (16:40 +0100)]
uniq: Fix interactive use.

Output a line as soon as it is possible to determine that it will have
to be output.  For the basic case, this means output each line as it is
read unless it is identical to the previous one.  For the -d case, it
means output the first instance as soon as the second is read, unless
the -c option was also given.  The -D and -u cases were already fine.

Add test cases for interactive use with no options and with -d.

Explicitly ignore -d when -D is also specified.

MFC after: 1 week
Sponsored by: Klara, Inc.
Reviewed by: rew, kevans
Differential Revision: https://reviews.freebsd.org/D43382

4 months agouniq: Replace NetBSD's unit tests with our own.
Dag-Erling Smørgrav [Fri, 12 Jan 2024 15:40:26 +0000 (16:40 +0100)]
uniq: Replace NetBSD's unit tests with our own.

These new tests cover more functionality and are easier to extend.

MFC after: 1 week
Sponsored by: Klara, Inc.
Reviewed by: emaste
Differential Revision: https://reviews.freebsd.org/D43381

4 months agologin: Use getpwnam_r() instead of getpwnam().
Dag-Erling Smørgrav [Fri, 12 Jan 2024 15:40:22 +0000 (16:40 +0100)]
login: Use getpwnam_r() instead of getpwnam().

Since we expect the entry to still be valid after calling into PAM,
which may call getpwnam() itself, we need to use getpwnam_r().

MFC after: 1 week
Sponsored by: Klara, Inc.
Reviewed by: kevans, imp, allanjude, markj
Differential Revision: https://reviews.freebsd.org/D43376

4 months agotests: add a test for shutdown(2) on a datagram socket
Gleb Smirnoff [Fri, 12 Jan 2024 10:04:04 +0000 (02:04 -0800)]
tests: add a test for shutdown(2) on a datagram socket

4 months agodivert: just return EOPNOTSUPP on shutdown(2)
Gleb Smirnoff [Fri, 12 Jan 2024 10:04:04 +0000 (02:04 -0800)]
divert: just return EOPNOTSUPP on shutdown(2)

Before this change we would always return ENOTCONN.  There is no
legitimate use of shutdown(2) on divert(4).

4 months agoprotosw: remove unneeded include
Gleb Smirnoff [Fri, 12 Jan 2024 10:04:04 +0000 (02:04 -0800)]
protosw: remove unneeded include

4 months agoxen: improve man (4) page
Roger Pau Monné [Tue, 9 Jan 2024 09:26:06 +0000 (10:26 +0100)]
xen: improve man (4) page

Update the xen(4) man page to reflect the current support status.

Reported by: kevans
Reviewed by: bcr kevans imp
Differential revision: https://reviews.freebsd.org/D43373

4 months agoRevert "kerberos: Fix numerous segfaults when using weak crypto"
Cy Schubert [Fri, 12 Jan 2024 07:39:02 +0000 (23:39 -0800)]
Revert "kerberos: Fix numerous segfaults when using weak crypto"

This revision breaks Linux and MacOS cross builds because
TARGET_ENDIANNESS is not define during bootstrapping on these
platforms.

I think the correct approach would be to separate the new
fbsd_ossl_provider_load() and unload functions into their own
library (instead of libroken). This avoids the less desirable
option of including bsd.cpu.mk in secure/lib/Makefile.common,
which does build but could complicate future work.

Reported by: jrtc27

This reverts commit cb350ba7bf7ca7c4cb97ed2c20ab45af60382cfb.

4 months agofind: fix build on 32bits
Baptiste Daroussin [Fri, 12 Jan 2024 06:34:28 +0000 (07:34 +0100)]
find: fix build on 32bits

4 months agoreleng-gce: Advertise the availability of gVNIC support in GCE images.
Xin LI [Fri, 12 Jan 2024 05:38:04 +0000 (21:38 -0800)]
releng-gce: Advertise the availability of gVNIC support in GCE images.

This marks FreeBSD GCE images as gVNIC capable by adding the
--guest-os-features=GVNIC flag at creation time as suggested in GCE
documentation[1].  This allows Generation 3 and newer GCE instances
to leverage advanced networking capabilities and performance
enhancements provided by gVNIC.  Users will benefit from these
improvements without needing to create custom images.

[1] https://cloud.google.com/compute/docs/networking/using-gvnic#create_a_vm_with_gvnic_support

Reviewed by: cperciva
MFC after: 3 days
Differential Revision: https://reviews.freebsd.org/D43411

4 months agoUPDATING: Add an entry for the __FreeBSD_version bump to 1500010
Rick Macklem [Fri, 12 Jan 2024 00:53:46 +0000 (16:53 -0800)]
UPDATING: Add an entry for the __FreeBSD_version bump to 1500010

4 months agoparam.h: Bump __FreeBSD_version to 1500010
Rick Macklem [Fri, 12 Jan 2024 00:48:23 +0000 (16:48 -0800)]
param.h: Bump __FreeBSD_version to 1500010

Commit cc760de2183f changed the internal interface between
the nfscommon and nfscl modules.  As such, both need to be
rebuilt from sources.  Therefore, bump __FreeBSD_version.

4 months agonfscl: Only update atime for Copy when noatime is not specified
Rick Macklem [Fri, 12 Jan 2024 00:38:33 +0000 (16:38 -0800)]
nfscl: Only update atime for Copy when noatime is not specified

Commit 57ce37f9dcd0 modified the NFSv4.2 Copy operation so that
it will update atime on the infd file whenever possible.
This is done by adding a Setattr of TimeAccess for the
input file.

This patch disables this change for the case of an NFSv4.2
mount with the "noatime" mount option, which avoids the
additional Setattr of TimeAccess operation.

MFC after: 1 week

4 months agofind: add SIGINFO handler
Goran Mekić [Thu, 11 Jan 2024 22:35:25 +0000 (15:35 -0700)]
find: add SIGINFO handler

Print number of files processed and path currently being processed on
SIGINFO.

Reviewed by: des, asomers
Sponsored by: Axcient
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D43380

4 months agoktls: fix vnet-related panic in ktls_reset_receive_tag()
Martin Matuska [Thu, 11 Jan 2024 20:31:15 +0000 (21:31 +0100)]
ktls: fix vnet-related panic in ktls_reset_receive_tag()

Reviewed by: gallatin, jhb
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D43400

4 months agoconf: Do not set -fno-sanitize-memory-param-retval for old compilers
Mark Johnston [Thu, 11 Jan 2024 16:42:47 +0000 (11:42 -0500)]
conf: Do not set -fno-sanitize-memory-param-retval for old compilers

The option was introduced in LLVM 16.

Fixes: b6c653c97463 ("kmsan: Set -fno-sanitize-memory-param-retval for now")
MFC after: 1 week
Sponsored by: Klara, Inc.
Sponsored by: Juniper Networks, Inc.

4 months agolibc: separate syscall and non-syscall symbols
Brooks Davis [Thu, 11 Jan 2024 18:27:20 +0000 (18:27 +0000)]
libc: separate syscall and non-syscall symbols

Put declerations of _ and __sys_ prefixed stubs at the top and
everything else at the bottom.  Sort the bottom list with sort(1).
This paves the way to generate the syscall symbol list.

Reviewed by: kib
Sponsored by: DARPA
Differential Revision: https://reviews.freebsd.org/D43386

4 months agopowerpc/SYS.h: implement _SYSCALL_BODY() macro
Brooks Davis [Thu, 11 Jan 2024 18:27:20 +0000 (18:27 +0000)]
powerpc/SYS.h: implement _SYSCALL_BODY() macro

Add _SYSCALL_BODY() macro which invokes the syscall via _SYCALL() and
calls cerror as required.  Use to implement PSEUDO() and RSYSCALL().

Reviewed by: jhibbits
Sponsored by: DARPA
Differential Revision: https://reviews.freebsd.org/D43323

4 months agoAdd vnode_pager_clean_{a,}sync(9)
Konstantin Belousov [Mon, 8 Jan 2024 05:18:40 +0000 (07:18 +0200)]
Add vnode_pager_clean_{a,}sync(9)

Bump __FreeBSD_version for ZFS use.

Reviewed by: markj
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D43356

4 months agotop: Avoid printing a blank line when the ZFS ARC is empty
Mark Johnston [Thu, 11 Jan 2024 14:58:31 +0000 (09:58 -0500)]
top: Avoid printing a blank line when the ZFS ARC is empty

PR: 275994
MFC after: 2 weeks

4 months agokerberos: Fix numerous segfaults when using weak crypto
Cy Schubert [Wed, 6 Dec 2023 15:30:05 +0000 (07:30 -0800)]
kerberos: Fix numerous segfaults when using weak crypto

Weak crypto is provided by the openssl legacy provider which is
not load by default. Load the legacy providers as needed.

When the legacy provider is loaded into the default context the default
provider will no longer be automatically loaded. Without the default
provider the various kerberos applicaions and functions will abort().

PR: 272835
MFC after: 3 days
Differential Revision: https://reviews.freebsd.org/D43009
Tested by: netchild, Joerg Pulz <Joerg.Pulz@frm2.tum.de>

4 months agovnode_pager_generic_putpages(): rename maxblksz local to max_offset
Konstantin Belousov [Tue, 9 Jan 2024 11:32:39 +0000 (13:32 +0200)]
vnode_pager_generic_putpages(): rename maxblksz local to max_offset

Requested by: markj
Reviewed by: alc, markj
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D43358

4 months agovnode_pager_generic_putpages(): correctly handle clean block at EOF
Konstantin Belousov [Mon, 8 Jan 2024 13:21:06 +0000 (15:21 +0200)]
vnode_pager_generic_putpages(): correctly handle clean block at EOF

The loop 'skip clean blocks' checking for the clean blocks in the dirty
pages might end up setting the in_hole to true when exactly at EOF at
the middle of the block, without advancing the prev_offset value. Then
the next block is not dirty, and next_offset is clipped back to poffset
+ maxsize, equal to prev_offset, failing the assertion.

Instead of asserting prev_offset < next_offset, we must skip the write.

Reported by: asomers
PR: 276191
Reviewed by: alc, markj
Tested by: asomers
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D43358

4 months agonetlink: fix bug with socket buffer character counter underflow
Gleb Smirnoff [Thu, 11 Jan 2024 04:51:53 +0000 (20:51 -0800)]
netlink: fix bug with socket buffer character counter underflow

Cover case when an nb that we are now reading in full had been partially
read by previous read(2) and now has positive offset.  Throw couple
assertions that helped to catch that earlier.

4 months agonetlink: avoid putting empty mbufs on the socket queue
Gleb Smirnoff [Thu, 11 Jan 2024 04:51:53 +0000 (20:51 -0800)]
netlink: avoid putting empty mbufs on the socket queue

When processing incoming Netlink messages in nl_process_nbuf() kernel
always allocates a writer with a buffer to put generated reply to.
However, certain messages aren't replied.  That makes nlmsg_flush()
to put an empty buffer to the socket.  Avoid doing that because avoiding
is much easier than dealing with empty buffers on the receiver side.

4 months agonetlink: improve edge case when reading out truncated last nlmsg in nb
Gleb Smirnoff [Thu, 11 Jan 2024 04:51:53 +0000 (20:51 -0800)]
netlink: improve edge case when reading out truncated last nlmsg in nb

When there is not enough space for one full message we return it truncated.
This enters special block of code that previously may leave empty buffer
with offset == datalen in the queue.  Avoid that, as dealing later with
empty buffers causes more pain than just avoiding them.  While here add
missing msgrcv increment.

4 months agotests/netlink: improve recently added netlink_socket:membership
Gleb Smirnoff [Thu, 11 Jan 2024 04:51:53 +0000 (20:51 -0800)]
tests/netlink: improve recently added netlink_socket:membership

Change sequence of syscalls: instead of "add, delete, check, check"
run sequence "add, check, delete, check".  Seems to make more sense.

Do minimal parsing of incoming messages: find the IPv4 address there
and compare it to the original.

4 months agotests/netlink: mark a test that requires tun(4)
Gleb Smirnoff [Thu, 11 Jan 2024 04:51:53 +0000 (20:51 -0800)]
tests/netlink: mark a test that requires tun(4)

4 months agotests/net: enable if_clone_test:epair_ipv6_up_stress
Gleb Smirnoff [Thu, 11 Jan 2024 04:51:53 +0000 (20:51 -0800)]
tests/net: enable if_clone_test:epair_ipv6_up_stress

The panic mentioned was fixed in f5a365e51feea75d1e5ebc86c53808d8cae7b6d7.

PR: 225438

4 months agoacpi/apm: Improve APM ioctl interface emulation
Warner Losh [Wed, 3 Jan 2024 23:18:23 +0000 (16:18 -0700)]
acpi/apm: Improve APM ioctl interface emulation

The apm(8) program documents certain states, but doesn't document the
'unknown' state. It reports things correctly for systems with a battery,
but incorrectly for systems without one. Emulate the old interface a
little better by saying ac power is online if we have no status (instead
of unknown), the battery has a high charge of 255% if there's no battery
(instead of -1). Programs, like emacs, expect to see only the documented
values and misbehave when they see something else.

This is closer to what would happen on old-school APM machines. Sadly
(or not) I have no access to old-school APM machines to 100% confirm
this, but reading the spec, old code and testing with emacs' mode line
with battery suggests these values are more correct. emacs has never
been converted to acpi_conf due to permissions issues with acpi devices.

Fixing the kernel is preferable to hacking apm(8) for these special
cases because other programs that use these interfaces will also be more
correct. The kernel also has more data with which to decide what to
return.

Sponsored by: Netflix
MFC After: 1 week

4 months agodtrace tests: Diff expected and actual output upon a miscompare
Mark Johnston [Wed, 10 Jan 2024 21:38:30 +0000 (16:38 -0500)]
dtrace tests: Diff expected and actual output upon a miscompare

This makes quick diagnosis of test failures easier.

MFC after: 1 week

4 months agodtrace tests: Catch up with ping(8) output changes
Mark Johnston [Wed, 10 Jan 2024 21:38:00 +0000 (16:38 -0500)]
dtrace tests: Catch up with ping(8) output changes

MFC after: 1 week

4 months agodtrace tests: Require perl
Mark Johnston [Wed, 10 Jan 2024 20:22:14 +0000 (15:22 -0500)]
dtrace tests: Require perl

A number of tests use it, so just require it globally as we do with
other tools.

MFC after: 1 week

4 months agodtrace tests: Stop hard-coding an incorrect path to sleep(1)
Mark Johnston [Wed, 10 Jan 2024 20:19:22 +0000 (15:19 -0500)]
dtrace tests: Stop hard-coding an incorrect path to sleep(1)

MFC after: 1 week

4 months agodtrace tests: Run ksh with -p
Mark Johnston [Tue, 9 Jan 2024 15:39:39 +0000 (10:39 -0500)]
dtrace tests: Run ksh with -p

In particular, avoid loading the user's .profile file, since that can
have undesirable side effects.  Most tests were already careful to do
this.

MFC after: 1 week

4 months agodtrace: Add the 'oformat' libdtrace option
Domagoj Stolfa [Wed, 3 Jan 2024 14:58:01 +0000 (14:58 +0000)]
dtrace: Add the 'oformat' libdtrace option

This option can be used to specify a format to use in DTrace output.
The following formats are supported:
 - json
 - xml
 - html
 - none (default DTrace output)

This is implemented using libxo and integrated into libdtrace. Client
code only works with the following API:

 - dtrace_oformat_setup(dtrace_hdl_t *) -- to be called when output is starting.
 - dtrace_oformat_teardown(dtrace_hdl_t *) -- to be called when output is finished
 - dtrace_oformat(dtrace_hdl_t *) -- check if oformat is enabled.
 - dtrace_set_outfp(FILE *) -- sets the output file for oformat.
 - Ensure that oformat is correctly checked in the drop handler and record
   processing callbacks.

This commit also adds tests which check if the generated output is
valid (JSON, XML) and extends the dtrace(1) describing the structured output.

Reviewed by: markj
Discussed with: phil
MFC after: 2 months
Sponsored by: Innovate UK
Differential Revision: https://reviews.freebsd.org/D41745

4 months agosyscon: Move syscon code in dev/syscon
Emmanuel Vadot [Tue, 26 Dec 2023 17:58:15 +0000 (18:58 +0100)]
syscon: Move syscon code in dev/syscon

We've removed kernel option EXT_RESOURCES almost two years ago.
While it was ok to have some code under a common 'extres' subdirectory
at first, we now have a lot of consumer of it and we made it mandatory
so no need to have it under a cryptic name.

Reviewed by: mhorne
Sponsored by:   Beckhoff Automation GmbH & Co. KG
Differential Revision: https://reviews.freebsd.org/D43196

4 months agophy: Move phy code in dev/phy
Emmanuel Vadot [Tue, 26 Dec 2023 17:56:52 +0000 (18:56 +0100)]
phy: Move phy code in dev/phy

We've removed kernel option EXT_RESOURCES almost two years ago.
While it was ok to have some code under a common 'extres' subdirectory
at first, we now have a lot of consumer of it and we made it mandatory
so no need to have it under a cryptic name.

Reviewed by: emaste, imp
Sponsored by:   Beckhoff Automation GmbH & Co. KG
Differential Revision: https://reviews.freebsd.org/D43195

4 months agoregulator: Move regulator code in dev/regulator
Emmanuel Vadot [Tue, 26 Dec 2023 17:54:53 +0000 (18:54 +0100)]
regulator: Move regulator code in dev/regulator

We've removed kernel option EXT_RESOURCES almost two years ago.
While it was ok to have some code under a common 'extres' subdirectory
at first, we now have a lot of consumer of it and we made it mandatory
so no need to have it under a cryptic name.

Reviewed by: emaste, imp
Sponsored by:   Beckhoff Automation GmbH & Co. KG
Differential Revision: https://reviews.freebsd.org/D43194

4 months agonvmem: Move nvmem code in dev/nvmem
Emmanuel Vadot [Tue, 26 Dec 2023 17:51:22 +0000 (18:51 +0100)]
nvmem: Move nvmem code in dev/nvmem

We've removed kernel option EXT_RESOURCES almost two years ago.
While it was ok to have some code under a common 'extres' subdirectory
at first, we now have a lot of consumer of it and we made it mandatory
so no need to have it under a cryptic name.

Reviewed by: dab, imp
Sponsored by:   Beckhoff Automation GmbH & Co. KG
Differential Revision: https://reviews.freebsd.org/D43193

4 months agohwreset: Move reset code in dev/hwreset
Emmanuel Vadot [Tue, 26 Dec 2023 17:49:19 +0000 (18:49 +0100)]
hwreset: Move reset code in dev/hwreset

We've removed kernel option EXT_RESOURCES almost two years ago.
While it was ok to have some code under a common 'extres' subdirectory
at first, we now have a lot of consumer of it and we made it mandatory
so no need to have it under a cryptic name.

Reviewed by: imp
Sponsored by:   Beckhoff Automation GmbH & Co. KG
Differential Revision: https://reviews.freebsd.org/D43192

4 months agoclk: Move clock code in dev/clk
Emmanuel Vadot [Tue, 26 Dec 2023 17:43:48 +0000 (18:43 +0100)]
clk: Move clock code in dev/clk

We've removed kernel option EXT_RESOURCES almost two years ago.
While it was ok to have some code under a common 'extres' subdirectory
at first, we now have a lot of consumer of it and we made it mandatory
so no need to have it under a cryptic name.

Reviewed by: mhorne
Sponsored by: Beckhoff Automation GmbH & Co. KG
Differential Revision: https://reviews.freebsd.org/D43191

4 months agousb: dwc3: Move driver under a subdirectory
Emmanuel Vadot [Mon, 25 Dec 2023 20:06:41 +0000 (21:06 +0100)]
usb: dwc3: Move driver under a subdirectory

dwc3 is big enough to have its own subdirectory.
While here only make it depend on kernel option dwc3 and rk_dwc3
without any SOC options.

Sponsored by: Beckhoff Automation GmbH & Co. KG
Differential Revision: https://reviews.freebsd.org/D43190

4 months agoclk: Move rockchip driver into the common directory
Emmanuel Vadot [Mon, 25 Dec 2023 19:27:20 +0000 (20:27 +0100)]
clk: Move rockchip driver into the common directory

No need to keep it under sys/arm64/rockchip/clk
It's easier to find which controller we support by looking under one directory.

Sponsored by:   Beckhoff Automation GmbH & Co. KG
Differential Revision: https://reviews.freebsd.org/D43189

4 months agoclk: Move allwinner driver into the common directory
Emmanuel Vadot [Mon, 25 Dec 2023 19:01:52 +0000 (20:01 +0100)]
clk: Move allwinner driver into the common directory

No need to keep it under sys/arm/allwinner/clkng
It's easier to find which controller we support by looking under one directory.
It will also be shared with Allwinner RiscV SoC.

Sponsored by:   Beckhoff Automation GmbH & Co. KG
Differential Revision: https://reviews.freebsd.org/D43188

4 months agopwm: Move allwinner driver into the common directory
Emmanuel Vadot [Mon, 25 Dec 2023 18:42:03 +0000 (19:42 +0100)]
pwm: Move allwinner driver into the common directory

No need to keep it under sys/arm/allwinner
It's easier to find which controller we support by looking under one directory.

Sponsored by:   Beckhoff Automation GmbH & Co. KG
Differential Revision: https://reviews.freebsd.org/D43187

4 months agopwm: Move rockchip driver into the common directory
Emmanuel Vadot [Mon, 25 Dec 2023 18:38:54 +0000 (19:38 +0100)]
pwm: Move rockchip driver into the common directory

No need to keep it under sys/arm64/rockchip
It's easier to find which controller we support by looking under one directory.

Sponsored by:   Beckhoff Automation GmbH & Co. KG
Differential Revision: https://reviews.freebsd.org/D43186

4 months agospibus: Move allwinner driver into the common directory
Emmanuel Vadot [Mon, 25 Dec 2023 18:33:02 +0000 (19:33 +0100)]
spibus: Move allwinner driver into the common directory

No need to keep it under sys/arm/allwinner
It's easier to find which controller we support by looking under one directory.

Sponsored by:   Beckhoff Automation GmbH & Co. KG
Differential Revision: https://reviews.freebsd.org/D43185

4 months agospibus: Move rockchip driver into the common directory
Emmanuel Vadot [Mon, 25 Dec 2023 18:30:05 +0000 (19:30 +0100)]
spibus: Move rockchip driver into the common directory

No need to keep it under sys/arm64/rockchip
It's easier to find which controller we support by looking under one directory.

Sponsored by:   Beckhoff Automation GmbH & Co. KG

4 months agoiicbus: Move rockchip driver into the common directory
Emmanuel Vadot [Mon, 25 Dec 2023 18:21:52 +0000 (19:21 +0100)]
iicbus: Move rockchip driver into the common directory

No need to keep it under sys/arm64/rockchip
It's easier to find which controller we support by looking under one directory.
While here remove the condition on SOC option, device rk_i2c is enough as all
Rockchip SoC that we support have this controller.

Sponsored by: Beckhoff Automation GmbH & Co. KG
Differential Revision: https://reviews.freebsd.org/D43184

4 months agocr_bsd_visible(): Style fixes
Olivier Certner [Fri, 5 Jan 2024 15:23:19 +0000 (16:23 +0100)]
cr_bsd_visible(): Style fixes

Explicitly test for non-zero return codes.

Separate assignment and testing of 'error' in distinct lines.

Reviewed by:            emaste, kib
Approved by:            emaste (mentor)
MFC after:              1 week
Sponsored by:           The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D43335

4 months agopthread_attr_get_np(3): Revamp
Olivier Certner [Fri, 5 Jan 2024 13:14:48 +0000 (14:14 +0100)]
pthread_attr_get_np(3): Revamp

Fix and more thoroughly describe the attributes object lifecycle.

Also, correct the text about which attributes' values are reported.

Add the ENOMEM error.

While here, rephrase unclear passages, add references and fix the
example's style.

Reviewed by:            kib, emaste
Approved by:            emaste (mentor)
MFC after:              2 weeks
Sponsored by:           The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D43330

4 months agopthread_attr_get_np(): Use malloc(), report ENOMEM, don't tamper on error
Olivier Certner [Thu, 4 Jan 2024 17:45:52 +0000 (18:45 +0100)]
pthread_attr_get_np(): Use malloc(), report ENOMEM, don't tamper on error

Similarly as in the previous commit, using calloc() instead of malloc()
is useless here in the regular case since the subsequent call to
cpuset_getaffinify() is going to completely fill the allocated memory.

However, there is an additional complication.  This function tries to
allocate memory to hold the cpuset if it previously wasn't, and does so
before the thread lock is acquired, which can fail on a bad thread ID.
In this case, it is necessary to deallocate the memory allocated in this
function so that the attributes object appears unmodified to the caller
when an error is returned.  Without this, a subsequent call to
pthread_attr_getaffinity_np() would expose uninitialized memory (not
a security problem per se, since it comes from the same process) instead
of returning a full mask as it would before the failing call to
pthread_attr_get_np().  So the caller would be able to notice a change
in the state of the attributes object even if pthread_attr_get_np()
reported failure, which would be quite surprising.  A similar problem
that could occur on failure of cpuset_setaffinity() has been fixed.

Finally, we shall always report memory allocation failure.  This already
goes for pthread_attr_init(), so, if for nothing else, just be
consistent.

Reviewed by:            emaste, kib
Approved by:            emaste (mentor)
MFC after:              2 weeks
Sponsored by:           The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D43329

4 months agovendor/bc: upgrade to version 6.7.5
Stefan Eßer [Thu, 4 Jan 2024 23:07:46 +0000 (00:07 +0100)]
vendor/bc: upgrade to version 6.7.5

This update fixes a bug that line breaks in printed numbers may not
match the line length set by the user. The value is printed correctly,
just not split as specified in some situations.

(cherry picked from commit 52a5ec1b178fd07651446c7e31b1512794a04dbf)

4 months agovendor/bc: upgrade to version 6.7.4
Stefan Eßer [Tue, 2 Jan 2024 13:05:20 +0000 (14:05 +0100)]
vendor/bc: upgrade to version 6.7.4

Documentation updates only, no functional changes to the software.

(cherry picked from commit a3f3a7b4dc80d577e4c8fc64dfbbb359d2e24228)

4 months agovendor/bc: upgrade to version 6.7.2
Stefan Eßer [Mon, 30 Oct 2023 09:10:24 +0000 (10:10 +0100)]
vendor/bc: upgrade to version 6.7.2

This update improves the implementation of the power function p() and
adds 3 new functions to the extended math library: min(), max(), and
i2rand().

(cherry picked from commit 0b4a06ab29a0da80f6cb5c99189054cb8e2f756c)

4 months agoperiodic: Fix periodic reports when log files are not compressed.
Yoshihiro Takahashi [Wed, 10 Jan 2024 11:48:56 +0000 (20:48 +0900)]
periodic: Fix periodic reports when log files are not compressed.

The modern zcat(1) is capable of handling compressed and uncompressed
text files, so we can simply use zcat command.

PR: 253168
Reviewed by: delphij
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D43357

4 months agozfs: merge openzfs/zfs@a382e2119
Martin Matuska [Wed, 10 Jan 2024 08:07:45 +0000 (09:07 +0100)]
zfs: merge openzfs/zfs@a382e2119

Notable upstream pull request merges:
 #15693 a382e2119 Add Gotify notification support to ZED
 #15732 e78aca3b3 Fix livelist assertions for dedup and cloning
 #15733 7ecaa0758 make zdb_decompress_block check decompression reliably
 #15735 255741fc9 Improve block sizes checks during cloning

Obtained from: OpenZFS
OpenZFS commit: a382e21194c1690951d2eee8ebd98bc096f01c83

4 months agotcpsso: fix when used without -i option
Michael Tuexen [Wed, 10 Jan 2024 07:33:09 +0000 (08:33 +0100)]
tcpsso: fix when used without -i option

Since fdb987bebddf it is not possible anymore to use inp_next
iterator for bound, but unconnected sockets. This applies
to TCP listening sockets. Therefore the metioned commit broke
tcpsso on listening sockets if the -i option was not used.
Fix this by iterating through all endpoints instead of only
through the bound, but unconnected ones.

Reviewed by: markj
Fixes: fdb987bebddf ("inpcb: Split PCB hash tables")
Sponsored by: Netflix, Inc.
Differential Revision: https://reviews.freebsd.org/D43353

4 months agoHistory for arc4random_*()
David E. O'Brien [Sat, 6 Jan 2024 06:01:00 +0000 (22:01 -0800)]
History for arc4random_*()

4 months agotests/netlink: add minimal test for a group writer
Gleb Smirnoff [Wed, 10 Jan 2024 00:56:51 +0000 (16:56 -0800)]
tests/netlink: add minimal test for a group writer

Subscribe a socket for RTNLGRP_IPV4_ROUTE announcements, add & delete
a route and check that announcements came in.

4 months agopowerpc64/SYS.h: implement _SYSCALL_BODY() macro
Brooks Davis [Tue, 9 Jan 2024 19:37:42 +0000 (19:37 +0000)]
powerpc64/SYS.h: implement _SYSCALL_BODY() macro

Add _SYSCALL_BODY() macro which invokes the syscall via _SYCALL() and
calls cerror as required.  Use to implement PSEUDO() and RSYSCALL().

Reviewed by: jhibbits
Sponsored by: DARPA
Differential Revision: https://reviews.freebsd.org/D43322

4 months agosocket_msg_trunc: allocate a large enough buffer
Brooks Davis [Tue, 9 Jan 2024 19:35:37 +0000 (19:35 +0000)]
socket_msg_trunc: allocate a large enough buffer

Allocate 9000 bytes to match the largest requsted size.  Add a check to
prevent the list of sizes and buffer size from getting out of sync
again.

Reviewed by: markj
Found with: CheriBSD
Differential Revision: https://reviews.freebsd.org/D43340

4 months agoigb(4): Remove disconnected SYSCTL
Marius Strobl [Tue, 9 Jan 2024 22:01:46 +0000 (23:01 +0100)]
igb(4): Remove disconnected SYSCTL

The global hw.igb.rx_process_limit knob never was adhered to by the
in-tree version of this driver but similar functionality is available
via the device-specific dev.igb.N.iflib.rx_budget.

While at it, remove the - besides initialization of tx_process_limit -
unused {r,t}x_process_limit members.

4 months agoe1000(4): Remove disconnected SYSCTL
Marius Strobl [Tue, 9 Jan 2024 21:41:49 +0000 (22:41 +0100)]
e1000(4): Remove disconnected SYSCTL

The global hw.em.rx_process_limit knob has been replaced by the device-
specific dev.IF.N.iflib.rx_budget along with the conversion to iflib(4).

While at it, remove the - besides initialization of tx_process_limit -
unused {r,t}x_process_limit members.

4 months agocxgbe(4): Use the correct size for the CIM LA on the T6.
Navdeep Parhar [Tue, 9 Jan 2024 21:22:16 +0000 (13:22 -0800)]
cxgbe(4): Use the correct size for the CIM LA on the T6.

The logic analyzer in the T6 CIM block has a different capture size than
previous chips.

MFC after: 1 week
Sponsored by: Chelsio Communications

4 months agoapei: Mark ReadAckRegister resource as shareable
Andrew Gallatin [Tue, 9 Jan 2024 20:52:07 +0000 (15:52 -0500)]
apei: Mark ReadAckRegister resource as shareable

Work around vendors who use the same address for multiple
ReadAckRegisters in their ACPI HEST table.  This
allows apei to attach cleanly on Ampere Altra servers.
Note the issue is not specific to Ampere, I've run into
it with at least one other vendor (whose server is not
yet released).

Sponsored by: Netflix
Reviewed by: jhb

4 months agonetlink: fix regression with group writers
Gleb Smirnoff [Tue, 9 Jan 2024 21:01:28 +0000 (13:01 -0800)]
netlink: fix regression with group writers

Refactoring of argument list to nl_send_one() led to derefercing
wrong union member.  Rename nl_send_one() to a more generic name,
isolate anew nl_send_one() as the callback only for the normal
writer and provide correct argument to nl_send() from nl_send_group().

Fixes: ff5ad900d2a0793659241eee96be53e6053b5081

4 months agopowerpc_mmu_radix: add leaf page for wired mappings when pmap_enter(psind=1)
Robert Wing [Tue, 9 Jan 2024 20:12:38 +0000 (11:12 -0900)]
powerpc_mmu_radix: add leaf page for wired mappings when pmap_enter(psind=1)

This applies the fix to powerpc's pmap as was done in commit aa3bcaad51076ceb
and d0941ed9b5c39d92 for amd64 and riscv pmaps, respectively.

Reported by:    Jenkins
Reviewed by: bojan.novkovic_fer.hr, markj
Fixes: e4078494f344bcba8709216bd601efa3dd05f6b3
Differential Revision: https://reviews.freebsd.org/D43339

4 months agoacpi: Only reserve resources enumerated via _CRS
John Baldwin [Tue, 9 Jan 2024 19:23:10 +0000 (11:23 -0800)]
acpi: Only reserve resources enumerated via _CRS

In particular, don't reserve resources added by drivers via other
means (e.g. acpi_bus_alloc_gas which calls bus_alloc_resource
right after adding the resource).

The intention of reserved resources is to ensure that a resource range
that a bus driver knows is assigned to a device is reserved by the
system even if no driver is attached to the device.  This prevents
other "wildcard" resource requests from conflicting with these
resources.  For ACPI, the only resources the bus driver knows about
for unattached devices are the resources returned from _CRS.  All of
these resources are already reserved now via acpi_reserve_resources
called from acpi_probe_children.

As such, remove the logic from acpi_set_resource to try to reserve
resources when they are set.  This permits RF_SHAREABLE to work with
acpi_bus_alloc_gas without requiring hacks like the current one for
CPU device resources in acpi_set_resource.

Reported by: gallatin (RF_SHAREABLE not working)
Diagnosed by: jrtc27

4 months agomemdesc: Helper function to construct mbuf chain backed by memdesc buffer
John Baldwin [Tue, 9 Jan 2024 19:05:03 +0000 (11:05 -0800)]
memdesc: Helper function to construct mbuf chain backed by memdesc buffer

memdesc_alloc_ext_mbufs constructs a chain of external (M_EXT or
M_EXTPG) mbufs backed by a data buffer described by a memory
descriptor.

Since memory descriptors are not an actual buffer just a description
of a buffer, the caller is required to supply a couple of helper
routines to manage allocation of the raw mbufs and associating them
with a reference to the underlying buffer.

Reviewed by: markj
Sponsored by: Chelsio Communications
Differential Revision: https://reviews.freebsd.org/D42933

4 months agosys: Use mbufq_empty instead of comparing mbufq_len against 0
John Baldwin [Tue, 9 Jan 2024 19:00:46 +0000 (11:00 -0800)]
sys: Use mbufq_empty instead of comparing mbufq_len against 0

Reviewed by: bz, emaste
Sponsored by: Chelsio Communications
Differential Revision: https://reviews.freebsd.org/D43338

4 months agombuf: Add mbufq_empty
John Baldwin [Tue, 9 Jan 2024 19:00:19 +0000 (11:00 -0800)]
mbuf: Add mbufq_empty

Complement to the existing mbufq_full

Reviewed by: bz
Sponsored by: Chelsio Communications
Differential Revision: https://reviews.freebsd.org/D43337

4 months agonet80211 amdpu: Simplify a few loops that drain an mbufq
John Baldwin [Tue, 9 Jan 2024 18:59:48 +0000 (10:59 -0800)]
net80211 amdpu: Simplify a few loops that drain an mbufq

These loops already handled a NULL return from mbufq_dequeue when the
queue was empty, so remove a redundant check of mbufq_len before
dequeueing.

Reviewed by: bz
Sponsored by: Chelsio Communications
Differential Revision: https://reviews.freebsd.org/D43336

4 months agokldxref: Workaround incorrect PT_DYNAMIC in existing powerpc kernels
John Baldwin [Tue, 9 Jan 2024 18:57:48 +0000 (10:57 -0800)]
kldxref: Workaround incorrect PT_DYNAMIC in existing powerpc kernels

Existing powerpc kernels include additional sections beyond .dynamic
in the PT_DYNAMIC segment.  Relax the requirement for an exact size
match of the section and segment for PowerPC files as a workaround.

Reported by: jrtc27
Sponsored by: DARPA
Differential Revision: https://reviews.freebsd.org/D43123

4 months agobsdinstall: Fix installation script splitting
Michael Gmelin [Sat, 6 Jan 2024 16:55:31 +0000 (17:55 +0100)]
bsdinstall: Fix installation script splitting

This allows writing setup scripts that contain lines starting with
"#!", e.g., a shebang when creating a shell script using cat:

    #!/bin/sh
    echo "Populate rc.local"
    cat >/etc/rc.local<<EOF
    #!/bin/sh
    echo booted | logger -s -t 'example'
    EOF

Prevent accidentally running a setup script left behind by a
previous invocation of bsdinstall.

Reviewed by: imp, jrtc27
Differential Revision: https://reviews.freebsd.org/D43350

4 months agoAdd Gotify notification support to ZED
gofaster [Tue, 9 Jan 2024 17:49:30 +0000 (12:49 -0500)]
Add Gotify notification support to ZED

This commit adds the zed_notify_gotify() function and hooks it
into zed_notify(). This will allow ZED to send notifications
to a self-hosted Gotify service, which can be received
on a desktop or mobile device. It is configured with ZED_GOTIFY_URL,
ZED_GOTIFY_APPTOKEN and ZED_GOTIFY_PRIORITY variables in zed.rc.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: gofaster <felix.gofaster@gmail.com>
Closes #15693

4 months agoFix livelist assertions for dedup and cloning
Alexander Motin [Tue, 9 Jan 2024 17:48:40 +0000 (12:48 -0500)]
Fix livelist assertions for dedup and cloning

Two block pointers in livelist pointing to the same location may
be caused not only by dedup, but also by block cloning. We should
not assert D bit set in them.

Two block pointers in livelist pointing to the same location may
have different logical birth time in case of dedup or cloning. We
should assert identical physical birth time instead.

Assert identical physical block size between pointers in addition
to checksum, since that is what checksums are calculated on.

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 #15732