Commit Graph

272670 Commits

Author SHA1 Message Date
Peter Holm
91f821f8e4 stress2: Add a fsck_ffs regression test scenario 2022-02-13 10:49:58 +01:00
Kirk McKusick
6fbbb48063 stress2: Added a tool to zero out a superblock check hash. 2022-02-13 10:47:20 +01:00
Richard Scheffenegger
70e9f880d8 iscsi: address unused-but-set-variable warning
remove "interrupted" in icl_soft_proxy_connect()

Reviewed By: hselasky
Sponsored by:        NetApp, Inc.
Differential Revision: https://reviews.freebsd.org/D34223
2022-02-12 06:15:02 +01:00
Kyle Evans
e01e8f911b freebsd-update: improve BE creation feature
This addresses one nit and one bug in the BE creation feature of
freebsd-update:

The nit addressed is that it currently only names the BEs after the
userland version, but the kernel version may be higher.  After this
change, we request both and pass them through sort(1) to choose the
highest.  This is especially helpful if a freebsd-update patch touched
one but not the other.

The bug fixed is that roots updated that are not located at '/', e.g.,
by using -b or -j, will no longer create boot environments
automatically.  There's a very low chance these will actually change the
BE in any meaningful way, anyways.  It could make sense in the future
to allow an argument-override to create the BE anyways if someone comes
up with a non-standard setup, e.g., where a jail is an important part of
their boot environment on an appliance or some such setup.

Half of this patch is submitted by delphij@, the other half kevans@.

PR:		261446
MFC after:	3 days
Reviewed by:	delphij, emaste, Dave Fullard <dave_fullard.ca>
Differential Revision:	https://reviews.freebsd.org/D34257
2022-02-12 15:36:24 -06:00
Navdeep Parhar
08c7dc7fd4 cxgbe(4): Fix illegal hardware access in cxgbe_refresh_stats.
cxgbe_refresh_stats takes into account VI_SKIP_STATS but not
VI_INIT_DONE when deciding whether to read the hardware stats.  But
before this change VI_SKIP_STATS was set only for VIs with VI_INIT_DONE.
That meant that cxgbe_refresh_stats always accessed the hardware for
uninitialized VIs, and this is a problem if the adapter is suspended or
in the middle of a reset.

Fix this by setting VI_SKIP_STATS on all VIs during suspend.  While
here, ignore VI_INIT_DONE in vi_refresh_stats too to be consistent with
cxgbe_refresh_stats.

MFC after:	1 week
Sponsored by:	Chelsio Communications
2022-02-12 09:53:50 -08:00
Alan Somers
0b6a34acda [skip ci] fusefs: delete a stray comment from 91972cfcdd
MFC after:	3 days
2022-02-12 09:27:56 -07:00
Ed Maste
acfb506b3d newvers.sh: allow multiple -V args in one invocation
Reviewed by:	imp
MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D34253
2022-02-12 11:06:54 -05:00
Wolfram Schneider
98839c40c7 better unique file names
Our mktemp(1) implementation uses 8-X for a temp file by default.
That's ok, but we should increase the value from 8 to 10 as
many other OS already did.

PR:		261438
2022-02-12 11:35:51 +00:00
Navdeep Parhar
39a36707bd cxgbe(4): Avoid unsafe hardware access in the ifmedia ioctls.
The hardware is unavailable when the device is suspended or in the
middle of a reset.

MFC after:	1 week
Sponsored by:	Chelsio Communications
2022-02-11 16:35:27 -08:00
John Baldwin
dba02df30d Cast pointer to uintptr_t to avoid alignment warnings.
Both struct ip and struct udphdr both have an aligment of 2, but the
cast from struct ip to a uint32_t pointer confused GCC 9 into raising
the required alignment to 4 and then raising a
-Waddress-of-packed-member error when casting to struct udphdr.

Reviewed by:	imp
Differential Revision:	https://reviews.freebsd.org/D31941
2022-02-11 16:04:52 -08:00
John Baldwin
cd0525f615 ktls: Write-lock the INP when changing a transmit TLS session.
The TCP rate pacing code relies on being able to read this pointer
safely while holding an INP lock.  The initial TLS session pointer is
set while holding the write lock already.

Reviewed by:	gallatin, hselasky
Sponsored by:	Netflix
Differential Revision:	https://reviews.freebsd.org/D34086
2022-02-11 15:16:25 -08:00
Konstantin Belousov
fd8d4e53bc vdso linker scripts: explicitly specify output arch and target
Requested by:	jhb
Reviewed by:	emaste, imp, jhb
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D34157
2022-02-12 00:32:23 +02:00
John Baldwin
b0c1600a8c linuxkpi xarray: Correct expression in assertion.
Reported by:	GCC -Wparantheses
Reviewed by:	wulf, hselasky
Differential Revision:	https://reviews.freebsd.org/D34197
2022-02-11 13:59:27 -08:00
John Baldwin
13916064fc rescue: Link with -lncursesw instead of -lncursesw_real.
ld.bfd fails to link rescue with undefined symbol errors otherwise.

This reverts commit b158d4d7a1.

Reviewed by:	bapt
Differential Revision:	https://reviews.freebsd.org/D34123
2022-02-11 13:58:59 -08:00
Warner Losh
3e65b7d94d cleankernel: A target to delete the kernel compile file
With the meta-build, it's always a NO_CLEAN build. Provide a way to
remove so one can rebuild from scratch. 'cleankernel' will delete the
kernel and modules object directories. Document this in build(7).

Sponsored by:		Netflix
Reviewed by:		debdrup, markj
Differential Revision:	https://reviews.freebsd.org/D32978
2022-02-11 12:51:24 -07:00
Johan Jansson
d4b0fa45dc ucred.9: fix typo
PR:	261889
MFC after:	3 days
2022-02-11 20:10:19 +02:00
Konstantin Belousov
b1b5174123 rtld: Add ${TOKEN} aliases to $TOKEN
it seems that glibc supports them, and such spelling is mentioned in the
ld.bfd manual. Idea seems to auto-correct some quoting/makefile sytnax
errors on linker command line.

Reviewed by:	emaste, markj
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D34247
2022-02-11 20:01:20 +02:00
Konstantin Belousov
55abf23dd3 rtld: make token substitution table-driven
Reviewed by:	emaste, markj
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D34247
2022-02-11 20:00:47 +02:00
Ed Maste
ea9a92d210 Makefile.inc1: synthesize PKG_ABI from newvers.sh variables
Previously we inspected ${WSTAGEDIR}/usr/bin/uname to determine PKG_ABI,
but the file will not exist in some cases - for example, if building
only kernel packages.  We can instead synthesize the PKG_ABI from
information already provided by newvers.sh.

Reviewed by:	kevans, manu (both earlier rev)
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D34249
2022-02-11 11:26:07 -05:00
Mateusz Guzik
1d65a9b47e cache: improve vnode vs name assertion in cache_enter_time 2022-02-11 12:29:26 +00:00
Mateusz Guzik
611470a515 cache: remove NOCACHE handling from cache_fplookup_noentry
It was copy-pasted from locked lookup. As LOOKUP operation cannot have
the flag set it was always ending up setting MAKEENTRY.
2022-02-11 12:29:26 +00:00
Mateusz Guzik
513c7a6e0c fd: make fget_unlocked take a thread argument
Just like other fget routines. This enables embedding fd table pointer
in struct thread, avoiding taking a trip through proc.
2022-02-11 12:29:26 +00:00
Mateusz Guzik
45bb8beacc fd: elide one acquire fence in fget_unlocked_seq
Still validate we got the stable state before returning an error though.
2022-02-11 12:29:26 +00:00
Mateusz Guzik
62849eef5b fd: split fget_unlocked_seq depending on CAPABILITIES
This will simplify an upcoming change.
2022-02-11 12:27:22 +00:00
Mateusz Guzik
b937908e41 fd: split fget_cap depending on CAPABILITIES
This will simplify an upcoming change.
2022-02-11 12:13:27 +00:00
Mateusz Guzik
f40dd6c803 tty: switch ttyhook_register to use fget_cap_locked
It is still wrong-ish as fget* funcs don't expect to operate on abitrary
file descriptor tables, but this at least moves it out of the way of an
upcoming change while being bug-compatible.
2022-02-11 12:13:27 +00:00
Mateusz Guzik
93288e2445 Employ thread_cow_synced in setrlimit
In order to avoid proc lock/unlock on next kernel entry.
2022-02-11 11:44:07 +00:00
Mateusz Guzik
32114b639f Add PROC_COW_CHANGECOUNT and thread_cow_synced
Combined they can be used to avoid a proc lock/unlock cycle in the
syscall handler for curthread, see upcoming examples.
2022-02-11 11:44:07 +00:00
Mateusz Guzik
8a0cb04df4 Add lim_cowsync, similar to crcowsync 2022-02-11 11:44:07 +00:00
Peter Holm
f0000eb41d stress2: Added a regression test
PR:     261707
2022-02-11 09:47:25 +01:00
Kyle Evans
4bcc7a5f6b lsvfs: one last style nit missed in 946585179d
Space after `for`.

Sponsored by:	Klara, Inc.
2022-02-10 16:14:17 -06:00
Warner Losh
0987dc5be5 riscv: Add static asssert for context size
Add a static assert for the siginfo_t, mcontext_t and ucontext_t
sizes. These are de-factor ABI options and cannot change size ever.

Differential Revision:	https://reviews.freebsd.org/D34214
2022-02-10 14:32:21 -07:00
Warner Losh
6e48e160ae powerpc: Add static asssert for context size
Add a static assert for the siginfo_t, mcontext_t and ucontext_t
sizes. These are de-facto ABI options and cannot change size ever. For
powerpc64, also add asserts for {u,m}mcontext32_t and siginfo32.

Reviewed by:		andrew
Differential Revision:	https://reviews.freebsd.org/D34213
2022-02-10 14:32:20 -07:00
Warner Losh
690601f0b4 amd64: Add static asssert for context size
Add a static assert for the siginfo_t, mcontext_t and ucontext_t
sizes. These are de-facto ABI options and cannot change size ever.

Reviewed by:		kib
Differential Revision:	https://reviews.freebsd.org/D34212
2022-02-10 14:32:20 -07:00
Warner Losh
d4f495fbf8 i386: Add static asssert for context size
Add a static assert for the siginfo_t, mcontext_t and ucontext_t
sizes. These are de-facto ABI options and cannot change size ever.

Reviewed by:		kib
Differential Revision:	https://reviews.freebsd.org/D34211
2022-02-10 14:32:20 -07:00
Warner Losh
0c988f92dc arm: Add static asssert for context size
Add a static assert for the siginfo_t, mcontext_t and ucontext_t
sizes. These are de-facto ABI options and cannot change size ever.

Reviewed by:		andrew
Differential Revision:	https://reviews.freebsd.org/D34210
2022-02-10 14:32:20 -07:00
Warner Losh
3988ca5aab aarch64: Add static asssert for context size
Add a static assert for the siginfo{,32}_t, mcontext{,32}_t and
ucontext{,32}_t sizes. These are de-facto ABI options and cannot change
size ever.

Reviewed by:		kib, andrew, jhb
Differential Revision:	https://reviews.freebsd.org/D32958
2022-02-10 14:32:20 -07:00
Jason A. Harmening
974efbb3d5 unionfs: fix typo in comment
I deleted the wrong word when writing up a comment in a prior change;
the covered vnode may be recursed during any unmount, not just forced
unmount.
2022-02-10 15:17:43 -06:00
John Baldwin
bbf4df1722 libthr: Disable stack unwinding on ARM.
When a thread exits, _Unwind_ForcedUnwind() is used to walk up stack
frames executing pending cleanups pushed by pthread_cleanup_push().
The cleanups are popped by thread_unwind_stop() which is passed as a
callback function to _Unwind_ForcedUnwind().

LLVM's libunwind uses a different function type for the callback on
32-bit ARM relative to all other platforms.  The previous unwind.h
header (as well as the unwind.h from libcxxrt) use the non-ARM type on
all platforms, so this has likely been broken on 32-bit arm since it
switched to using LLVM's libunwind.

For now, just disable stack unwinding on 32-bit arm to unbreak the
build until a proper fix is tested.
2022-02-10 12:47:08 -08:00
Mark Johnston
7be9a3b453 ctfconvert: Rip out STABS support
It is unused on FreeBSD and complicates some efforts to modify the CTF
format to permit wider type IDs, so remove it.  No functional change
intended.

MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
2022-02-10 15:41:10 -05:00
Mark Johnston
7db423d692 libctf: Rip out CTFv1 support
CTFv1 was obsolete before libctf was imported into FreeBSD, and
ctfconvert/ctfmerge can emit only CTFv2.  Make ctf.h a bit easier to
maintain by ripping v1 support out.  No functional change intended.

MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
2022-02-10 15:39:59 -05:00
Mark Johnston
b4f60fab5d tcp: Avoid conditionally defined fields in union lro_address
The layout of the structure ends up depending on whether the including
file includes opt_inet.h and opt_inet6.h, so different compilation units
can end up seeing different versions of the structure.  Fix this by
unconditionally defining the address fields.

As a side effect, this eliminates some duplication in the kernel's CTF
type graph.

Reviewed by:	rscheff, tuexen
MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D34242
2022-02-10 15:39:58 -05:00
Stefan Eßer
f0fd4a32c4 bin/df: allow -t option to be used together with -l
The df command provides a -l option to exclude all non-local file
systems and a -t option with a (positive or negative) list of file
system types to display.

This commit adds support for a combination of -l and -t. If both are
specified, the parameter list of the -t option is applied on top of
the selection of öocal file systems (independently of the order of
the -l and -t options).

E.g., "df -t noprocfs,sysfs -l" will select all local file systems
except those of type procfs and sysfs.

PR:		260921
Approved by:	imp
Relnotes:	yes
MFC after:	1 month
Differential Revision:	https://reviews.freebsd.org/D33748
2022-02-10 21:09:34 +01:00
Jose Luis Duran
cb51e2bc3d rc: Allow the removal of firstboot_sentinel on read-only file systems
NanoBSD or, more generally, systems with root_rw_mount="NO" are not able
to remove the firstboot_sentinel file, typically /firstboot, because the
logic in /etc/rc is currently inverted.

When checkyesno root_rw_mount tests on a read-only file system, the
return is 1, hence avoiding the option to mount the system read-write.

Restore the ability to remove the firstboot_sentinel file on read-only
mounted file systems.

This change was introduced in 40adda8665, and partially fixed in
1ce07411fa.

Differential Revision: https://reviews.freebsd.org/D34166
2022-02-10 12:43:19 -07:00
Jose Luis Duran
c96f70e7ac rc: Remove extra whitespace
Differential Revision: https://reviews.freebsd.org/D34165
2022-02-10 12:43:19 -07:00
Jose Luis Duran
0853415963 nanobsd: Recursively copy fat partition
We have a directory structure for the FAT partition now with EFI and DTC
overlays, so we need to recursively copy it.

Differential Revision: https://reviews.freebsd.org/D34241
2022-02-10 12:43:19 -07:00
Dimitry Andric
74f7afdfd2 Disable clang 14 warning about bitwise operators in one more place
Follow up 5f2aca8394, where I missed the -Werror warning still being
emitted in libsa.

Fixes:		5f2aca8394
MFC after:	3 days
2022-02-10 19:48:31 +01:00
Mark Johnston
2e4311906d libctf: Use ctf_type_t instead of struct ctf_type
For consistency with other CTF toolchain code.  No functional change
intended.

Fixes:	105fd928b0 ("libctf: Improve check for duplicate SOU definitions in ctf_add_type()")
MFC after:	1 week
2022-02-10 13:21:37 -05:00
John Baldwin
c00d345665 Install unwind.h into /usr/include
Install headers from LLVM's libunwind in place of the headers from
libcxxrt and allow C applications to use the library.

As part of this, remove include/unwind.h and switch libthr over to
using the installed unwind.h.

Reviewed by:	dim, emaste
MFC after:	10 days
Differential Revision: https://reviews.freebsd.org/D34065
2022-02-10 19:00:32 +01:00
Kyle Evans
946585179d lsvfs: restyle, no functional change
Namely:
- main was using two-space indentation
- re-sort local variables
- explicit braces for loop scope
- make flag bit comparison explicit

The first line of this commit message is unfortunately a lie, as it
introduces a minor functional change on non-FreeBSD systems.  Namely,
the first branch is now explicitly compared against `0` and the choice
was made to compare it as greater than 0 to avoid issues on other
systems where `argc != 0` on entry isn't guaranteed (negative when
checked there).

Sponsored by:	Klara, Inc.
2022-02-10 11:34:52 -06:00