Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions distrib/sets/lists/base/mi
Original file line number Diff line number Diff line change
Expand Up @@ -393,6 +393,7 @@
./sbin/fsck_v7fs base-sysutil-root v7fs
./sbin/fsdb base-sysutil-root
./sbin/fsirand base-sysutil-root
./sbin/fullfsctl base-miscfs-root fullfs
./sbin/gpt base-sysutil-root
./sbin/halt base-sysutil-root
./sbin/ifconfig base-netutil-root
Expand Down Expand Up @@ -420,6 +421,7 @@
./sbin/mount_fdesc base-miscfs-root fdescfs
./sbin/mount_ffs base-sysutil-root
./sbin/mount_filecore base-filecorefs-root filecorefs
./sbin/mount_full base-miscfs-root fullfs
./sbin/mount_hfs base-hfs-root hfs
./sbin/mount_hfsp base-obsolete obsolete
./sbin/mount_kernfs base-sysutil-root kernfs
Expand Down Expand Up @@ -1128,6 +1130,7 @@
./usr/include/miscfs base-c-usr
./usr/include/miscfs/fdesc base-c-usr
./usr/include/miscfs/fifofs base-c-usr
./usr/include/miscfs/fullfs base-c-usr
./usr/include/miscfs/genfs base-c-usr
./usr/include/miscfs/kernfs base-c-usr
./usr/include/miscfs/nullfs base-c-usr
Expand Down
3 changes: 3 additions & 0 deletions distrib/sets/lists/base/shl.mi
Original file line number Diff line number Diff line change
Expand Up @@ -677,6 +677,9 @@
./usr/lib/librumpfs_ffs.so base-rump-shlib rump
./usr/lib/librumpfs_ffs.so.0 base-rump-shlib rump
./usr/lib/librumpfs_ffs.so.0.0 base-rump-shlib rump
./usr/lib/librumpfs_full.so base-rump-shlib rump
./usr/lib/librumpfs_full.so.0 base-rump-shlib rump
./usr/lib/librumpfs_full.so.0.0 base-rump-shlib rump
./usr/lib/librumpfs_hfs.so base-rump-shlib rump
./usr/lib/librumpfs_hfs.so.0 base-rump-shlib rump
./usr/lib/librumpfs_hfs.so.0.0 base-rump-shlib rump
Expand Down
4 changes: 4 additions & 0 deletions distrib/sets/lists/comp/mi
Original file line number Diff line number Diff line change
Expand Up @@ -2787,6 +2787,8 @@
./usr/include/milter/mfdef.h comp-obsolete obsolete
./usr/include/miscfs/fdesc/fdesc.h comp-c-include
./usr/include/miscfs/fifofs/fifo.h comp-c-include
./usr/include/miscfs/fullfs/full.h comp-c-include
./usr/include/miscfs/fullfs/full_ioctl.h comp-c-include
./usr/include/miscfs/genfs/genfs.h comp-c-include
./usr/include/miscfs/genfs/genfs_node.h comp-c-include
./usr/include/miscfs/genfs/layer.h comp-c-include
Expand Down Expand Up @@ -4339,6 +4341,8 @@
./usr/lib/librumpfs_fdesc_p.a comp-c-proflib rump,profile
./usr/lib/librumpfs_ffs.a comp-c-lib rump
./usr/lib/librumpfs_ffs_p.a comp-c-proflib rump,profile
./usr/lib/librumpfs_full.a comp-c-lib rump,fullfs
./usr/lib/librumpfs_full_p.a comp-c-proflib rump,fullfs,profile
./usr/lib/librumpfs_hfs.a comp-c-lib rump
./usr/lib/librumpfs_hfs_p.a comp-c-proflib rump,profile
./usr/lib/librumpfs_kernfs.a comp-c-lib rump
Expand Down
3 changes: 3 additions & 0 deletions distrib/sets/lists/debug/mi
Original file line number Diff line number Diff line change
Expand Up @@ -368,6 +368,7 @@
./usr/libdata/debug/sbin/fsck_v7fs.debug comp-sysutil-debug v7fs,debug
./usr/libdata/debug/sbin/fsdb.debug comp-sysutil-debug debug
./usr/libdata/debug/sbin/fsirand.debug comp-sysutil-debug debug
./usr/libdata/debug/sbin/fullfsctl.debug comp-miscfs-debug fullfs,debug
./usr/libdata/debug/sbin/gpt.debug comp-sysutil-debug debug
./usr/libdata/debug/sbin/ifconfig.debug comp-netutil-debug debug
./usr/libdata/debug/sbin/init.debug comp-sysutil-debug debug
Expand All @@ -391,6 +392,7 @@
./usr/libdata/debug/sbin/mount_fdesc.debug comp-miscfs-debug fdescfs,debug
./usr/libdata/debug/sbin/mount_ffs.debug comp-sysutil-debug debug
./usr/libdata/debug/sbin/mount_filecore.debug comp-filecorefs-debug filecorefs,debug
./usr/libdata/debug/sbin/mount_full.debug comp-miscfs-debug fullfs,debug
./usr/libdata/debug/sbin/mount_hfs.debug comp-hfs-debug hfs,debug
./usr/libdata/debug/sbin/mount_kernfs.debug comp-sysutil-debug kernfs,debug
./usr/libdata/debug/sbin/mount_lfs.debug comp-sysutil-debug lfs,debug
Expand Down Expand Up @@ -1714,6 +1716,7 @@
./usr/libdata/debug/usr/tests/fs/ffs/t_snapshot_v2.debug tests-fs-debug debug,atf,rump
./usr/libdata/debug/usr/tests/fs/ffs/t_update_log.debug tests-fs-debug debug,atf,rump
./usr/libdata/debug/usr/tests/fs/fifofs/t_fifo.debug tests-fs-debug debug,atf,rump
./usr/libdata/debug/usr/tests/fs/fullfs/t_basic.debug tests-fs-debug fullfs,debug,atf,rump
./usr/libdata/debug/usr/tests/fs/hfs/t_pathconvert.debug tests-fs-debug hfs,debug,atf,rump
./usr/libdata/debug/usr/tests/fs/kernfs/t_basic.debug tests-fs-debug kernfs,debug,atf,rump
./usr/libdata/debug/usr/tests/fs/lfs/t_basic.debug tests-fs-debug lfs,debug,atf,rump
Expand Down
2 changes: 2 additions & 0 deletions distrib/sets/lists/debug/module.mi
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,8 @@
./usr/libdata/debug/@MODULEDIR@/flash/flash.kmod.debug modules-base-kernel kmod,debug
./usr/libdata/debug/@MODULEDIR@/fss modules-base-kernel kmod,debug
./usr/libdata/debug/@MODULEDIR@/fss/fss.kmod.debug modules-base-kernel kmod,debug
./usr/libdata/debug/@MODULEDIR@/full modules-base-kernel kmod,debug
./usr/libdata/debug/@MODULEDIR@/full/full.kmod.debug modules-base-kernel kmod,debug
./usr/libdata/debug/@MODULEDIR@/gpio modules-base-kernel kmod,debug
./usr/libdata/debug/@MODULEDIR@/gpio/gpio.kmod.debug modules-base-kernel kmod,debug
./usr/libdata/debug/@MODULEDIR@/gpioiic modules-base-kernel kmod,debug
Expand Down
4 changes: 4 additions & 0 deletions distrib/sets/lists/man/mi
Original file line number Diff line number Diff line change
Expand Up @@ -2891,6 +2891,7 @@
./usr/share/man/cat8/ftp-proxy.0 man-pf-catman pf,.cat
./usr/share/man/cat8/ftpd.0 man-netutil-catman .cat
./usr/share/man/cat8/fusermount.0 man-refuse-catman .cat
./usr/share/man/cat8/fullfsctl.0 man-miscfs-catman fullfs,.cat
./usr/share/man/cat8/fwctl.0 man-sysutil-catman .cat
./usr/share/man/cat8/genassym.sh.0 man-obsolete obsolete
./usr/share/man/cat8/getNAME.0 man-man-catman !makemandb,.cat
Expand Down Expand Up @@ -3100,6 +3101,7 @@
./usr/share/man/cat8/mount_fdesc.0 man-miscfs-catman fdescfs,.cat
./usr/share/man/cat8/mount_ffs.0 man-sysutil-catman .cat
./usr/share/man/cat8/mount_filecore.0 man-filecorefs-catman filecorefs,.cat
./usr/share/man/cat8/mount_full.0 man-miscfs-catman fullfs,.cat
./usr/share/man/cat8/mount_hfs.0 man-hfs-catman hfs,.cat
./usr/share/man/cat8/mount_hfsp.0 man-obsolete obsolete
./usr/share/man/cat8/mount_kernfs.0 man-sysutil-catman kernfs,.cat
Expand Down Expand Up @@ -6482,6 +6484,7 @@
./usr/share/man/man8/fstyp.8 man-sysutil-man .man
./usr/share/man/man8/ftp-proxy.8 man-pf-man pf,.man
./usr/share/man/man8/ftpd.8 man-netutil-man .man
./usr/share/man/man8/fullfsctl.8 man-miscfs-man fullfs,.man
./usr/share/man/man8/fusermount.8 man-refuse-man .man
./usr/share/man/man8/fwctl.8 man-sysutil-man .man
./usr/share/man/man8/genassym.sh.8 man-obsolete obsolete
Expand Down Expand Up @@ -6693,6 +6696,7 @@
./usr/share/man/man8/mount_fdesc.8 man-miscfs-man fdescfs,.man
./usr/share/man/man8/mount_ffs.8 man-sysutil-man .man
./usr/share/man/man8/mount_filecore.8 man-filecorefs-man filecorefs,.man
./usr/share/man/man8/mount_full.8 man-miscfs-man fullfs,.man
./usr/share/man/man8/mount_hfs.8 man-hfs-man hfs,.man
./usr/share/man/man8/mount_hfsp.8 man-obsolete obsolete
./usr/share/man/man8/mount_kernfs.8 man-sysutil-man kernfs,.man
Expand Down
2 changes: 2 additions & 0 deletions distrib/sets/lists/manhtml/mi
Original file line number Diff line number Diff line change
Expand Up @@ -2612,6 +2612,7 @@
./usr/share/man/html8/ftp-proxy.html man-pf-htmlman pf,html
./usr/share/man/html8/ftpd.html man-netutil-htmlman html
./usr/share/man/html8/fusermount.html man-refuse-htmlman html
./usr/share/man/html8/fullfsctl.html man-miscfs-htmlman fullfs,html
./usr/share/man/html8/fwctl.html man-sysutil-htmlman html
./usr/share/man/html8/getNAME.html man-man-htmlman !makemandb,html
./usr/share/man/html8/getencstat.html man-sysutil-htmlman html
Expand Down Expand Up @@ -2776,6 +2777,7 @@
./usr/share/man/html8/mount_fdesc.html man-miscfs-htmlman fdescfs,html
./usr/share/man/html8/mount_ffs.html man-sysutil-htmlman html
./usr/share/man/html8/mount_filecore.html man-filecorefs-htmlman filecorefs,html
./usr/share/man/html8/mount_full.html man-miscfs-htmlman fullfs,html
./usr/share/man/html8/mount_hfs.html man-hfs-htmlman hfs,html
./usr/share/man/html8/mount_kernfs.html man-sysutil-htmlman kernfs,html
./usr/share/man/html8/mount_lfs.html man-sysutil-htmlman lfs,html
Expand Down
2 changes: 2 additions & 0 deletions distrib/sets/lists/modules/mi
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,8 @@
./@MODULEDIR@/flash/flash.kmod modules-base-kernel kmod
./@MODULEDIR@/fss modules-base-kernel kmod
./@MODULEDIR@/fss/fss.kmod modules-base-kernel kmod
./@MODULEDIR@/full modules-base-kernel kmod
./@MODULEDIR@/full/full.kmod modules-base-kernel kmod
./@MODULEDIR@/gpio modules-base-kernel kmod
./@MODULEDIR@/gpio/gpio.kmod modules-base-kernel kmod
./@MODULEDIR@/gpioiic modules-base-kernel kmod
Expand Down
5 changes: 5 additions & 0 deletions distrib/sets/lists/tests/mi
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
./usr/libdata/debug/usr/tests/fs/cd9660 tests-fs-debug compattestfile,atf
./usr/libdata/debug/usr/tests/fs/ffs tests-fs-debug compattestfile,atf
./usr/libdata/debug/usr/tests/fs/fifofs tests-fs-debug compattestfile,atf
./usr/libdata/debug/usr/tests/fs/fullfs tests-fs-debug compattestfile,atf
./usr/libdata/debug/usr/tests/fs/hfs tests-fs-debug compattestfile,atf
./usr/libdata/debug/usr/tests/fs/kernfs tests-fs-debug compattestfile,atf
./usr/libdata/debug/usr/tests/fs/lfs tests-fs-debug compattestfile,atf
Expand Down Expand Up @@ -1682,6 +1683,10 @@
./usr/tests/fs/fifofs/Atffile tests-fs-tests atf,rump
./usr/tests/fs/fifofs/Kyuafile tests-fs-tests atf,rump,kyua
./usr/tests/fs/fifofs/t_fifo tests-fs-tests atf,rump
./usr/tests/fs/fullfs tests-fs-tests compattestfile,atf
./usr/tests/fs/fullfs/Atffile tests-fs-tests atf,rump
./usr/tests/fs/fullfs/Kyuafile tests-fs-tests atf,rump,kyua
./usr/tests/fs/fullfs/t_basic tests-fs-tests atf,rump
./usr/tests/fs/h_funcs.subr tests-fs-tests atf,rump
./usr/tests/fs/hfs tests-fs-tests compattestfile,atf
./usr/tests/fs/hfs/Atffile tests-fs-tests atf,rump
Expand Down
2 changes: 2 additions & 0 deletions etc/mtree/NetBSD.dist.tests
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
./usr/libdata/debug/usr/tests/fs/cd9660
./usr/libdata/debug/usr/tests/fs/ffs
./usr/libdata/debug/usr/tests/fs/fifofs
./usr/libdata/debug/usr/tests/fs/fullfs
./usr/libdata/debug/usr/tests/fs/hfs
./usr/libdata/debug/usr/tests/fs/kernfs
./usr/libdata/debug/usr/tests/fs/lfs
Expand Down Expand Up @@ -235,6 +236,7 @@
./usr/tests/fs/cd9660
./usr/tests/fs/ffs
./usr/tests/fs/fifofs
./usr/tests/fs/fullfs
./usr/tests/fs/hfs
./usr/tests/fs/kernfs
./usr/tests/fs/lfs
Expand Down
5 changes: 5 additions & 0 deletions sbin/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,11 @@ SUBDIR+= mount_ntfs
SUBDIR+= mount_null
.endif

.if (${MKFULLFS} != "no")
SUBDIR+= fullfsctl
SUBDIR+= mount_full
.endif

.if (${MKOVERLAYFS} != "no")
SUBDIR+= mount_overlay
.endif
Expand Down
10 changes: 10 additions & 0 deletions sbin/fullfsctl/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# $NetBSD$

.include <bsd.own.mk>

PROG= fullfsctl
MAN= fullfsctl.8

CPPFLAGS+= -I${NETBSDSRCDIR}/sys

.include <bsd.prog.mk>
187 changes: 187 additions & 0 deletions sbin/fullfsctl/fullfsctl.8
Original file line number Diff line number Diff line change
@@ -0,0 +1,187 @@
.\" $NetBSD$
.\"
.\"
.Dd March 6, 2026
.Dt FULLFSCTL 8
.Os
.Sh NAME
.Nm fullfsctl
.Nd control fullfs runtime fail state
.Sh SYNOPSIS
.Nm
.Fl m Ar mode
.Op Fl e Ar errno
.Op Fl o Ar ops
.Op Fl d Ar doom
.Op Fl r Ar rate
.Ar path
.Nm
.Fl s
.Ar path
.Sh DESCRIPTION
The
.Nm
utility controls the runtime failure behavior of a mounted
.Em fullfs
filesystem.
By default, a freshly mounted
.Em fullfs
fails all space-allocating operations with
.Er ENOSPC .
.Nm
allows the fail mode, error code, operation mask, and countdown
parameters to be changed at any time without remounting.
.Pp
.Ar path
may be the mountpoint or any file within the fullfs mount.
.Pp
The
.Fl m
flag is required for all set operations.
Flags omitted on the set path take their default values.
.Pp
The second synopsis form,
.Fl s ,
queries and displays the current state in the form:
.Pp
.Dl mode=<mode> error=<n> opmask=0x<mask> doom=<n> rate=<n>
.Pp
It cannot be combined with other flags.
.Sh OPTIONS
.Bl -tag -width "-e errno"
.It Fl m Ar mode
Set the fail mode.
One of:
.Bl -tag -width "random" -compact
.It Cm pass
All operations succeed; transparent passthrough.
.It Cm fail
All masked operations fail with the configured error.
.It Cm count
Allow
.Ar doom
masked operations, then fail subsequent ones.
Operations not in the mask pass through without decrementing the counter.
.It Cm bytes
Allow
.Ar doom
bytes of writes, then fail.
Non-write operations always pass through.
If a write exceeds the remaining budget, it is rejected entirely;
no partial writes occur.
.It Cm random
Each masked operation independently fails with the probability
set by
.Fl r .
Unmasked operations pass through without rolling.
.El
.It Fl e Ar errno
Error code to return on failure.
Accepts a symbolic name
.Po
.Li enospc ,
.Li eio ,
.Li edquot ,
.Li efbig ,
.Li eperm ,
.Li eacces ,
.Li erofs
.Pc
or a positive integer.
Default:
.Er ENOSPC .
.It Fl o Ar ops
Comma-separated list of operations to mask.
Valid names:
.Li write ,
.Li create ,
.Li mkdir ,
.Li mknod ,
.Li symlink ,
.Li link ,
.Li all ,
.Li none .
Default:
.Li all .
.It Fl d Ar doom
Doom counter.
In
.Cm count
mode, the number of masked operations to allow before failing.
In
.Cm bytes
mode, the byte budget for writes.
Must be positive when the mode is
.Cm count
or
.Cm bytes .
Default: 0.
.It Fl r Ar rate
Failure rate percentage for
.Cm random
mode, from 1 to 99.
Boundary values 0 and 100 are rejected; use
.Cm pass
or
.Cm fail
instead.
Default: 0.
.It Fl s
Show the current state of the fullfs mount and exit.
Cannot be combined with
.Fl m
or other flags.
.El
.Sh EXAMPLES
Fail all operations with
.Er ENOSPC :
.Pp
.Dl fullfsctl -m fail /mnt/full
.Pp
Fail all operations with
.Er EIO :
.Pp
.Dl fullfsctl -m fail -e eio /mnt/full
.Pp
Fail only writes, allowing file creation:
.Pp
.Dl fullfsctl -m fail -o write /mnt/full
.Pp
Allow 5 operations, then fail:
.Pp
.Dl fullfsctl -m count -d 5 /mnt/full
.Pp
Allow 1024 bytes of writes, then fail:
.Pp
.Dl fullfsctl -m bytes -d 1024 /mnt/full
.Pp
Fail 50% of masked operations at random:
.Pp
.Dl fullfsctl -m random -r 50 /mnt/full
.Pp
Pass all operations through (disable failure injection):
.Pp
.Dl fullfsctl -m pass /mnt/full
.Pp
Show the current state:
.Pp
.Dl fullfsctl -s /mnt/full
.Sh CAVEATS
Writes performed via
.Xr mmap 2
and
.Xr msync 2
bypass
.Em fullfs
and are not subject to failure injection.
This is a layerfs architectural constraint;
.Fn putpages
operates at the VM page level, not the VOP level.
.Sh SEE ALSO
.Xr mount 8 ,
.Xr mount_full 8
.Sh HISTORY
The
.Nm
utility first appeared in
.Nx 11 .
Loading