In case of error dmu_buf_fill_done() returns the buffer back into
DB_UNCACHED state. Since during transition from DB_UNCACHED into
DB_FILL state dbuf_noread() allocates an ARC buffer, we must free
it here, otherwise it will be leaked.
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Jorgen Lundman <lundman@lundman.net>
Signed-off-by: Alexander Motin <mav@FreeBSD.org>
Sponsored by: iXsystems, Inc.
Closes#15665Closes#15802Closes#16216
At the end of l2arc_evict() fix an assertion in the case that l2ad_hand
+ distance == l2ad_end.
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: George Amanakis <gamanakis@gmail.com>
Closes#16202Closes#16207
C99 6.7.8.17 says that when an undesignated initialiser is used, only
the first element of a union is initialised. If the first element is not
the largest within the union, how the remaining space is initialised is
up to the compiler.
GCC extends the initialiser to the entire union, while Clang treats the
remainder as padding, and so initialises according to whatever
automatic/implicit initialisation rules are currently active.
When Linux is compiled with CONFIG_INIT_STACK_ALL_PATTERN,
-ftrivial-auto-var-init=pattern is added to the kernel CFLAGS. This flag
sets the policy for automatic/implicit initialisation of variables on
the stack.
Taken together, this means that when compiling under
CONFIG_INIT_STACK_ALL_PATTERN on Clang, the "zero" initialiser will only
zero the first element in a union, and the rest will be filled with a
pattern. This is significant for aes_ctx_t, which in
aes_encrypt_atomic() and aes_decrypt_atomic() is initialised to zero,
but then used as a gcm_ctx_t, which is the fifth element in the union,
and thus gets pattern initialisation. Later, it's assumed to be zero,
resulting in a hang.
As confusing and undiscoverable as it is, by the spec, we are at fault
when we initialise a structure containing a union with the zero
initializer. As such, this commit replaces these uses with an explicit
memset(0).
Sponsored-by: Klara, Inc.
Sponsored-by: Wasabi Technology, Inc.
Reviewed-by: Tino Reichardt <milky-zfs@mcmilk.de>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Rob Norris <rob.norris@klarasystems.com>
Closes#16135Closes#16206
If a shrink or truncate had recently freed a portion of the ZAP, the
dbuf could still be sitting on the dbuf cache waiting for eviction. If
it is then allocated for a new leaf before it can be evicted, the
zap_leaf_t is still attached as userdata, tripping the VERIFY.
Instead, just check for the userdata, and if we find it, reuse it.
Sponsored-by: Klara, Inc.
Sponsored-by: iXsystems, Inc.
Reviewed-by: Alexander Motin <mav@FreeBSD.org>
Signed-off-by: Rob Norris <rob.norris@klarasystems.com>
Closes#16157.
Closes#16204
Since Linux 6.7 the kernel has defined intptr_t. Clang has
-Wtypedef-redefinition by default, which causes the build to fail
because we also have a typedef for intptr_t.
Since its better to use the kernel's if it exists, detect it and skip
our own.
Sponsored-by: https://despairlabs.com/sponsor/
Reviewed-by: Tino Reichardt <milky-zfs@mcmilk.de>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Rob Norris <robn@despairlabs.com>
Closes#16201
On 32-bit platforms long long is generally 64-bits. Sufficiently modern
versions of gcc (13 in my testing) complains when casting a pointer to
an integer of a different width so cast to uintptr_t first to avoid the
warning.
Fixes: c183d164aa Parallel pool import
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Don Brady <don.brady@klarasystems.com>
Signed-off-by: Brooks Davis <brooks.davis@sri.com>
Closes#16203
Even though block cloning is much faster than regular copying,
it is not instantaneous - the file might be large and the recordsize
small. It would be nice to be able to interrupt it with a signal
(e.g., SIGINFO on FreeBSD to see the progress).
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Pawel Jakub Dawidek <pawel@dawidek.net>
Closes#16208
There are two improvements to the TCP blackhole support:
(1) If net.inet.tcp.blackhole is set to 2, also sent no RST whenever
a segment is received on an existing closed socket or if there is
a port mismatch when using UDP encapsulation.
(2) If net.inet.tcp.blackhole is set to 3, no RST segment is sent in
response to incoming segments on closed sockets or in response to
unexpected segments on listening sockets.
Thanks to gallatin@ for suggesting such an improvement.
Reviewed by: gallatin
MFC after: 1 week
Sponsored by: Netflix, Inc.
Differential Revision: https://reviews.freebsd.org/D45304
related to the page tables page allocation and mapping.
Sponsored by: The FreeBSD Foundation
Sponsored by: Advanced Micro Devices (AMD)
MFC after: 1 week
Allow these files to be included in C++ programs with careful casting to
the proper type, like C++ wants (and in a way that also works for C).
MFC After: 1 week
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/1245
Previously, it was necessary to set WITHOUT_INET_SUPPORT when building
the kernel without INET, and WITHOUT_INET6_SUPPORT when building the
kernel without INET6, or else the modules build would fail. The
LINT-NOINET and LINT-NOINET6 configs did this using makeoptions.
After recent changes, this is no longer required, so remove these
makeoptions. This avoids masking potential future build issues when
these aren't set.
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/1255
syscons is not compatible with UEFI boot. This is noted in syscons(4),
but not mentioned in vt(4) where the kern.vty tunable (used to select vt
or sc) is documented. Add a note so that if someone reads vt(4) but not
sc(4) they are not surprised by having no usable console.
PR: 276206
Reviewed by: brooks
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D45357
To fix WITHOUT_NIS build. Building yp_xdr.c is gated by MK_NIS.
PR: 279270
Reported by: peterj
Reported by: matteo
Reported by: Michael Dexter's Build Option Survey run
Reviewed by: brooks
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D45347
In vm_pageout_scan_inactive, release the object lock when we go to
refill the scan batch queue so that someone else has a chance to acquire
it. This improves access latency to the object when the pagedaemon is
processing many consecutive pages from a single object, and also in any
case avoids a hiccup during refill for the last touched object.
Reviewed by: alc, markj (previous version)
Sponsored by: Dell EMC Isilon
Differential Revision: https://reviews.freebsd.org/D45288
When possible, we split up I/Os to NVMe drives that advertise a
preferred alignment. Add a counter for this.
Sponsored by: Netflix
Reviewed by: chuck, mav
Differential Revision: https://reviews.freebsd.org/D45311
When biofinish calls g_io_deliver with an error of ENOMEM, that kicks
off the slowdown protocol, forcing I/O to go through g_down rather than
be directly dispatch. One of the side effects is that the I/O is
resubmitted, so the start routines get called recursively, leading to a
recursive lock panic. Rather than make the periph lock recursive, drop
and reacquire the lock around such calls to biofinish.
For nda, this happens only when we can't allocate space to construct a
TRIM. For ada and da, this is only for certain ZONE operations.
Sponsored by: Netflix
Reviewed by: gallatin
Differential Revision: https://reviews.freebsd.org/D45310
Update to eliminate bogus min to ensure 0 was never passed to
pause. Instead, requrest 1ms with an 'infinite' precision, which
defaults to whatever the underlying time counter can do. This should
ensure we run fairly quickly to start processing done events, while
still giving a small pause for the system to catch its breath. This rate
limiter still is less than ideal, and this commit doesn't change
that. It should really have no functional change: it just uses a better
interface to express the desired sleep.
Sponsored by: Netflix
Reviewed by: kib
Differential Revision: https://reviews.freebsd.org/D45316
Add counts for the number of requests that complete with the ENOMEM as
kern.geom.nomem_count and the number of times we pause the g_down thread
to let the system recover as kern.geom.pause_count.
Sponsored by: Netflix
Reviewed by: kib
Differential Revision: https://reviews.freebsd.org/D45309
It is inherited from arm, where the global exists and is used. No
functional change.
Reviewed by: markj
MFC after: 3 days
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D45323
No functional change.
Reviewed by: markj
MFC after: 3 days
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D45322
off64_t is needed for both Linux (musl) and MacOS, so move them to the
common area. Somehow glibc provides the definition, but defining it
doesn't hurt and hels in the musl case.
Reviewed by: allanjude, jrtc27
Pull Request: https://github.com/freebsd/freebsd-src/pull/1066
Remove archivers/unzip (now in base) and emulators/linux_base-c7 (old
and unlikely to be useful without other linux packages being installed),
ports-mgmt/portmaster (now largely obsolete and discouraged in favour
of using pkg and binary packages) and x11-drivers/xf86-video-vmware
(questionably useful).
Replace devel/git with devel/git@lite (sufficient for most purposes),
and adjust the "ensure the ports exist to sanitize the list" code to
ignore the @lite part when checking that /usr/ports/devel/git exists.
Add sysutils/seatd and x11-wm/sway for wayland support.
MFC after: 1 minute
Differential Revision: https://reviews.freebsd.org/D45278
Lock the two TX MO downcalls into driver/firmware in
lkpi_80211_txq_tx_one() to make sure they cannot happen in the
middle of other (net80211 triggered) updates calling down into
the driver/firmware.
Sponsored by: The FreeBSD Foundation (commit)
MFC after: 3 days
Reviewed by: cc
Differential Revision: https://reviews.freebsd.org/D43966
Update and add (new) PCI IDs for Realtek rtw88/89, Mediatek 7996/7925,
QCA ath1xk, and add Intel iwlwifi IDs.
Rather than using a package per driver add fine(r) grained flavors
even though it is a lot more likely to break in certain cases.
For Intel we need a great level of detail to match PCI IDs so also pass
the full pciconf -l line to into the pci_* files as "$2" to have access
to these.
This lines up with ports commit 80f50c9eb66d.
Sponsored by: The FreeBSD Foundation
Reviewed by: manu (earlier version)
MFC after: 3 days
Differential Revision: https://reviews.freebsd.org/D44918
PREF64 allows a router to advertise the network's NAT64 prefix, allowing
clients to auto-configure CLAT. This makes it possible to deploy
IPv6-only or IPv6-mostly client access networks without the need for
DNS64.
Reviewed by: imp, glebius (prior suggetions done)
Pull Request: https://github.com/freebsd/freebsd-src/pull/1206
FIRECRACKER is not a legacy config, so remove the really old FreeBSD
versions from it. MINIMAL has a similar history, and limited target
audience which has little to no overlap with really old binaries. Either
of these is really easy to get additional binary compat with the include
directive, so balance things better. Leave GENERIC alone.
PR: 231768
Signed-off-by: Henrich Hartzer <henrichhartzer@tuta.io>
Reviewed by: imp (MINIMAL), cperciva (FIRECRACKER)
Pull Request: https://github.com/freebsd/freebsd-src/pull/1228
Ensure that the inp is not dropped when starting a stack switch.
While there, clean-up the code by using INP_WLOCK_RECHECK, which
also re-assigns tp.
Reviewed by: glebius
MFC after: 3 days
Sponsored by: Netflix, Inc.
Differential Revision: https://reviews.freebsd.org/D45241
Intersting/relevant changes since bmake-20240508
ChangeLog since bmake-20240508
2024-05-20 Simon J Gerraty <sjg@beast.crufty.net>
* VERSION (_MAKE_VERSION):
Merge with NetBSD make, pick up
o dir.c: in FindFile restore last search of .CURDIR even for
includes, as a number of existing makefiles are broken otherwise.
2024-05-19 Simon J Gerraty <sjg@beast.crufty.net>
* VERSION (_MAKE_VERSION): 20240519
Merge with NetBSD make, pick up
o dir.c: Add Dir_FindInclude, FindFile without looking in .CURDIR.
Also fix Dir_SetSYSPATH to use defSysIncPath if sysIncPath is empty.
o main.c: no need to set .DOTLAST in sysIncPath
arp(8) usually disallows adding a static ARP entry for an IP address
which is not configured on a local interface.
Change this to allow such ARP entries to be added if '-i' is provided to
specify the interface the ARP entry relates to.
Due to limitations in the kernel lltable, this still requires that a
host route exists for the target address, but allows static ARP entries
to be configured to proxy ARP for, e.g., local jails which use an IPv4
address with a /32 route.
Reviewed by: imp, zlei
Pull Request: https://github.com/freebsd/freebsd-src/pull/1220