|
| 1 | +.\" $NetBSD$ |
| 2 | +.\" |
| 3 | +.\" |
| 4 | +.Dd March 6, 2026 |
| 5 | +.Dt FULLFSCTL 8 |
| 6 | +.Os |
| 7 | +.Sh NAME |
| 8 | +.Nm fullfsctl |
| 9 | +.Nd control fullfs runtime fail state |
| 10 | +.Sh SYNOPSIS |
| 11 | +.Nm |
| 12 | +.Fl m Ar mode |
| 13 | +.Op Fl e Ar errno |
| 14 | +.Op Fl o Ar ops |
| 15 | +.Op Fl d Ar doom |
| 16 | +.Op Fl r Ar rate |
| 17 | +.Ar path |
| 18 | +.Nm |
| 19 | +.Fl s |
| 20 | +.Ar path |
| 21 | +.Sh DESCRIPTION |
| 22 | +The |
| 23 | +.Nm |
| 24 | +utility controls the runtime failure behavior of a mounted |
| 25 | +.Em fullfs |
| 26 | +filesystem. |
| 27 | +By default, a freshly mounted |
| 28 | +.Em fullfs |
| 29 | +fails all space-allocating operations with |
| 30 | +.Er ENOSPC . |
| 31 | +.Nm |
| 32 | +allows the fail mode, error code, operation mask, and countdown |
| 33 | +parameters to be changed at any time without remounting. |
| 34 | +.Pp |
| 35 | +.Ar path |
| 36 | +may be the mountpoint or any file within the fullfs mount. |
| 37 | +.Pp |
| 38 | +The |
| 39 | +.Fl m |
| 40 | +flag is required for all set operations. |
| 41 | +Flags omitted on the set path take their default values. |
| 42 | +.Pp |
| 43 | +The second synopsis form, |
| 44 | +.Fl s , |
| 45 | +queries and displays the current state in the form: |
| 46 | +.Pp |
| 47 | +.Dl mode=<mode> error=<n> opmask=0x<mask> doom=<n> rate=<n> |
| 48 | +.Pp |
| 49 | +It cannot be combined with other flags. |
| 50 | +.Sh OPTIONS |
| 51 | +.Bl -tag -width "-e errno" |
| 52 | +.It Fl m Ar mode |
| 53 | +Set the fail mode. |
| 54 | +One of: |
| 55 | +.Bl -tag -width "random" -compact |
| 56 | +.It Cm pass |
| 57 | +All operations succeed; transparent passthrough. |
| 58 | +.It Cm fail |
| 59 | +All masked operations fail with the configured error. |
| 60 | +.It Cm count |
| 61 | +Allow |
| 62 | +.Ar doom |
| 63 | +masked operations, then fail subsequent ones. |
| 64 | +Operations not in the mask pass through without decrementing the counter. |
| 65 | +.It Cm bytes |
| 66 | +Allow |
| 67 | +.Ar doom |
| 68 | +bytes of writes, then fail. |
| 69 | +Non-write operations always pass through. |
| 70 | +If a write exceeds the remaining budget, it is rejected entirely; |
| 71 | +no partial writes occur. |
| 72 | +.It Cm random |
| 73 | +Each masked operation independently fails with the probability |
| 74 | +set by |
| 75 | +.Fl r . |
| 76 | +Unmasked operations pass through without rolling. |
| 77 | +.El |
| 78 | +.It Fl e Ar errno |
| 79 | +Error code to return on failure. |
| 80 | +Accepts a symbolic name |
| 81 | +.Po |
| 82 | +.Li enospc , |
| 83 | +.Li eio , |
| 84 | +.Li edquot , |
| 85 | +.Li efbig , |
| 86 | +.Li eperm , |
| 87 | +.Li eacces , |
| 88 | +.Li erofs |
| 89 | +.Pc |
| 90 | +or a positive integer. |
| 91 | +Default: |
| 92 | +.Er ENOSPC . |
| 93 | +.It Fl o Ar ops |
| 94 | +Comma-separated list of operations to mask. |
| 95 | +Valid names: |
| 96 | +.Li write , |
| 97 | +.Li create , |
| 98 | +.Li mkdir , |
| 99 | +.Li mknod , |
| 100 | +.Li symlink , |
| 101 | +.Li link , |
| 102 | +.Li all , |
| 103 | +.Li none . |
| 104 | +Default: |
| 105 | +.Li all . |
| 106 | +.It Fl d Ar doom |
| 107 | +Doom counter. |
| 108 | +In |
| 109 | +.Cm count |
| 110 | +mode, the number of masked operations to allow before failing. |
| 111 | +In |
| 112 | +.Cm bytes |
| 113 | +mode, the byte budget for writes. |
| 114 | +Must be positive when the mode is |
| 115 | +.Cm count |
| 116 | +or |
| 117 | +.Cm bytes . |
| 118 | +Default: 0. |
| 119 | +.It Fl r Ar rate |
| 120 | +Failure rate percentage for |
| 121 | +.Cm random |
| 122 | +mode, from 1 to 99. |
| 123 | +Boundary values 0 and 100 are rejected; use |
| 124 | +.Cm pass |
| 125 | +or |
| 126 | +.Cm fail |
| 127 | +instead. |
| 128 | +Default: 0. |
| 129 | +.It Fl s |
| 130 | +Show the current state of the fullfs mount and exit. |
| 131 | +Cannot be combined with |
| 132 | +.Fl m |
| 133 | +or other flags. |
| 134 | +.El |
| 135 | +.Sh EXAMPLES |
| 136 | +Fail all operations with |
| 137 | +.Er ENOSPC : |
| 138 | +.Pp |
| 139 | +.Dl fullfsctl -m fail /mnt/full |
| 140 | +.Pp |
| 141 | +Fail all operations with |
| 142 | +.Er EIO : |
| 143 | +.Pp |
| 144 | +.Dl fullfsctl -m fail -e eio /mnt/full |
| 145 | +.Pp |
| 146 | +Fail only writes, allowing file creation: |
| 147 | +.Pp |
| 148 | +.Dl fullfsctl -m fail -o write /mnt/full |
| 149 | +.Pp |
| 150 | +Allow 5 operations, then fail: |
| 151 | +.Pp |
| 152 | +.Dl fullfsctl -m count -d 5 /mnt/full |
| 153 | +.Pp |
| 154 | +Allow 1024 bytes of writes, then fail: |
| 155 | +.Pp |
| 156 | +.Dl fullfsctl -m bytes -d 1024 /mnt/full |
| 157 | +.Pp |
| 158 | +Fail 50% of masked operations at random: |
| 159 | +.Pp |
| 160 | +.Dl fullfsctl -m random -r 50 /mnt/full |
| 161 | +.Pp |
| 162 | +Pass all operations through (disable failure injection): |
| 163 | +.Pp |
| 164 | +.Dl fullfsctl -m pass /mnt/full |
| 165 | +.Pp |
| 166 | +Show the current state: |
| 167 | +.Pp |
| 168 | +.Dl fullfsctl -s /mnt/full |
| 169 | +.Sh CAVEATS |
| 170 | +Writes performed via |
| 171 | +.Xr mmap 2 |
| 172 | +and |
| 173 | +.Xr msync 2 |
| 174 | +bypass |
| 175 | +.Em fullfs |
| 176 | +and are not subject to failure injection. |
| 177 | +This is a layerfs architectural constraint; |
| 178 | +.Fn putpages |
| 179 | +operates at the VM page level, not the VOP level. |
| 180 | +.Sh SEE ALSO |
| 181 | +.Xr mount 8 , |
| 182 | +.Xr mount_full 8 |
| 183 | +.Sh HISTORY |
| 184 | +The |
| 185 | +.Nm |
| 186 | +utility first appeared in |
| 187 | +.Nx 11 . |
0 commit comments