Commit Graph

273602 Commits

Author SHA1 Message Date
Peter Holm
0977ebb071 stress2: A unmount of a unionfs file system may return EBUSY. 2022-03-15 10:24:55 +01:00
Mateusz Piotrowski
11a6c85d7f hier: Document /usr/freebsd-dist
/usr/freebsd-dist is used used by various programs as the location for
FreeBSD distribution files. In-tree programs following this convention
are bsdinstall(8) and release(7).

Reviewed by:	Pau Amma <pauamma@gundo.com>
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D34552
2022-03-15 09:54:38 +01:00
Peter Holm
9e8fbb95b3 stress2: A unmount of a unionfs file system may return EBUSY. 2022-03-15 09:35:22 +01:00
Tom Jones
81e0e7b9e3 bsnmp: Use mkstemp when creating clients local socket
Reviewed by:	harti, rew
Sponsored by:   NetApp, Inc.
Sponsored by:   Klara, Inc.
X-NetApp-PR:    #72
Differential Revision:	https://reviews.freebsd.org/D34550
2022-03-15 08:20:13 +00:00
Wei Hu
80c3eb7bc6 Hyper-V: hn: add switch to turn on and off RSC
Currently RSC offloading is enabled by default.
With this new change rsc will be disabled by default.
By using sysctl we can enable and disable it.

Reviewed by:	whu
Signed-off-by:	Souradeep Chakrabarti <schakrabarti@microsoft.com>
Fixes:		a491581f3f Enable vSwitch RSC support in hn netvsc driver
MFC after:	1 week
Sponsored by:	Microsoft
Differential Revision:	https://reviews.freebsd.org/D34507
2022-03-15 08:12:22 +00:00
Kristof Provost
734782a781 pf tests: Test new L3 inspection for pf 'ether' rules
Sponsored by:	Rubicon Communications, LLC ("Netgate")
Differential Revision:	https://reviews.freebsd.org/D34483
2022-03-14 22:43:38 +01:00
Kristof Provost
8a42005d1e pf: support basic L3 filtering in the Ethernet rules
Allow filtering based on the source or destination IP/IPv6 address in
the Ethernet layer rules.

Reviewed by:	pauamma_gundo.com (man), debdrup (man)
Sponsored by:	Rubicon Communications, LLC ("Netgate")
Differential Revision:	https://reviews.freebsd.org/D34482
2022-03-14 22:42:37 +01:00
John Baldwin
2814ba8ef1 Move NO_WUNUSED_BUT_SET_VARIABLE clang helper to the right place.
Reviewed by:	imp, dim, emaste
Sponsored by:	University of Cambridge, Google, Inc.
Differential Revision:	https://reviews.freebsd.org/D34537
2022-03-14 14:05:25 -07:00
John Baldwin
18207579a2 module_test: Fix some assignments to errno intended to be tests.
Reported by:	vangyzen
Reviewed by:	vangyzen, markj
Sponsored by:	University of Cambridge, Google, Inc.
Differential Revision:	https://reviews.freebsd.org/D34528
2022-03-14 14:05:05 -07:00
Hans Petter Selasky
d5ad1713cc Chase mixer(8) command-line interface changes
Some more nits regarding mute feature.

Differential revision:	https://reviews.freebsd.org/D34545
Sponsored by:		NVIDIA Networking
2022-03-14 09:38:04 +01:00
Wojciech Macek
25bcd81b8d armv6/legacy: optimize cpu_getcount performance
Use nanotime instread of binuptime.
This change is for old and legacy platforms and does not impact any armv7 and later.
Might be MFCed to 13.0 once armv6 support is finally dropped in 14.0

Sponsored by:		Stormshield
Reviewed by:		mw
Obtained from:		Semihalf
Differential revision:	https://reviews.freebsd.org/D33719
2022-03-14 07:51:21 +01:00
Xin LI
1d33307434 Update leap-seconds to leap-seconds.3676924800
Obtained from:	ftp://ftp.boulder.nist.gov/pub/time/leap-seconds.3676924800
MFC after:	3 days
2022-03-13 23:37:56 -07:00
Rick Macklem
57014f21e7 nfscl: Fix NFSv4.1/4.2 Lookup+Open RPC
Use of the Lookup+Open RPC is currently disabled,
due to a problem detected during testing.  This
patch fixes this problem.  The problem was that
nfscl_postop_attr() does not parse the attributes
if nd_repstat != 0.  It also would parse the
return status for the operation, where the
Lookup+Open code had already parsed it.

The first change in the patch does not make any
semantics change, but makes the code identical
to what is done later in the function, so that
it is apparent that the semantics should be the
same in both places.

Lookup+Open remains disabled while further
testing is being done, so this patch has no
effect at this time.
2022-03-13 13:15:12 -07:00
Jose Luis Duran
19a6267d61 rc.d/*: Use startmsg instead of echo on start messages
By rc.conf(5), setting rc_startmsgs="NO" should silence start messages.

Fix a few rc scripts by using startmsg.

PR:		255207
Reported by:	Jose Luis Duran <jlduran@gmail.com>
Reviewed by:	imp, 0mp
Approved by:	imp (src)
Differential Revision:	https://reviews.freebsd.org/D34514
2022-03-13 18:57:31 +01:00
Jose Luis Duran
325ebf37d8 Introduce startmsg and use it in rc scripts
startmsg is a new rc.subr(8) function function to be used instead of
echo(1) when for boot messages. It replaces the often forgotten

    check_startmsgs && echo ...

with

    startmsg ...

No functional change intended.

I adjusted the commit message and did some final clean-ups of the patch
before committing.

PR:		255207
Reported by:	Jose Luis Duran <jlduran@gmail.com>
Reviewed by:	imp, 0mp
Approved by:	imp (src)
Differential Revision:	https://reviews.freebsd.org/D34514
2022-03-13 18:57:29 +01:00
Mateusz Piotrowski
e83a53abeb Chase mixer(8) command-line interface changes
FreeBSD 14.0 is going to ship with a new implementation of the mixer(8)
command. Unfortunately, in order to support new features like mute, the
command-line interface of the new implementation is not backwards
compatible.

Update all the remaining documentation and scripts in the src tree
to use the new syntax.

While here, document in usbhidaction.1 that the mute functionality is
now supported.

Reviewed by:	christos, debdrup, hselasky
Approved by:	hselasky (src)
Fixes:	903873ce15 Implement and use new mixer(3) library for FreeBSD.
Differential Revision:	https://reviews.freebsd.org/D34545
2022-03-13 17:43:49 +01:00
Mateusz Guzik
0134bbe56f vfs: prefix lookup and relookup with vfs_
Reviewed by:	imp, mckusick
Differential Revision:		https://reviews.freebsd.org/D34530
2022-03-13 14:44:39 +00:00
Mateusz Guzik
02fc4e319c cache: use flexible array member
... instead of 0-sizing the array
2022-03-13 14:43:35 +00:00
Hans Petter Selasky
16346e1401 usbtest: Fix issue when multiple devices are sharing same USB vendor and product ID.
When there are multiple devices sharing the same USB vendor and product ID,
the wrong device may be selected. Fix this by also matching the bus and
device address, ugen<X>.<Y> .

MFC after:	1 week
Sponsored by:	NVIDIA Networking
2022-03-13 15:18:17 +01:00
Mateusz Piotrowski
c36d04222d mixer .8: Clean up the manual page
- Use correct macros (e.g., Pa for paths, Ar for arguments, Cm for
  command modifiers).
- Pet igor and mandoc -Tlint (e.g., start sentences after a newline).
- Use Ta instead of a tab character in tables.
- Stylize all table headers with Sy consistency.
- Add a missing "vol" variant to the synopsis of "dev.volume".
- Sort dev.recsrc command modifiers consistency.
- Use "Bd -literal" for code blocks in the examples. "Bl -tag" is not
  the right macro for that.

Fixes:	903873ce15 Implement and use new mixer(3) library for FreeBSD.
2022-03-13 13:40:51 +01:00
Piotr Kubaj
3781e77995 riscv: actually enable sanitizers
1. Backport b475ce39e8.
2. Enable libclang_rt for riscv.

Previous commit missed it.

MFC after:	3 days
Reviewed by:	dim
Differential Revision: https://reviews.freebsd.org/D34543
2022-03-13 13:06:57 +01:00
Alfonso S. Siciliano
bce40c0242
Merge commit '2f8d4418415511460bd7b3b3e532f6b328cf993f' 2022-03-13 02:38:51 +01:00
Alfonso S. Siciliano
2f8d441841
bsddialog: Import version0.2
This version provides improvements and fixes mainly to use bsddialog
utility in bsdinstall/scripts. The lib API is not broken so the
previous converted utilities (tzsetup, distextract, etc.) are OK.

Approved by:		bapt (mentor)
Differential Revision:	https://reviews.freebsd.org/D34458
2022-03-13 02:34:57 +01:00
Matteo Riondato
a33ead9c9c pfdenied: match actual variable name to the documented one
PR:		262446
Reviewed by:	kp
2022-03-12 23:59:25 +01:00
Alexander Motin
7f16b501e2 GEOM: Introduce partial confxml API
Traditionally the GEOM's primary channel of information from kernel to
user-space was confxml, fetched by libgeom through kern.geom.confxml
sysctl.  It is convenient and informative, representing full state of
GEOM in a single XML document.  But problems start to arise on systems
with hundreds of disks, where the full confxml size reaches many
megabytes, taking significant time to first write it and then parse.

This patch introduces alternative solution, allowing to fetch much
smaller XML document, subset of the full confxml, limited to 64KB and
representing only one specified geom and optionally its parents.  It
uses existing GEOM control interface, extended with new "getxml" verb.
In case of any error, such as the buffer overflow, it just transparently
falls back to traditional full confxml.  This patch uses the new API in
user-space GEOM tools where it is possible.

Reviewed by:	imp
MFC after:	2 month
Sponsored by:	iXsystems, Inc.
Differential Revision:	https://reviews.freebsd.org/D34529
2022-03-12 11:55:52 -05:00
Steve Wills
db11c57a6c usr.bin/who.c: Fix boot time checking
The boot time entry doesn't have a tty specified, so don't check it.
While here, make ttystat handle that case.

Approved by:	kevans (src)
Differential Revision:	https://reviews.freebsd.org/D34524
2022-03-12 11:49:49 -05:00
Mateusz Guzik
5fc3cc2713 amd64: make bcmp in libc just call memcmp
Preferably bcmp would just alias memcmp but there is build magic which
makes this problematic.

Reviewed by:	jhb
Differential Revision:		https://reviews.freebsd.org/D28846
2022-03-12 14:59:14 +00:00
Ed Maste
cf8880d52b teken: color #3 is yellow not brown - use TC_YELLOW as the name
The console escape code standard (ECMA-48) specifies color #3 (escape
code 33) as yellow.  A brown console color is an artifact of the VGA
palette, which replaces dim (but not bright) yellow with brown.

Reviewed by:	adrian, imp
MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D34531
2022-03-12 09:17:29 -05:00
Mateusz Guzik
66b177e1b4 vfs: reduce spurious zeroing in VOP_STAT
clang fails to take advantage of the fact that majority of the struct
gets written to in the routine and decides to bzero the entire thing.

Explicitly zero padding and spare fields, relying on KMSAN to catch
problems should anything pop up later which also needs explicit
zeroing.

fstat on tmpfs (ops/s):
before: 8216636
after:  8508033
2022-03-12 12:05:37 +00:00
Mateusz Guzik
381dd12cea vfs: stop evaluating the argument multpile times in stat macros 2022-03-12 11:47:07 +00:00
Mariusz Zaborski
cb54c500d0 touch: don't leak descriptor if fstat(2) fails
If fstat(2) fails the close(2) won't be called, which will leak the
file descriptor.

The idea was borrowed from OpenBSD, where similar patch
was applied for futimens(2).

MFC after:	1 week
2022-03-12 11:38:12 +01:00
Jens Schweikhardt
54b75edd9e Correct minor typos/grammos and break long lines to fit in 80 chars. 2022-03-12 10:43:39 +01:00
Ed Maste
e9249ef958 loader: accept "yellow" as a named color
For historical reasons console color number 3 may be either yellow (most
consoles) or brown (VGA palette).  The console escape code standard
uses "yellow", but teken color name constants appear to be based on the
VGA scheme and use TC_BROWN for color 3.  Even so, the palette table
used 50,50,0 as the RGB percentage tuple, resulting in a dim yellow for
framebuffer consoles at the time teken was introduced.

Amusingly, in 19e2ce2d83 the comment on the palette entry was changed
from "brown" to "dark yellow" but the colour itself was changed from
a pure yellow to being somewhat brown.

MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
2022-03-11 15:22:13 -05:00
John Baldwin
6bb7ba4aa1 arm64 hwpmc: Support restricting counters to user or kernel mode.
Support the "usr" and "os" qualifiers on arm64 events to restrict
event counting to either usermode or the kernel, respectively.  If
neither qualifier is given, events are counted in both.

Reviewed by:	emaste
Sponsored by:	University of Cambridge, Google, Inc.
Differential Revision:	https://reviews.freebsd.org/D34527
2022-03-11 11:29:45 -08:00
John Baldwin
456d57a66d aarch64: Add constants for fields in the PMEVTYPERn_EL0 event registers.
Reviewed by:	andrew
Sponsored by:	University of Cambridge, Google, Inc.
Differential Revision:	https://reviews.freebsd.org/D34526
2022-03-11 11:29:45 -08:00
Ed Maste
425e57e7a2 loader: support numeric and named bright colors (8-15)
Accept "bright" or "light" prefix for named colors.

For numeric colors, update error message to specify that values 0 to 15
are allowed, and verify that values are in that range.

Reviewed by:	imp, tsoome (both earlier version)
MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D34512
2022-03-11 14:20:34 -05:00
Andrew Turner
7e35f7834c Revert "Add the PMCR_EL0.N arm64 register field"
This reverts commit b6fd96ed0b.
2022-03-11 17:52:08 +00:00
Eric van Gyzen
86b12bbc71 ratecheck: mininterval is const
Reflect this in the man page.

MFC after:	1 week
Sponsored by:	Dell EMC Isilon
2022-03-11 11:35:41 -06:00
Hans Petter Selasky
a23e475c48 lindebugfs: Make single_release() NULL safe.
MFC after:	1 week
Sponsored by:	NVIDIA Networking
2022-03-11 17:41:33 +01:00
Hans Petter Selasky
68ec2949ad lindebugfs: The Linux file operations use negative return values in the kernel.
Fix sign.

MFC after:	1 week
Sponsored by:	NVIDIA Networking
2022-03-11 17:41:33 +01:00
Hans Petter Selasky
88a29d89eb lindebugfs: Zero the linux_file structure before use.
This avoids clients using garbage values on the stack and makes
debugging easier.

MFC after:	1 week
Sponsored by:	NVIDIA Networking
2022-03-11 17:41:33 +01:00
Andrew Turner
4dc815608e Add more arm64 register op* and CR* values
These will be used by bhyve/arm64.

Sponsored by:	Innovate UK
2022-03-11 11:21:09 +00:00
Andrew Turner
b6fd96ed0b Add the PMCR_EL0.N arm64 register field
Sponsored by:	Innovate UK
2022-03-11 11:21:09 +00:00
Andrew Turner
a1b4e4fa9a Correct the location of the arm64 PMCR register
This was one of the last registers to not be in alphabetical order in
armreg.h. Fix this to make it easier to find.

Sponsored by:	Innovate UK
2022-03-11 11:21:09 +00:00
Andrew Turner
2abeef7300 Sort the M* and P* arm64 registers
Sponsored by:	Innovate UK
2022-03-11 11:21:09 +00:00
Baptiste Daroussin
7da4ef4ef2 pci_vendors: update to 2022.03.06 2022-03-11 10:49:45 +01:00
Hans Petter Selasky
419822b372 libgeom(3): Use calloc instead of malloc and bzero.
Pull Request:	https://github.com/freebsd/freebsd-src/pull/546
MFC after:	1 week
Sponsored by:	NVIDIA Networking
2022-03-11 10:38:16 +01:00
Alfonso
3322d1c0e2 ps(1): Use calloc instead of malloc and memset.
Pull Request:	https://github.com/freebsd/freebsd-src/pull/546
MFC after:	1 week
Sponsored by:	NVIDIA Networking
2022-03-11 10:36:00 +01:00
Wuyang Chung
c5f549c1e0 newfs(8): Fix a bug in initialization of sblock.fs_maxbsize .
Fixes:		1c85e6a35d (SVN r98542)
Pull Request:	https://github.com/freebsd/freebsd-src/pull/587
MFC after:	1 week
Sponsored by:	NVIDIA Networking
2022-03-11 10:17:06 +01:00
Baptiste Daroussin
2eee44bd5e df: do not report a 100% full inode usage on fs without inodes
Before:
devfs    2        2         0   100%       0          0  100%   /dev

After:
devfs    2        2         0   100%       0          0     -   /dev

The previous behaviour was confusing for end users and many monitoring tools

Note the linux df tools is also using the same syntax '-' for such filesystem

MFC After:		2 weeks
Reviewed by:		manu, emaste, imp
Differential Revision:	https://reviews.freebsd.org/D34515
2022-03-11 08:49:44 +01:00