aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--bin/rm/rm.c4
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/dtrace.110
-rw-r--r--share/man/man4/Makefile2
-rw-r--r--share/man/man4/geom_zero.4174
-rw-r--r--share/man/man4/zero.43
-rw-r--r--sys/netlink/netlink_generic.c4
-rw-r--r--tests/sys/netinet/Makefile2
-rw-r--r--usr.sbin/bsdinstall/partedit/gpart_ops.c14
-rw-r--r--usr.sbin/utx/utx.82
9 files changed, 202 insertions, 13 deletions
diff --git a/bin/rm/rm.c b/bin/rm/rm.c
index 16bbf7403fd4..2c41d7380cea 100644
--- a/bin/rm/rm.c
+++ b/bin/rm/rm.c
@@ -184,7 +184,7 @@ rm_tree(char **argv)
flags = FTS_PHYSICAL;
if (!needstat)
flags |= FTS_NOSTAT;
- if (Wflag)
+ if (Wflag || fflag)
flags |= FTS_WHITEOUT;
if (xflag)
flags |= FTS_XDEV;
@@ -273,7 +273,7 @@ rm_tree(char **argv)
case FTS_W:
rval = undelete(p->fts_accpath);
- if (rval == 0 && (fflag && errno == ENOENT)) {
+ if (rval == 0 || (fflag && errno == ENOENT)) {
if (vflag)
(void)printf("%s\n",
p->fts_path);
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/dtrace.1 b/cddl/contrib/opensolaris/cmd/dtrace/dtrace.1
index 1a9f8029e6de..5115d16a1286 100644
--- a/cddl/contrib/opensolaris/cmd/dtrace/dtrace.1
+++ b/cddl/contrib/opensolaris/cmd/dtrace/dtrace.1
@@ -20,7 +20,7 @@
.\"
.\" $FreeBSD$
.\"
-.Dd November 6, 2025
+.Dd November 8, 2025
.Dt DTRACE 1
.Os
.Sh NAME
@@ -1252,6 +1252,14 @@ command line to define a set of macro variables and so forth).
The additional arguments can be used in D programs specified using the
.Fl s
option or on the command line.
+.Sh ENVIRONMENT
+.Bl -tag -width 'DTRACE_DEBUG'
+.It Ev DTRACE_DEBUG
+When defined,
+.Nm
+will output debug log messages to
+.Xr stderr 4 .
+.El
.Sh FILES
.Bl -tag -width /boot/dtrace.dof -compact
.It Pa /boot/dtrace.dof
diff --git a/share/man/man4/Makefile b/share/man/man4/Makefile
index fe1d285aec96..752ae9f165ca 100644
--- a/share/man/man4/Makefile
+++ b/share/man/man4/Makefile
@@ -189,6 +189,7 @@ MAN= aac.4 \
geom.4 \
geom_linux_lvm.4 \
geom_uzip.4 \
+ geom_zero.4 \
gif.4 \
${_gve.4} \
gpio.4 \
@@ -1123,6 +1124,7 @@ MAN+= \
veriexec.4 \
zyd.4
+MLINKS+=geom_zero.4 gzero.4
MLINKS+=mtw.4 if_mtw.4
MLINKS+=otus.4 if_otus.4
MLINKS+=rsu.4 if_rsu.4
diff --git a/share/man/man4/geom_zero.4 b/share/man/man4/geom_zero.4
new file mode 100644
index 000000000000..8da09b1473c9
--- /dev/null
+++ b/share/man/man4/geom_zero.4
@@ -0,0 +1,174 @@
+.\"
+.\" Copyright (c) 2019 Greg White <gkwhite@gmail.com>. All rights reserved.
+.\" Copyright (c) 2025 Mateusz Piotrowski <0mp@FreeBSD.org>
+.\"
+.\" SPDX-License-Identifier: BSD-2-Clause
+.\"
+.Dd November 9, 2025
+.Dt GEOM_ZERO 4
+.Os
+.Sh NAME
+.Nm gzero ,
+.Nm geom_zero
+.Nd GEOM-based zero disk/block device
+.Sh SYNOPSIS
+.Cd "options GEOM_ZERO"
+.Pp
+In
+.Xr loader.conf 5
+or
+.Xr sysctl.conf 5 :
+.Cd kern.geom.zero.byte
+.Cd kern.geom.zero.clear
+.Sh DESCRIPTION
+.Nm
+is a
+.Xr GEOM 4
+device simulating a one-exabyte disk.
+It throws away any data written to it,
+and returns the value of
+.Va kern.geom.zero.byte
+for every byte read from it.
+.Pp
+.Nm
+differs from
+.Xr zero 4 ,
+which is a regular character device and has an infinite length,
+while
+.Pa /dev/gzero
+is a
+.Xr GEOM 4
+provider of large, but limited, size.
+.Pp
+Consult
+.Xr geom 8
+for instructions on how to use the supported commands of the
+.Xr GEOM 4
+.Nm ZERO
+class.
+.Pp
+.Nm
+is useful for benchmarking performance of GEOM and GEOM classes
+where compression of the data does not affect the results
+.Po blocks from
+.Pa /dev/gzero
+compress exceptionally well
+.Pc .
+Examples of such benchmarks include
+comparing the speed of two disk encryption algorithms and
+comparing a hardware versus software implementation
+of a single encryption algorithm.
+.Sh MIB VARIABLES
+The following variables are available as both
+.Xr sysctl 8
+variables and
+.Xr loader 8
+tunables:
+.Bl -tag -width "kern.geom.zero.clear"
+.It Va kern.geom.zero.byte
+This variable sets the fill byte of the
+.Nm
+device.
+Default:
+.Ql 0 .
+.It Va kern.geom.zero.clear
+This variable controls the clearing of the read data buffer.
+If set to
+.Ql 0 ,
+.Nm
+will not copy any data into the read data buffers
+and just return the read data buffers as they are without modifying them.
+In particular, it will not not fill the read buffer with the value of
+.Va kern.geom.zero.byte .
+This is useful for read benchmarking to reduce the measurement noise
+caused by extra memory initialization.
+Default:
+.Ql 1 .
+.El
+.Sh FILES
+.Bl -tag -width /dev/gzero
+.It Pa /dev/gzero
+The
+.Nm
+device.
+.El
+.Sh EXAMPLES
+Create the
+.Pa /dev/gzero
+device by loading the
+.Nm geom_zero
+kernel module:
+.Bd -literal -offset indent
+# geom zero load
+.Ed
+.Pp
+Show information about the
+.Nm
+device:
+.Bd -literal -offset indent
+# geom zero list
+Geom name: gzero
+Providers:
+1. Name: gzero
+ Mediasize: 1152921504606846976 (1.0E)
+ Sectorsize: 512
+ Mode: r0w0egzero0
+.Ed
+.Pp
+Set the fill byte of the
+.Nm
+device to 70
+.Po decimal for letter
+.Dq F
+in
+.Xr ascii 7
+.Pc :
+.Bd -literal -offset indent
+# sysctl kern.geom.zero.byte=70
+kern.geom.zero.byte: 0 -> 70
+# head -c 1 /dev/gzero
+F
+.Ed
+.Pp
+Benchmark read and write throughput of
+.Xr geli 8 Ap s
+default encryption algorithm with a 4-KiB sector size:
+.Bd -literal -offset indent
+# geom zero load
+# geli onetime -s 4096 gzero
+# sysctl kern.geom.zero.clear=0
+# dd if=/dev/gzero.eli of=/dev/zero bs=4k count=$((1024 * 256))
+262144+0 records in
+262144+0 records out
+1073741824 bytes transferred in 1.258195 secs (853398307 bytes/sec)
+# dd if=/dev/zero of=/dev/gzero.eli bs=4k count=$((1024 * 256))
+262144+0 records in
+262144+0 records out
+1073741824 bytes transferred in 1.663118 secs (645619658 bytes/sec)
+.Ed
+.Sh SEE ALSO
+.Xr GEOM 4 ,
+.Xr zero 4 ,
+.Xr geom 8 ,
+.Xr sysctl 8 ,
+.Xr bio 9
+.Sh HISTORY
+A
+.Nm
+device first appeared in
+.Fx 6 .
+.Sh AUTHORS
+.An -nosplit
+The
+.Nm
+device was written by
+.An Paweł Jakub Dawidek Aq Mt pjd@FreeBSD.org .
+.Pp
+The
+.Nm
+manual page was originally written by
+.An Greg White Aq Mt gkwhite@gmail.com
+and rewritten by
+.An Mateusz Piotrowski Aq Mt 0mp@FreeBSD.org
+before landing in
+.Fx .
diff --git a/share/man/man4/zero.4 b/share/man/man4/zero.4
index f1cd52d455d1..85651d53d342 100644
--- a/share/man/man4/zero.4
+++ b/share/man/man4/zero.4
@@ -29,7 +29,7 @@
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
-.Dd April 7, 1996
+.Dd November 9, 2025
.Dt ZERO 4
.Os
.Sh NAME
@@ -48,6 +48,7 @@ supply of null bytes when read.
.El
.Sh SEE ALSO
.Xr full 4 ,
+.Xr gzero 4 ,
.Xr null 4
.Sh HISTORY
A
diff --git a/sys/netlink/netlink_generic.c b/sys/netlink/netlink_generic.c
index 00f47e60f013..d20ec4c7545f 100644
--- a/sys/netlink/netlink_generic.c
+++ b/sys/netlink/netlink_generic.c
@@ -366,8 +366,10 @@ genl_register_family(const char *family_name, size_t hdrsize,
GENL_LOCK();
for (u_int i = 0; i < MAX_FAMILIES; i++)
if (families[i].family_name != NULL &&
- strcmp(families[i].family_name, family_name) == 0)
+ strcmp(families[i].family_name, family_name) == 0) {
+ GENL_UNLOCK();
return (0);
+ }
/* Microoptimization: index 0 is reserved for the control family. */
gf = NULL;
diff --git a/tests/sys/netinet/Makefile b/tests/sys/netinet/Makefile
index 9739221676ce..b3d76d1da125 100644
--- a/tests/sys/netinet/Makefile
+++ b/tests/sys/netinet/Makefile
@@ -46,6 +46,8 @@ TEST_METADATA.fibs_test+= execenv="jail" \
TEST_METADATA.forward+= required_programs="python" \
execenv="jail" \
execenv_jail_params="vnet allow.raw_sockets"
+TEST_METADATA.multicast+= execenv="jail" \
+ execenv_jail_params="vnet"
TEST_METADATA.output+= required_programs="python"
TEST_METADATA.redirect+= required_programs="python"
diff --git a/usr.sbin/bsdinstall/partedit/gpart_ops.c b/usr.sbin/bsdinstall/partedit/gpart_ops.c
index 0bcd17950daf..8da85a805545 100644
--- a/usr.sbin/bsdinstall/partedit/gpart_ops.c
+++ b/usr.sbin/bsdinstall/partedit/gpart_ops.c
@@ -139,16 +139,16 @@ newfs_command(const char *fstype, int use_default)
} else if (strcmp(fstype, "freebsd-zfs") == 0) {
int i;
struct bsddialog_menuitem items[] = {
- {"", 0, true, "fletcher4", "checksum algorithm: fletcher4",
+ {"", true, 0, "fletcher4", "checksum algorithm: fletcher4",
"Use fletcher4 for data integrity checking. "
"(default)"},
- {"", 0, false, "fletcher2", "checksum algorithm: fletcher2",
+ {"", false, 0, "fletcher2", "checksum algorithm: fletcher2",
"Use fletcher2 for data integrity checking. "
"(not recommended)"},
- {"", 0, false, "sha256", "checksum algorithm: sha256",
+ {"", false, 0, "sha256", "checksum algorithm: sha256",
"Use sha256 for data integrity checking. "
"(not recommended)"},
- {"", 0, false, "atime", "Update atimes for files",
+ {"", false, 0, "atime", "Update atimes for files",
"Disable atime update"},
};
@@ -188,11 +188,11 @@ newfs_command(const char *fstype, int use_default)
strcmp(fstype, "ms-basic-data") == 0) {
int i;
struct bsddialog_menuitem items[] = {
- {"", 0, true, "FAT32", "FAT Type 32",
+ {"", true, 0, "FAT32", "FAT Type 32",
"Create a FAT32 filesystem (default)"},
- {"", 0, false, "FAT16", "FAT Type 16",
+ {"", false, 0, "FAT16", "FAT Type 16",
"Create a FAT16 filesystem"},
- {"", 0, false, "FAT12", "FAT Type 12",
+ {"", false, 0, "FAT12", "FAT Type 12",
"Create a FAT12 filesystem"},
};
diff --git a/usr.sbin/utx/utx.8 b/usr.sbin/utx/utx.8
index ddcdcc08b2d2..354691e7138f 100644
--- a/usr.sbin/utx/utx.8
+++ b/usr.sbin/utx/utx.8
@@ -92,4 +92,4 @@ utility replaced
in
.Fx 10.0 .
.Sh AUTHORS
-.An Ed Schouten Aq Mt ed@FreeBSD.org
+.An \&Ed Schouten Aq Mt ed@FreeBSD.org