Commit Graph

286518 Commits

Author SHA1 Message Date
John Baldwin 7736786b08 Retire old diskless setup scripts
These scripts predate /etc/rc.diskless* and use a different scheme.  A
comment was added to them back in 2002 noting they were 3 years old at
that point.

Reviewed by:	emaste
Differential Revision:	https://reviews.freebsd.org/D41951
2023-09-25 07:46:21 -07:00
John Baldwin 97232e04ca make_*_driver.sh: Don't include $FreeBSD$ in generated files
Reviewed by:	imp, emaste
Differential Revision:	https://reviews.freebsd.org/D41950
2023-09-25 07:46:09 -07:00
Andrew Turner 82ddab0e8f arm: Don't advertise the virtual timer on arm
It may not be usable on all SoCs.

Sponsored by:	Arm Ltd
2023-09-25 15:19:33 +01:00
Zhenlei Huang 49197c391b ipfw: Add sysctl flag CTLFLAG_TUN to loader tunables
The following sysctl variables are actually loader tunables. Add sysctl
flag CTLFLAG_TUN to them so that `sysctl -T` will report them correctly.

 1. net.inet.ip.fw.enable
 2. net.inet6.ip6.fw.enable
 3. net.link.ether.ipfw

No functional change intended.

Reviewed by:	glebius
MFC after:	3 days
Differential Revision:	https://reviews.freebsd.org/D41928
2023-09-25 18:10:47 +08:00
Zhenlei Huang 03dac3e379 netinet6: Add sysctl flag CTLFLAG_TUN to loader tunables
The following sysctl variables are actually loader tunables. Add sysctl
flag CTLFLAG_TUN to them so that `sysctl -T` will report them correctly.

 1. net.inet6.ip6.auto_linklocal
 2. net.inet6.ip6.accept_rtadv
 3. net.inet6.ip6.no_radr

No functional change intended.

Reviewed by:	glebius
MFC after:	3 days
Differential Revision:	https://reviews.freebsd.org/D41928
2023-09-25 18:10:47 +08:00
Zhenlei Huang 21a722d959 rtsock: Add sysctl flag CTLFLAG_TUN to loader tunable
The sysctl variable `net.route.netisr_maxqlen` is actually a loader
tunable. Add sysctl flag CTLFLAG_TUN to it so that `sysctl -T` will
report it correctly.

No functional change intended.

Reviewed by:	glebius
MFC after:	3 days
Differential Revision:	https://reviews.freebsd.org/D41928
2023-09-25 18:10:46 +08:00
Dmitry Chagin 28035f675b linux(4): Regen
MFC after:		1 week
2023-09-25 12:26:34 +03:00
Dmitry Chagin 0a16d3d14d linux(4): Update syscalls.master to 6.5
MFC after:		1 week
2023-09-25 12:24:58 +03:00
Jamie Gritton a2440348ee jail: avoid a clash with /etc/jail.conf.d between rc and jail(8)
Since 13.1, /etc/rc.d/jail has looked for a per-jail config file in
/etc/jail.conf.d. For RELENG 14, the ".include" directive was added to
jail(8), with a sample line in the jail.conf(5) man page that includes
"/etc/jail.conf.d/*.conf".

These two use cases don't work together. When the jail.conf.d files
are included from a master jail.conf, the files in jail.conf.d are
likely to hold only partial configurations, and shouldn't be directly
loaded by rc.d/jail. But there are existing configurations that depend
on the current rc.d behavior. While users could be advised not to
include from /etc/jail.conf.d, it's the natural choice even if not
mentioned in jail.conf.5.

The workaround is for rc.d/jail to continue to load the individual
files, but only when /etc/jail.conf doesn't include from that
directory (via a simple grep test), This allows the current use
while not breaking the previous use.
Reported by:	antranigv at freebsd.am
Differential Revision:	https://reviews.freebsd.org/D41962
2023-09-24 17:03:09 -07:00
Haoyu Gu 5e29272bf5 syscalls.master: Fix SAL annotation for getdirentires basep argument
getdirentires last argument "off_t *basep" is an optional output
argument.  It returns the value only when the passed-in value(pointer)
is non-NULL.

This is a part of the research work at RCSLab, University of Waterloo.

Reviewed by:	imp, emaste
Differential Revision:	https://reviews.freebsd.org/D41969
2023-09-24 18:37:58 -04:00
Martin Matuska abcdc1b9ae zfs: merge openzfs/zfs@2e2a46e0a
Notable upstream pull request merges:
 #15243 b53077a9e Add zfs_prepare_disk script for disk firmware install
 #15298 2e2a46e0a Invoke zdb by guid to avoid import errors
 #15301 e5d70f467 ZIL: Avoid dbuf_read() in ztest_get_data()

Obtained from:	OpenZFS
OpenZFS commit:	2e2a46e0a5
2023-09-24 23:58:34 +02:00
Priit Trees 0a5d2802b4 vge: correct pause_frames sysctl description
Reviewed by:	emaste
Pull Request:	https://github.com/freebsd/freebsd-src/pull/806
2023-09-24 13:34:36 -04:00
Warner Losh da8324a925 nvme: Fix locking protocol violation to fix suspend / resume
Currently, when we suspend, we need to tear down all the qpairs. We call
nvme_admin_qpair_abort_aers with the admin qpair lock held, but the
tracker it will call for the pending AER also locks it (recursively)
hitting an assert. This routine is called without the qpair lock held
when we destroy the device entirely in a number of places. Add an assert
to this effect and drop the qpair lock before calling it.
nvme_admin_qpair_abort_aers then locks the qpair lock to traverse the
list, dropping it around calls to nvme_qpair_complete_tracker, and
restarting the list scan after picking it back up.

Note: If interrupts are still running, there's a tiny window for these
AERs: If one fires just an instant after we manually complete it, then
we'll be fine: we set the state of the queue to 'waiting' and we ignore
interrupts while 'waiting'. We know we'll destroy all the queue state
with these pending interrupts before looking at them again and we know
all the TRs will have been completed or rescheduled. So either way we're
covered.

Also, tidy up the failure case as well: failing a queue is a superset of
disabling it, so no need to call disable first. This solves solves some
locking issues with recursion since we don't need to recurse.. Set the
qpair state of failed queues to RECOVERY_FAILED and stop scheduling the
watchdog. Assert we're not failed when we're enabling a qpair, since
failure currently is one-way. Make failure a little less verbose.

Next, kill the pre/post reset stuff. It's completely bogus since we
disable the qparis, we don't need to also hold the lock through the
reset: disabling will cause the ISR to return early. This keeps us from
recursing on the recovery lock when resuming. We only need the recovery
lock to avoid a specific race between the timer and the ISR.

Finally, kill NVME_RESET_2X. It'S been a major release since we put it
in and nobody has used it as far as I can tell. And it was a motivator
for the pre/post uglification.

These are all interrelated, so need to be done at the same time.

Sponsored by:		Netflix
Reviewed by:		jhb
Tested by:		jhb (made sure suspend / resume worked)
MFC After:		3 days
Differential Revision:	https://reviews.freebsd.org/D41866
2023-09-24 07:17:18 -06:00
Alexander Motin 2373e704aa Untie strchrnul() from gdb.
MFC after:	10 days
2023-09-23 23:18:20 -04:00
Li-Wen Hsu 855e045739 ports(7): Update the default setting of MASTER_SITE_INDEX
MFC after:	3 days
2023-09-24 10:59:34 +08:00
Simon J. Gerraty f174619c38 Guard CROSS_TARGET_FLAGS from buildworld
Until a better arrangment is worked out, guard the setting of
CROSS_TARGET_FLAGS in local.sys.mk with check for DIRDEPS_BUILD.

Using a separate flag for CROSS_TARGET that can be reset by
bsd.compat.mk is probably the right thing.
2023-09-23 15:58:13 -07:00
John Baldwin f2f73fa7bd factor: Remove an empty #ifdef __FBSDID clause 2023-09-23 15:03:25 -07:00
John Baldwin 701468baa4 ifconfig/ifvlan.c: Whitespace fix 2023-09-23 15:03:25 -07:00
Piotr Pawel Stefaniak a675eaec5a sh: implement PS1 \D to print current time
\D{format} yields the result of calling strftime(3) with the provided
format and the current time.

When PS4 can use this, it will enable us to easily generate timestamps
when tracing script execution.

Differential Revision:	https://reviews.freebsd.org/D35840
2023-09-23 20:26:45 +02:00
Alexander Motin f80babf906 kern_sysctl: Make name2oid() non-destructive to the name
It is not the first time I see it panicking while trying to modify
const memory.  Lets make it safer and easier to use.  While there,
mark few functions using it also const.

MFC after:	10 days
2023-09-23 12:13:46 -04:00
Marko Zec 03ef737c54 ng_eiface: switch VNETs when injecting mbufs into netgraph
A ng_eiface instance may be on lease to a different vnet while
remaining tied to its parent vnet.  In such circumstances, before
injecting mbufs into netgraph, curvnet must be set to that of the
ng_eiface's netgraph node.  Mark the vnet transition as QUIET,
since otherwise it would be recorded as a curvnet recursion when
ng_eiface's ifnet resides in the same (parent) vnet as its
netgraph node.

PR:		274028
Reported by:	Dancho Penev <dpslavov@hotmail.com>
MFC after:	1 week
2023-09-23 10:56:56 +02:00
Simon J. Gerraty f9df609750 Add support for host32 for DIRDEPS_BUILD
Allow building 32bit libs for host.

Move CFLAGS additions from local.sys.dirdeps.mk (which is too early
and impacts CFLAGS defaults) to local.sys.mk

Reviewed by:	stevek
Sponsored by:	Juniper Networks, Inc.
Differential Revision:	https://reviews.freebsd.org/D41946
2023-09-22 23:27:37 -07:00
Mateusz Guzik bb124a0f61 vfs cache: retire dothits and dotdothits counters
They demonstrate nothing, and in case of dotdot they are not even hits.
This is just a count of lookups with "..", which are not worth
mentioniong.
2023-09-23 00:08:49 +00:00
Paul Dagnelie 2e2a46e0a5 Invoke zdb by guid to avoid import errors
The problem that was occurring is basically that a device was removed 
by ztest and replaced with another device. It was then reguided. The 
import then failed because there were two possible imports with the 
same name; one with the new guid, and one with the old. This can 
happen because the label writes from the device removal/replacement 
can be subject to ztest's error injection. 

The other ways to fix this would be to change the error injection to 
not trigger on removals (which may not be technically feasible), or 
to change the import code to not report configurations that are so 
short on devices (which would potentially have unpleasant end-user 
effects when trying to recover from data losses/device configuration 
issues).

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Matthew Ahrens <mahrens@delphix.com>
Reviewed-by: George Melikov <mail@gmelikov.ru>
Signed-off-by: Paul Dagnelie <pcd@delphix.com>
Closes #15298
2023-09-22 16:08:51 -07:00
Mateusz Guzik 33fdf1afae vfs cache: mark vfs.cache.param.size as read-only
It was not meant to be writable and writes don't work correctly as they
fail to resize the hash.
2023-09-22 21:32:23 +00:00
Olivier Certner 02ef039c28 vfs cache: Drop known argument of internal cache_recalc_neg_min()
'ncnegminpct' is to be passed always, so just drop the unneeded parameter.

Sponsored by:   The FreeBSD Foundation
Reviewed by:	mjg

Differential Revision: https://reviews.freebsd.org/D41763
2023-09-22 21:25:50 +00:00
Olivier Certner 02cbc029da vfs: fix reference counting/locking on LK_UPGRADE error
Factoring out this code unfortunately introduced reference and lock leaks in
case of failure in the lock upgrade path under VV_CROSSLOCK. In terms of
practical use, this impacts unionfs (and nullfs in a corner case).

Fixes:          80bd5ef070 ("vfs: factor out mount point traversal to a dedicated routine")
MFC after:      3 days
MFC to:         stable/14 releng/14.0
Sponsored by:   The FreeBSD Foundation
Reviewed by:	mjg
[mjg: massaged the commit message a little bit]

Differential Revision: https://reviews.freebsd.org/D41731
2023-09-22 20:57:37 +00:00
Ed Maste 407e2d7cf1 lastcomm: update i386 tests for additional timestamp resolution
Fixes: 6f4ce7e89b ("lastcomm: improve timestamp display")
Sponsored by:	The FreeBSD Foundation
2023-09-22 14:47:03 -04:00
Ed Maste f079ef5b6a lastcomm: update amd64 tests for additional timestamp resolution
Fixes: 6f4ce7e89b ("lastcomm: improve timestamp display")
Sponsored by:	The FreeBSD Foundation
2023-09-22 13:54:24 -04:00
Andrew Turner 450f731b7f Add BTI exceptions
We could hit these when executing code marked as using BTI but jumps
to a non-branch target instruction.

Sponsored by:	Arm Ltd
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D39450
2023-09-22 18:15:14 +01:00
Andrew Turner d61f9bfb0e arm64: Export HWCAP_CPUID
We have export the CPUID registers since 2018 but never set the
HWCAP_CPUID flag to tell userspace it could use them. Fix this by
setting it.

Sponsored by:	Arm Ltd
2023-09-22 18:15:14 +01:00
Andrew Turner 2f198d313b ossl: Update arm_arch.h from OpenSSL 1.1.1 to 3.0
Reviewed by:	emaste
Sponsored by:	Arm Ltd
Differential Revision:	https://reviews.freebsd.org/D41939
2023-09-22 18:15:14 +01:00
Andrew Turner c97a82d4a4 libcrypto: Copy the arm64 header when building asm
It may be needed when it's updated so is best to keep in sync with the
assembly files.

Reviewed by:	emaste
Sponsored by:	Arm Ltd
Differential Revision:	https://reviews.freebsd.org/D41938
2023-09-22 18:15:13 +01:00
Emmanuel Vadot f9e26e7853 arm64: dtb: Add rk3568-nanopi-r5s.dts to the build
We can boot on this board.
2023-09-22 18:51:33 +02:00
Emmanuel Vadot 6694651138 iicbus: pmic: rk8xx: Fix logic in clock-output-names detection
Pointy hat to:	manu (probably)
2023-09-22 18:51:33 +02:00
Michael Paepcke 6f4ce7e89b lastcomm: improve timestamp display
Adjust the lastcomm command to output timestamps with a precision of
seconds.

Reported by:	Dr. Andreas Longwitz
Reviewed by:	emaste
Relnotes:	Yes
Sponsored by:	DSS Gmbh
Pull Request:	https://github.com/freebsd/freebsd-src/pull/802
2023-09-22 10:59:45 -04:00
Lin Ma 4bdf7f6951 netlink: add unregister call in cleanup
For protocols that use netlink (generic and route for now), the unint
handler seems to have forgotten to call unregister, which will cause
the assertion the next time the module is loaded.

This patch adds unregister call to netlink_unregister_proto() for those
handlers to avoid bad things happen.

Reviewed-by: melifaro
Fixes: 7e5bf68495 ("netlink: add netlink support")
Pull-request: https://github.com/freebsd/freebsd-src/pull/781
Signed-off-by: Lin Ma <linma@zju.edu.cn>
2023-09-22 10:44:03 -04:00
Zhenlei Huang 366ef17bb6 UPDATING: add entry for the new loader tunnable net.pf.default_to_drop 2023-09-22 18:19:33 +08:00
Zhenlei Huang c531c1d146 pf: Convert PF_DEFAULT_TO_DROP into a vnet loader tunable 'net.pf.default_to_drop'
7f7ef494f1 introduced a compile time option PF_DEFAULT_TO_DROP to make
the pf(4) default rule to drop. While this change exposes a vnet loader
tunable 'net.pf.default_to_drop' so that users can change the default
rule without re-compiling the pf(4) module.

This change is similiar to that for IPFW [1].

1. 5f17ebf94d Convert IPFW_DEFAULT_TO_ACCEPT into a loader tunable 'net.inet.ip.fw.default_to_accept'

Reviewed by:	#network, kp
MFC after:	2 weeks
Relnotes:	yes
Differential Revision:	https://reviews.freebsd.org/D39866
2023-09-22 18:05:02 +08:00
Mikaël Urankar 36468371ce pkgbase: Fix ucl for libcompiler_rt
It's only a -dev package now so add it to the list of -dev package
that don't have non-dev package.

PR:	273859
2023-09-22 11:42:21 +02:00
Yuri Pankov 95a4709b2c Create namespace for the symbols added during 15-CURRENT cycle
Reviewed by:	kib
Differential Revision:	https://reviews.freebsd.org/D41935
2023-09-22 10:16:29 +02:00
Dag-Erling Smørgrav c34fce8a03 Fix typos in acl_get_entry(3) manual page.
Sponsored by:	Klara, Inc.
Reviewed by:	kevans
Differential Revision:	https://reviews.freebsd.org/D41924
2023-09-22 09:43:19 +02:00
Dag-Erling Smørgrav b653faaa19 Remove mention of defunct mailing list from acl / mac man pages.
Sponsored by:	Klara, Inc.
Reviewed by:	kevans
Differential Revision:	https://reviews.freebsd.org/D41923
2023-09-22 09:43:19 +02:00
John Hein 633094c27f libprocstat: use elf_getphdrnum rather than deprecated elf_getphnum
PR:             273966
Reviewed by:	emaste
2023-09-21 21:47:26 -04:00
Alexander Motin e5d70f4677 ZIL: Avoid dbuf_read() in ztest_get_data()
While working on similar patches for zfs and zvol in #15153 I've
forgot about ztest.  Update it also so that we test the same code
paths as use in production.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by:	Alexander Motin <mav@FreeBSD.org>
Sponsored by:	iXsystems, Inc.
Closes #15301
2023-09-21 18:40:13 -07:00
Coleman Kane 7ac56b86cd Linux 6.6 compat: fsync_bdev() has been removed in favor of sync_blockdev()
In Linux commit 560e20e4bf6484a0c12f9f3c7a1aa55056948e1e, the
fsync_bdev() function was removed in favor of sync_blockdev() to do
(roughly) the same thing, given the same input. This change
conditionally attempts to call sync_blockdev() if fsync_bdev() isn't
discovered during configure.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Coleman Kane <ckane@colemankane.org>
Closes #15263
2023-09-21 18:38:40 -07:00
Coleman Kane 01d00dfa9e Linux 6.6 compat: generic_fillattr has a new u32 request_mask added at arg2
In commit 0d72b92883c651a11059d93335f33d65c6eb653b, a new u32 argument
for the request_mask was added to generic_fillattr. This is the same
request_mask for statx that's present in the most recent API implemented
by zpl_getattr_impl. This commit conditionally adds it to the
zpl_generic_fillattr(...) macro, as well as the zfs_getattr_fast(...)
implementation, when configure determines it's present in the kernel's
generic_fillattr(...).

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Coleman Kane <ckane@colemankane.org>
Closes #15263
2023-09-21 18:38:40 -07:00
Coleman Kane b37f29341b Linux 6.6 compat: use inode_get/set_ctime*(...)
In Linux commit 13bc24457850583a2e7203ded05b7209ab4bc5ef, direct access
to the i_ctime member of struct inode was removed. The new approach is
to use accessor methods that exclusively handle passing the timestamp
around by value. This change adds new tests for each of these functions
and introduces zpl_* equivalents in include/os/linux/zfs/sys/zpl.h. In
where the inode_get/set_ctime*() functions exist, these zpl_* calls will
be mapped to the new functions. On older kernels, these macros just wrap
direct-access calls. The code that operated on an address of ip->i_ctime
to call ZFS_TIME_DECODE() now will take a local copy using
zpl_inode_get_ctime(), and then pass the address of the local copy when
performing the ZFS_TIME_DECODE() call, in all cases, rather than
directly accessing the member.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Coleman Kane <ckane@colemankane.org>
Closes #15263
Closes #15257
2023-09-21 18:38:31 -07:00
Rob N 2dc89b922b tests/block_cloning: try harder to stay on same txg in fallback test
We've observed this test failing intermittently. When it does, the
"same block" check shows that both files have the same content, that is,
the file was cloned.

The only way this could have happened is if the open txg moved between
the dd and clonefile calls. That's possible because although we set
zfs_txg_timeout to be large, that only affects the wait time in the sync
thread at the start of a new txg; it doesn't change anything if its
currently waiting or working.

So here we just force the txgs to move immediately before, which should
get both operations onto the same txg as intented.

Sponsored-By: OpenDrives Inc.
Sponsored-By: Klara Inc.
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Rob Norris Rob Norris <rob.norris@klarasystems.com>
Closes #15303
2023-09-21 17:54:15 -07:00
Martin Matuska 7a0e9e3f8f zfs: update share/zfs/compatibility.d to match current ZFS code
MFC after:	3 days
2023-09-22 01:37:38 +02:00