Commit graph

288100 commits

Author SHA1 Message Date
Jason A. Harmening
d0bb255d1f VFS: update VOP_FSYNC() debug check to reflect actual locking policy
Shared vs. exclusive locking is determined not by MNT_EXTENDED_SHARED
but by MNT_SHARED_WRITES (although there are several places that
ignore this and simply always use an exclusive lock).  Also add a
comment on the possible difference between VOP_GETWRITEMOUNT(vp)
and vp->v_mount on this path.

Found by local testing of unionfs atop ZFS with DEBUG_VFS_LOCKS.

Reviewed by:	kib, olce
Differential Revision: https://reviews.freebsd.org/D43816

(cherry picked from commit 9530182e371dee382b76d8594f65633a304b396f)
2024-03-04 12:30:27 -06:00
Florian Walpen
ebe18cb1a5 snd_uaudio(4): Fix sample rate selection after 42fdcd9fd917.
The sample rate selection of snd_uaudio(4) at runtime was implicitly
relying on a specific order in the device config list. In case a default
was set through the hw.usb.uaudio.default_rate sysctl tunable, commit
42fdcd9fd917 removed a duplicate sample rate entry from that list, which
inadvertently broke sample rate selection at runtime. Implement sample
rate selection in a way that works for any order in the device config
list.

Reported by:	Lexi Winter <lexi@le-fay.org>
MFC after:	1 week
Reviewed by:	christos
Differential Revision:	https://reviews.freebsd.org/D44051

(cherry picked from commit a9341f0f0ae01b4d249dbf3bacfa420152c46aef)
2024-03-04 01:38:58 +01:00
Konstantin Belousov
7f387adb69 ipsec esp: avoid dereferencing freed secasindex
(cherry picked from commit 1a56620b7958cac2b9048589cb730c46958ab539)
2024-03-04 02:27:17 +02:00
Stefan Schlosser
38a5635de9 md5.1: Fix an example
The last example in the manpage md5(1) wants to demonstrate
GNU mode (md5sum), but uses BSD mode (md5) instead:

In GNU mode, the -c option does not compare against a hash string
passed as parameter. Instead, it expects a  digest file,
as created under the name digest for /boot/loader.conf in
the example above.

PR:	276560
Reviewed by:	mhorne
Differential Revision:	https://reviews.freebsd.org/D44098

(cherry picked from commit 865baeaf1abeb14327ad6a4a1f8ce722e242ff73)
2024-03-03 18:49:10 +01:00
Stefan Schlosser
ee0ffe0e3e nvmecontrol.8: Fix the SYNOPSIS section
The manpage of nvmecontrol(8) has the following SYNOPSIS:

nvmecontrol format [-f fmt] [-m mset] [-o pi] [-l pil] [-E]
[-C] <device-id | namespace-id>

The correct switch for the pi option is -p according
to sbin/nvmecontrol/format.c:

OPT("pi", 'p', arg_uint32, opt, pi, "Protective information")

So correct the SYNOPSIS section accordingly.

PR:	276554
Reviewed by:	imp
Differential Revision:	https://reviews.freebsd.org/D44099

(cherry picked from commit 77f6c0ce92888d047d91e87b931242403764902b)
2024-03-03 18:48:51 +01:00
Gordon Bergling
6cf569e659 carp(4): Fix a typo in a source code comment
- s/successfull/successful/

(cherry picked from commit 6bce41a38e32decbce80bb1586cdd9400c83eb97)
2024-03-03 18:48:32 +01:00
Gordon Bergling
cdadccec76 dumprestore.h: Fix typos in source code comments
- s/dumpped/dumped/

(cherry picked from commit 8f87d402e32178974038212fbf4b1564447df0e0)
2024-03-03 18:48:14 +01:00
Gordon Bergling
4d8cc5b78f bxe(4): Fix two typos in a kernel messages
- s/successfull/successful/

MFC after:	3 days

(cherry picked from commit e2f36496136975d4b591b230a71986f1508629c1)
2024-03-03 18:47:24 +01:00
Gordon Bergling
61408fbd36 vge(4): Fix a typo in a source code comment
- s/opration/operation/

(cherry picked from commit 04d5a8ae04013fd34e3bde5e401b6eaff46ac9c2)
2024-03-03 18:47:06 +01:00
Dmitry Lukhtionov
2d694deca9 snd_hda: Add patches for the Lenovo Ideapad 330-15 and ThinkPad X230
PR:		259640
MFC after:	2 weeks
Reviewed by:	delphij, markj
Differential Revision:	https://reviews.freebsd.org/D43804

(cherry picked from commit 5968e477a560406c480d78ebe438a04f57121119)
2024-03-03 14:18:02 +01:00
Konstantin Belousov
8a7d5d73b8 libc/sys: add errno test
(cherry picked from commit 32fdcff8703da6f2795193acc77ec3c1fb8b723d)
2024-03-02 07:05:05 +02:00
Eugene Grosbein
22f11923c6 mkimg.1: add new PARTITION SPECIFICATION section
The specification follows a commentary to the function parse_part()
in the source code and the code itself.

(cherry picked from commit d1797fb5bbaeb212501a72b916d647fb2e021d50)
2024-03-01 21:47:33 +07:00
Konstantin Belousov
acb407522c sigsys test: correct count of delivered signals
(cherry picked from commit 09dd7240acf1fc50061246013ce318404d70c4e0)
2024-03-01 06:12:02 +02:00
Rick Parrish
e38dee6120 posixmqcontrol(1): manage posix message queues
(cherry picked from commit 0112f8c4a88e75342bdb6b9815fa220c5f645aa0)
2024-03-01 06:12:02 +02:00
Konstantin Belousov
b2c9d403d5 fs/msdosfs fatblock: use ulmin() rather than min()
PR:	277237

(cherry picked from commit 0085afdceb17cb7d4e41f9073299f688372c6a0f)
2024-03-01 06:12:02 +02:00
Wei Hu
dda1c30ffe mana: fix leaking pci resource problem detaching mana deivces
Fixing the error messages when detaching the mana gdma devices
showed in dmesg: "Device leaked memory resources".

Reported by:	NetApp
MFC after:	3 days
Sponsored by:	Microsoft

(cherry picked from commit 47e99e5bc5bcfa621fe6a3e62386f227c47e8cff)
2024-02-29 06:37:23 +00:00
Ed Maste
8d22744f5b kern: fix panic with disabled ttys
PR: 277240, 277329
Reviewed by: kib (earlier version)
Fixes: f1d0a0cbecf2 ("jail: Fix information leak.")
MFC after: 3 days
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D44086

(cherry picked from commit 975d7730828a8bde28c2a0092b6e95c4c4e22f34)
2024-02-28 19:29:13 -05:00
Konstantin Belousov
38595c9d73 linux_pwd_onexec: do not abort image activation if emul path does not exist
(cherry picked from commit 99fa799a19abeb70b1034f65407c276b64709bdc)
2024-02-29 02:24:06 +02:00
Konstantin Belousov
11137153ab fdlopen(3): do not create a new object mapping if already loaded
PR:	277169

(cherry picked from commit 452c5e9995ab4cd6c7ea230cffe0c53bfa65c1ab)
2024-02-29 02:24:06 +02:00
Konstantin Belousov
0a246310f7 rtld: remove pointless "extern"
(cherry picked from commit 180df764c4ee570850deb4a910a11780ec3316df)
2024-02-29 02:24:06 +02:00
Gordon Bergling
d197693001 ls.1: Mention CLICOLOR environment variable
Mention CLICOLOR environment variable in the manual page.

PR:	276556
Submitted by:	bsdcode at disroot dot org
Reviewed by:	imp
Differential Revision:	https://reviews.freebsd.org/D43970

(cherry picked from commit ffea732c5192070a6877409428b0a2cc1728aa16)
2024-02-28 13:48:42 +01:00
Warner Losh
fa399b889f ls: Fix -v and associated test
The cleanup of d854370fa86b7 had a cut and paste error (so f_verssort
was set to 1 and then to 0 rather thame f_timesort being set to 0).

Fixes: d854370fa86b7
Sponsored by: Netflix

(cherry picked from commit ef75877fc2d93199aab2b509089136c433af1f20)
2024-02-28 13:47:33 +01:00
Alexander Ziaee
ff86c97bfa ls: versort incompatible w/ timesort and sizesort
ls.1: versort incompatible w/ timesort and sizesort

Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/825

(cherry picked from commit d854370fa86b74527e57145955b1fa3ca75643a2)
2024-02-28 13:47:08 +01:00
Jens Schweikhardt
e6c0ce9e37 Correct the grammo in "will underlined".
(cherry picked from commit 4fc08109fe32264485a54a7ea45f4ec09a8fcf86)
2024-02-28 13:40:51 +01:00
Gordon Bergling
72d897c7f4 tcp_rack.4: Fix a link in the SEE ALSO section
The URL of the paper at arxiv.org has changed so link the
PDF-file directly.

(cherry picked from commit 6e9a71706906b86e627cfdd27bc37b88a796f46e)
2024-02-28 13:37:07 +01:00
Gordon Bergling
e7b055efa7 tcp: Remove the documented dependency of TCPHPTS for RACK and BBR
Since TCPHPTS is now included in the GENERIC kernel, remove the
documented dependency of it from the tcp_rack(4) and tcp_bbr(4)
manual pages.

Reviewed by:	tuexen
Differential Revision:	https://reviews.freebsd.org/D43084

(cherry picked from commit 4fb5eda6493c3dada695efbfad0a44d204b7fc5e)
2024-02-28 13:36:49 +01:00
Richard Scheffenegger
f3f559705a tcp: cubic - restart epoch after RTO
This is a migitation to avoid sudden extreme jumps in
cwnd, as t_epoch can be very out of date after an RTO.
Per RFC9438, sec 4.8, t_epoch is to be reset whenever
cwnd grows beyond ssthresh (CC phase transitions from
slow start to congestion avoidance), to be fixed with
the upcoming cc_cubic changes.

MFC after:		3 days
Reviewed By:		cc, #transport
Sponsored by:		NetApp, Inc
Differential Revision:	https://reviews.freebsd.org/D44023

(cherry picked from commit 038699a8f18a0a651ee06b85fa1dbbee1eab56f1)
2024-02-27 12:00:56 +01:00
Richard Scheffenegger
419848219b tcp: prevent div by zero in cc_htcp
Make sure the divident is at least one. While cwnd should
never be smaller than t_maxseg, this can happen during
Path MTU Discovery, or when TCP options are considered
in other parts of the stack.

PR:			276674
MFC after:		3 days
Reviewed By:		tuexen, #transport
Sponsored by:		NetApp, Inc.
Differential Revision:	https://reviews.freebsd.org/D43797

(cherry picked from commit 38983d40c18ec5705dcba19ac320b86c5efe8e7e)
2024-02-27 12:00:55 +01:00
Olivier Certner
f54344ec12
kern_racct.c: Don't compile if RACCT undefined
Just skip compiling this file if RACCT isn't defined.  This allows to
skip including headers that no code uses at all, and also to remove the
whole file's #ifdef/#endif bracketing.

Reviewed by:    markj
MFC after:      2 weeks
Sponsored by:   The FreeBSD Foundation

(cherry picked from commit 7fa08d415283c9a0c1e2b57edfbb13d722c25735)

Approved by:        emaste (mentor)
2024-02-27 11:37:33 +01:00
Olivier Certner
e36cb22221
kern_rctl.c: Minimal includes when RCTL not defined
If RCTL is not defined, only the system call stubs returning ENOSYS are
compiled in.  In this case, don't waste time including most headers
since their code is not used.

Reviewed by:    markj
MFC after:      2 weeks
Sponsored by:   The FreeBSD Foundation

(cherry picked from commit e0205aa325c0936ccdd0e635576875786c41f6c3)

Approved by:        emaste (mentor)
2024-02-27 11:37:23 +01:00
Olivier Certner
ff7f93814c
umtxvar.h: Add missing include
Necessary to have the definition of 'struct timespec'.

No functional change.

Approved by:        markj (mentor)
MFC after:          3 days
Sponsored by:       The FreeBSD Foundation

(cherry picked from commit bcaa0b4c2bab2866d5ee11c9eb8900a70bdb21e1)

Approved by:        emaste (mentor)
2024-02-27 11:37:08 +01:00
Olivier Certner
d3de30d018
sched: sched_switch(): Factorize sleepqueue flags
Avoid duplicating common flags for the preempted and non-preempted
cases, making it clear that they are the same without resorting to
formatting.

No functional change.

Approved by:        markj (mentor)
MFC after:          3 days
Sponsored by:       The FreeBSD Foundation

(cherry picked from commit 6a3c02bc52892eb09c3b766562b8ddb452c393a9)

Approved by:        emaste (mentor)
2024-02-27 11:36:57 +01:00
Gordon Bergling
8bafcf60ef if_hn: Fix two typos in source code comments
- s/managment/management/
- s/transacion/transaction/

Obtained from:	NetBSD

(cherry picked from commit 61b88a230bac766f55984d8d33b98845d2b0d1a9)
2024-02-27 09:24:34 +01:00
Li-Wen Hsu
6a9a097df9
Add link from if_iwlwifi(4) to iwlwifi(4)
MFC after:	3 days
Sponsored by:	The FreeBSD Foundation

(cherry picked from commit 1b09a310b78cd2965e3a2fc392327d9cc1376a44)
2024-02-27 12:39:09 +08:00
Christos Margiolis
f8d5fb7db3 snd_uaudio.4: document sysctls
Sponsored by:	The FreeBSD Foundation
MFC after:	2 weeks
Reviewed by:	dev_submerge.ch
Differential Revision:	https://reviews.freebsd.org/D43649

(cherry picked from commit 5960ab73d865b59bfa7d7fd3bd49a6f7d730ef83)
2024-02-27 00:22:32 +01:00
Christos Margiolis
2e5b4890e1 snd_uaudio.4: remove useless .Tn macro
Sponsored by: The FreeBSD Foundation
MFC after: 2 weeks
Reviewed by:	emaste
Differential Revision:	https://reviews.freebsd.org/D43651

(cherry picked from commit dcc47cd49e19df4af987cd094e5a313935f4cd86)
2024-02-27 00:22:31 +01:00
Christos Margiolis
80da975b55 snd_uaudio: mark selected configurations
snd_uaudio(4) selects the first maching rate/channel/bit/format/buffer
configuration for use during attach, even though it will print the rest
of the supported configurations detected. To make this clear, mark the
selected playback and recording configurations with a "selected" string.

Sponsored by: The FreeBSD Foundation
MFC after: 2 weeks
Reviewed by:	dev_submerge.ch
Differential Revision:	https://reviews.freebsd.org/D43766

(cherry picked from commit f60e99f45e8197de2bc0970c7dd7f87148fdaf30)
2024-02-27 00:22:31 +01:00
Christos Margiolis
6f2d6237fe sound: remove snddev_info->inprog and pcm_inprog()
No longer used.

Sponsored by: The FreeBSD Foundation
MFC after: 2 weeks
Reviewed by:	markj
Differential Revision:	https://reviews.freebsd.org/D43737

(cherry picked from commit 883b8ed582eb3e9e98c62c471228ff3c3a25377d)
2024-02-27 00:22:31 +01:00
Florian Walpen
4c6b20d4b3 snd_uaudio(4): Fix config detection with defaults set.
Let the USB audio descriptor iteration detect configurations with more
channels and larger sample size, even when the following global sysctl
tunables are set to a lower value:

hw.usb.uaudio.default_channels hw.usb.uaudio.default_bits

This improves utility and is closer to the meaning of default.

Also, do not create duplicate sample rate entries.

MFC after:	2 weeks
Reviewed by:    christos
Differential Revision:	https://reviews.freebsd.org/D43679

(cherry picked from commit 42fdcd9fd917764d84edcc43e252a90cade78f80)
2024-02-27 00:22:31 +01:00
Florian Walpen
75358ca4fb snd_uaudio(4): Adapt buffer length to buffer_ms tunable.
Adapt the length of the driver side audio buffer to the USB transfer
interval, which is adjustable through the buffer_ms tunable. This
eliminates unnecessary latency in USB audio playback.

To reduce power consumption caused by frequent CPU wakeups, increase the
default buffer_ms value to 4ms. In combination with adaptive buffer
length, this still results in less roundtrip latency compared to the
previous 2ms default.

Extend the buffer_ms value range to 1ms for low latency applications.

MFC after:	2 weeks
Reviewed by:	christos
Differential Revision:	https://reviews.freebsd.org/D41942

(cherry picked from commit b2e97edffdab6ad1e9103a6bbe90300d78a961ed)
2024-02-27 00:22:31 +01:00
Christos Margiolis
7e984a34c3 mixer(3): Do not hardcode "/dev/mixer"
We have BASEPATH defined.

Sponsored by:	The FreeBSD Foundation
MFC after:	2 weeks
Reviewed by:	dev_submerge.ch, markj
Differential Revision:	https://reviews.freebsd.org/D43812

(cherry picked from commit 53c768e6836a32c8dcd0b0b422a169ef7a82a3ab)
2024-02-27 00:22:31 +01:00
Christos Margiolis
6ae4ed11c4 mixer(8): Use new mixer if we change the default unit
If we use the -d option to change the default unit, close the current
mixer and open the one we set as the default to avoid printing and
applying changes (if any) to the old one.

Sponsored by:	The FreeBSD Foundation
MFC after:	2 weeks
Reviewed by:	dev_submerge.ch, markj
Differential Revision:	https://reviews.freebsd.org/D43809

(cherry picked from commit 5daa7cf42f4551cb2f4a452fd038807925320eac)
2024-02-27 00:22:31 +01:00
Christos Margiolis
96a80ca9ba mixer(8): Improve mute and recsrc controls
The input options of "dev.mute" (+, -, ^) and "dev.recsrc" (+, -, ^, =)
are quite cryptic. Allow the input to also be an actual description of
what these options do.

+ -> add (recsrc)
- -> remove (recsrc)
^ -> toggle (recsrc, mute)
= -> set (recsrc)
0 -> off (mute)
1 -> on (mute)

Also, deprecate the use of the symbol options in the EXAMPLES section of
the man page, by using the new descriptive options.

In the future, we might want to get rid of the symbol options
altogether, but preserve backwards compatibility for now.

Sponsored by:	The FreeBSD Foundation
MFC after:	2 weeks
Reviewed by:	dev_submerge.ch, imp
Differential Revision:	https://reviews.freebsd.org/D43796

(cherry picked from commit cc7479d7dc9b895c0a2f4d3805315437e03d0cf6)
2024-02-27 00:22:31 +01:00
Christos Margiolis
23269774b0 mixer.8: Fix wrong sentence
246e0457d93071ffd901c78e3ee7badc5f51bd4c ("mixer.8: Add terse example
for increasing volume") mentions that the example changes the volume of
the "first mixer found", while the example shows how the change the
volume of the current mixer's "vol" device. Re-phrease sentence to
reflect the actual behavior of the command.

Also, improve the example by using the % operator, instead of hardcoding
0.05.

Sponsored by:	The FreeBSD Foundation
MFC after:	2 weeks
Reviewed by:	dev_submerge.ch, markj
Differential Revision:	https://reviews.freebsd.org/D43795

(cherry picked from commit 7bd14d09a92a63f217ccee92e7fc9a1d6d60b387)
2024-02-27 00:22:31 +01:00
Christos Margiolis
7ff8cd094b mixer(8): Allow full PCM device names as input for the -d option
The -d option is a wrapper around hw.snd.default_unit. Currently
mixer(8) expects the option argument to be just the unit's number (e.g
pcm0 -> 0). To avoid confusion, allow full device names of the form
"pcmN" as well.

While here, improve the -d option's description in the man page.

Sponsored by:	The FreeBSD Foundation
MFC after:	2 weeks
Reviewed by:	dev_submerge.ch, imp
Differential Revision:	https://reviews.freebsd.org/D43794

(cherry picked from commit 75be886e58dc237b633104fc9cf8d7d1285e4003)
2024-02-27 00:22:30 +01:00
Christos Margiolis
750a5298fe mixer(8): Improve error messsages and warnings
No functional change intended.

Sponsored by:	The FreeBSD Foundation
MFC after:	2 weeks
Reviewed by:	dev_submerge.ch, imp
Differential Revision:	https://reviews.freebsd.org/D43793

(cherry picked from commit 09ba07011a627e3ea05e0be8ee6db76fd2371540)
2024-02-27 00:22:30 +01:00
Alexander Ziaee
73db76a48c mixer.8: Add terse example for increasing volume
Reviewed by:	jhb
Pull Request:	https://github.com/freebsd/freebsd-src/pull/1044

(cherry picked from commit 246e0457d93071ffd901c78e3ee7badc5f51bd4c)
2024-02-27 00:22:30 +01:00
Ed Maste
26db5b3e63 Remove MOVED_LIBS handling from list-old-libs
In 922337e8d398 I added MOVED_LIBS into list-old-files, so that
delete-old-files would remove the old /usr/lib/libc++.so.1 as soon as
possible (after the library moved to /lib).

I left it in list-old-libs in case a user updated their src tree between
delete-old-files and delete-old-libs.  Now that some time has passed,
tremove the redundant MOVED_LIBS entry.

PR:		272642
Sponsored by:	The FreeBSD Foundation

(cherry picked from commit f38bad0ab0fca9b1f665b2ba79098edf993c0854)
2024-02-26 18:18:08 -05:00
Mitchell Horne
7a3d7b29f8 release: de-duplicate arm.subr fstab logic
These days, the entries are the identical for GPT and MBR.

Reviewed by:	manu, karels, imp
MFC after:	3 days
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D43847

(cherry picked from commit 94b86c12f14e69ace1bffe23c15c77a7def23216)
2024-02-26 11:35:47 -04:00
Gleb Smirnoff
1e74fc9504 arp: fix arp -s/-S
When setting a permanent ARP entry, the route(4) would use
rtm->rtm_rmx.rmx_expire == 0 as a flag for installing a static entry, but
netlink(4) is looking for explicit NTF_STICKY flag in the request.  The
arp(8) utility was adopted to use netlink(4) by default, but it has lots
of route-era guts internally. Specifically there is global variable 'opts'
that shares configuration for both protocols, and it is still initialized
with route(4) specific RTF_xxx flags.  In set_nl() these flags are
translated to netlink(4) parameters. However, RTF_STATIC is a flag that is
never set by default, so attempt to use it as a proxy flag manifesting
-s/-S results in losing it.  Use zero opts.expire_time as a manifest of
-s/-S operation.  This is a minimal fix.  A better one would be to fully
get rid of route(4) legacy.

The change also corrects the logic to set NUD_PERMANENT flag for
consistency.  This flag is ignored by our kernel (now).

Reviewed by:		melifaro, tuexen, emaste
PR:			277063
Fixes:			6ad73dbf65
Differential Revision:	https://reviews.freebsd.org/D43983

(cherry picked from commit 6a3e87e1306d5058d63f7552a25ed6376422f658)
2024-02-25 10:03:17 -08:00