Commit graph

288434 commits

Author SHA1 Message Date
Warner Losh fb03f7f8e3 CONTRIBUTING: class work
Add note about contacting me for professors including this as part of
their class work.
2023-12-27 17:21:58 -07:00
Warner Losh 9c1335cead contributing: Add note about static analyzers
Please don't submit the raw results of some static analysis. Please do
submit the thoughtful results, though. Please test with kyua and create
test cases for any actual bugs that might be fixed.
2023-12-27 17:16:33 -07:00
VexedUXR 4ea5e107b1 <bsd.progs.mk>: Allow using SRCS for common sources
Instead of having to do:

PROGS=	program1 program2
SRCS.program1=	program1.c common.c
SRCS.program2=	program2.c common.c

This can now be done instead:

PROGS=	program1 program2
SRCS=	common.c
SRCS.program1=	program1.c
SRCS.program2=	program2.c

This shouldn't effect any existing projects using <bsd.progs.mk>.

Reviewed by: imp, sjg
Pull Request: https://github.com/freebsd/freebsd-src/pull/766
2023-12-27 17:01:39 -07:00
Warner Losh e21ebb4d2d auto_master.5: Fix my push
Forgot the commit --amend before the push to fix the date. My bad.
Fixes: fc8ac5fedf
2023-12-27 16:59:48 -07:00
concussious fc8ac5fedf auto_master.5: improve description, bump date
Add autofs automounter to description to improve visibility.

Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/824
2023-12-27 16:57:20 -07:00
Graham Perrin db348fdba4 bsd-family-tree: tidiness, width
Tidy the raggedness in the section that begins [44B]. As the line that begins
[KB] was previously tidied, now tidy the section to accommodate [BSDI] and
[TUHS]. Rewrap the section to fit the same number of columns.

Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/812
2023-12-27 16:42:12 -07:00
Graham Perrin 3dfb39ef1d bsd-family-tree: QCU: ISBN and EAN numbers
ISBN 0201547775 and International Article Number (EAN) 9780201547771 for
'A Quarter Century of UNIX' by Peter H. Salus.

Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/812
2023-12-27 16:41:57 -07:00
Graham Perrin b9f4462063 rc(8): angle brackets to avoid link breakage
<https://datatracker.ietf.org/doc/html/rfc3986#appendix-C>

Double-quotes are not suitably effective. Instead, use angle brackets.

Whilst here:
- remove superfluous quotation marks from the %T title.

Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/811
2023-12-27 16:33:17 -07:00
Martin Matuska b356da806b zfs: merge openzfs/zfs@233d34e47
Notable upstream pull request merges:
 #15635 eff77a802 ZIL: Improve next log block size prediction
 #15675 6930ecbb7 spa: make read/write queues configurable
 #15677 5a4915660 Don't panic on unencrypted block in encrypted dataset
 #15716 07e95b467 Fix the FreeBSD userspace build

Obtained from:  OpenZFS
OpenZFS commit: 233d34e47e
2023-12-27 22:51:21 +01:00
Colin Percival 61e2161367 x86: Adjust base addr for PCI MCFG regions
Each bus gets 1 MB of address space; the actual base address for an
MCFG bus range is the address from the table plus the starting bus
number times 1 MB.

The PCI spec is unclear on this point, but this change matches what
Linux does, which is likely enough of a de facto standard regardless
of what any de jure standard might attempt to say.

Fixes:	f54a3890b1 ("x86: Support multiple PCI MCFG regions")
Reviewed by:	jhb
Differential Revision:	https://reviews.freebsd.org/D43206
2023-12-27 13:14:47 -08:00
Mark Johnston 07e95b4670
Fix the FreeBSD userspace build (#15716)
- Mark some parameters to zpool_power*() as unused.
- Add a stub zpool_disk_wait().

Fixes: a9520e6e5 ("zpool: Add slot power control, print power status")

Signed-off-by: Mark Johnston <markj@FreeBSD.org>
Reviewed-by: Alexander Motin <mav@FreeBSD.org>
Reviewed-by: Tony Hutter <hutter2@llnl.gov>
2023-12-27 12:17:53 -08:00
Alexander Motin b46c7b1ed4 nvme: Add some bits from NVMe 2.0c spec.
MFC after:	1 week
2023-12-27 13:50:54 -05:00
John Baldwin 0f3210b3a7 ctladm: Only autoload cfiscsi.ko for iSCSI-specific commands
Sponsored by:	Chelsio Communications
Differential Revision:	https://reviews.freebsd.org/D42935
2023-12-27 10:11:19 -08:00
John Baldwin e8d8354834 ctladm: Fix a typo and add a FALLTHROUGH annotation
Sponsored by:	Chelsio Communications
Differential Revision:	https://reviews.freebsd.org/D42934
2023-12-27 10:10:42 -08:00
John Baldwin f12d378f4f cltadm.8: Correct documentation of -r arg to port command
-r does not take a target port argument

Sponsored by:	Chelsio Communications
Differential Revision:	https://reviews.freebsd.org/D42932
2023-12-27 10:10:27 -08:00
John Baldwin 105eee97b0 ctl: Add missing comma after CTL_FLAG_ALREADY_DONE
Sponsored by:	Chelsio Communications
Differential Revision:	https://reviews.freebsd.org/D42930
2023-12-27 10:09:52 -08:00
John Baldwin dfbb6f2e59 ctl_frontend.h: Note that ctl_port.frontend is set by the FETD
Sponsored by:	Chelsio Communications
Differential Revision:	https://reviews.freebsd.org/D42931
2023-12-27 10:09:40 -08:00
John Baldwin e03e77ba4d ctl: Always return errno values from ctl_port_register
Return EBUSY instead of a bare 1 if a port number is already active.

Sponsored by:	Chelsio Communications
Differential Revision:	https://reviews.freebsd.org/D42929
2023-12-27 10:09:24 -08:00
Lexi Winter 30ce26cacf nfsstat: update option strings in docs
Add the missing -q option to the nfsstat(1) manpage SYNOPSIS (it is
already documented in DESCRIPTION), and add the missing -E and -q
options to the built-in usage output.

PR:		275912
MFC after:	2 weeks
Pull Request:	https://github.com/freebsd/freebsd-src/pull/958
2023-12-27 10:57:59 -07:00
Alan Somers 2391e536c0 Fix multiple bugs with ctld's UCL parsing
* Don't segfault when parsing a misformatted auth-group section
* If the config file specifies a chap section within a target but no
  auth-group, create a new anonymous auth-group.  That matches the
  behavior with non-UCL config files.
* Protect some potential segfaults with assertions

PR:		274380
MFC after:	1 week
Sponsored by:	Axcient
Reviewed by:	jhb
Differential Revision: https://reviews.freebsd.org/D43198
2023-12-27 10:49:15 -07:00
Wolfram Schneider c4368d03e5 improve handling of shell metacharacters in filenames
PR:		275967
MFC after:	1 week
2023-12-27 17:36:51 +00:00
Gleb Smirnoff 4a0c6403b0 inpcb: poison several inpcb pointer in in_pcbfree()
There are few subsystems that reference inpcb and allow it to outlive
in_pcbfree().  There are no known bugs with them to unreference the
options pointers for a freed inpcb.  Enforce this so that such bugs
don't appear in the future.

Reviewed by:		markj
Differential Revision:	https://reviews.freebsd.org/D43134
2023-12-27 08:34:37 -08:00
Gleb Smirnoff a13039e270 inpcb: reoder inpcb destruction
First, merge in_pcbdetach() with in_pcbfree().  The comment for
in_pcbdetach() was no longer correct.  Then, make sure we remove
the inpcb from the hash before we commit any destructive actions
on it.  There are couple functions that rely on the hash lock
skipping SMR + inpcb lock to lookup an inpcb.  Although there are
no known functions that similarly rely on the global inpcb list
lock, also do list removal before destructive actions.

PR:			273890
Reviewed by:		markj
Differential Revision:	https://reviews.freebsd.org/D43122
2023-12-27 08:34:37 -08:00
Christos Margiolis 2b1c477d88 fortune: update mailing list search url
Markmail no longer exists.

Reviewed by:	markj
MFC after:	3 days
Differential Revision:	https://reviews.freebsd.org/D43209
2023-12-27 18:28:11 +02:00
Kyle Evans e064557916 daemon: fix recent style regressions
Re-wrap the read(2) line, and make the listen_child loop more explicit
in intent.

Reported by:	kib
Fixes:	6ac7c9f06a ("daemon: remove redundant parameter from [...]")
2023-12-27 10:09:47 -06:00
Mark Johnston 99efa2c88d netmap: Ignore errors in CSB_WRITE()
The CSB_WRITE() and _READ() macros respectively write to and read from
userspace memory and so can in principle fault.  However, we do not
check for errors and will proceed blindly if they fail.  Add assertions
to verify that they do not.

This is in preparation for annotating copyin() and related functions
with __result_use_check.

Reviewed by:	vmaffione
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D43200
2023-12-27 10:13:29 -05:00
Mark Johnston b9924c202f linux: Check for copyout errors in ioctl handlers
In preparation for annotating copyin() and friends with
__result_use_check.

Reviewed by:	dchagin
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D43199
2023-12-27 10:13:15 -05:00
Mark Johnston 344a04ad2c linuxkpi: Annotate an unused variable as such
This addresses a -Wunused-but-set-variable warning in the gcc builds.

No functional change intended.

Reported by:	Jenkins
2023-12-27 10:11:33 -05:00
Konstantin Belousov 3334a537ed Convert fsidcmp(9) from macro to inline function
This allows type checking the arguments.

Explicit structure members comparisions are done to avoid introducting
string.h pollution for userspace.

Reviewed by:	markj
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D43205
2023-12-27 11:50:16 +02:00
Gordon Bergling 63c928f17e gpioevents: Fix a typo in a diagnostic output message
- s/recieved/received/

MFC after:	3 days
2023-12-27 09:41:48 +01:00
Gordon Bergling f795d5458b ipfw(4): Fix a typo in a source code comment
- s/preserv/preserve/

MFC after:	3 days
2023-12-27 09:38:43 +01:00
Gordon Bergling 6dc7bf0c5c hvsock: Fix a typo in a source code comment
- s/recieved/received/

MFC after:	3 days
2023-12-27 09:37:29 +01:00
Gordon Bergling 7b0b448ba9 tcp_stacks: Fix two typos in a source code comments
- s/recieved/received/

MFC after:	3 days
2023-12-27 09:36:30 +01:00
Gordon Bergling c58205be7a tail(1): Fix a typo in a source code comment
- s/recieved/received/

MFC after:	3 days
2023-12-27 09:35:38 +01:00
Ihor Antonov 407e3790c3 daemon: separate pipe_fd[2] into pipe_rd and pipe_wr
This improves code readability and prevents mixing up read and write
ends of the pipe.

Reviewed by:	cperciva, kevans
Requested by:	kevans
2023-12-27 00:07:26 -06:00
Ihor Antonov 5745a58414 daemon: replace memchr with memrchr
Looping over lines in the buffer is not needed.
Same effect can be achieved by looking for the last new line.
If found the buffer is guaranteed to have one or more complete lines.
All complete lines are flushed at once with no looping.

Reviewed by:	cperciva, kevans
2023-12-27 00:07:26 -06:00
Ihor Antonov 24fd3e969e daemon: move buffer into daemon_state
There is no reason for a buffer in listen_child()
to be a static function variable. The buffer and
its position are parts of the daemon state and should
live together with the rest of the state variables.

Reviewed by:	cperciva, kevans
2023-12-27 00:07:25 -06:00
Ihor Antonov 6ac7c9f06a daemon: remove redundant parameter from listen_child()
state already contains pipe fd

Reviewed by:	cperciva, kevans
2023-12-27 00:07:25 -06:00
Ihor Antonov a6f795cc89 daemon: fix clang-tidy warnings
Fixed narrowing conversions:
- strtol replaced with strtonum with range check
- read returns ssize_t
- kevent.data explicitly cast to int before passing into strerror

While we we're here:
- Defined and documented maximum restart delay.
- Fixed typo in a comment.
- Remove unused includes

Reviewed by:	cperciva, kevans
2023-12-27 00:07:25 -06:00
Gleb Smirnoff 97958f5d5c netlink: simplify socket destruction
Destroy the socket at the file descriptor close(2).  There is no
reason to linger for any longer, there are no external references.
Remove pr_detach method as nothing left to do after pr_close.
Remove pr_abort method as it shall never be executed for this type
of socket.

Reviewed by:		melifaro
Differential Revision:	https://reviews.freebsd.org/D42521
2023-12-26 20:22:12 -08:00
Gleb Smirnoff f27aff8f7f linux/netlink: don't override sopt level
This override effectively prevents correct entering of netlink
protocol specific pr_ctloutput in sosetopt().

Reviewed by:		melifaro
Differential Revision:	https://reviews.freebsd.org/D42520
2023-12-26 20:21:58 -08:00
Gleb Smirnoff dbc463119c netlink: remove unused structure 2023-12-26 20:21:58 -08:00
Alexander Motin 7bbac6419d Schedule fast taskqueue callouts on right CPU.
With fast taskqueues using direct callouts we can reduce number of
CPU wakeups by scheduling callout on current CPU if taskqueue calls
taskqueue_enqueue_timeout() on itself.  The trick won't work for
regular taskqueues, since the callout thread will occupy the CPU.
It also may not work in case of multiple threads since we do not
know which thread will pick the task, and we do not want excessive
callout migrations.  So we optimize only the other cases we can.

In practice this allows iichid(4) taskqueue to stay on CPU where
underlying ig4(4) interrupts are routed and to not kick CPU 0 with
timer interrupts on each sampling period (every 2nd/3rd sleep).

MFC after:	1 month
2023-12-26 22:55:24 -05:00
Pawel Jakub Dawidek 4cf4bc7334
Block cloning tests.
The test mostly focus on testing various corner cases.
The tests take a long time to run, so for the common.run runfile
we randomly select a hundred tests.
To run all the bclone tests, bclone.run runfile should be used.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Pawel Jakub Dawidek <pawel@dawidek.net>
Closes #15631
2023-12-26 12:01:53 -08:00
Richard Scheffenegger a8b70cf260 netpfil: Use accessor functions and named constants for all tcphdr flags
Update all remaining references to the struct tcphdr th_x2 field.
This completes the compatibilty of various aspects with AccECN
(TH_AE), after the internal ipfw "re-checksum required" was moved
to use the TH_RES1 flag.

No functional change.

Reviewed By:           tuexen, #transport, glebius
Sponsored by:          NetApp, Inc.
Differential Revision: https://reviews.freebsd.org/D43172
2023-12-25 13:18:01 +01:00
Alexander Motin 358453ce9b iichid(4): Switch taskqueue to "fast"
While "fast" taskqueue may be more expensive due to spinlock use,
when used mainly for timeout tasks it allows to avoid extra context
switches to and from callout thread, that is even more expensive.

MFC after:	1 month
2023-12-26 19:36:34 -05:00
Alexander Motin a8f80c0c16 iichid(4): Unify two taskqueue tasks
taskqueue_enqueue_timeout(0) is equivalent to taskqueue_enqueue(),
so no need to create a separate periodic_task and event_task to run
exactly the same handler.

MFC after:	1 month
2023-12-26 19:28:56 -05:00
Mark Johnston ddc8576d29 fb: Explicitly handle errors when getting or setting a colour palette
In the VESA driver, simply ignore errors.  It is not clear to me how to
return them to userspace.

This is in preparation for annotating copyin() and related functions
with __result_use_check.

MFC after:	1 week
2023-12-26 19:01:26 -05:00
Mark Johnston b4a9e6d814 hptmv: Handle errors from copyout() in hpt_set_info()
This is in preparation for annotating copyin() and related functions
with __result_use_check.

MFC after:	1 week
2023-12-26 19:01:26 -05:00
Mark Johnston 2873d841f8 tdfx: Handle errors from copyin() and copyout()
This is in preparation for annotating copyin() and related functions
with __result_use_check.

MFC after:	1 week
2023-12-26 19:00:53 -05:00