Skip to content

Commit 2f6b090

Browse files
committed
config: improve bind mount and propagation doc
Current documentation talks about bind/rbind and various propagation flags (shared, slave, private, unbindable etc.) as being filesystem- specific options, and refers to mount(8) section describing filesystem-specific options. That is wrong, because bind mounts are a separate class of mounts, not related to file systems. Fix the confusion, and link to sharedsubtree.txt kernel document as it happens to be the best source of information about the topic (not counting the kernel sources). Signed-off-by: Kir Kolyshkin <[email protected]>
1 parent 989e575 commit 2f6b090

File tree

1 file changed

+13
-11
lines changed

1 file changed

+13
-11
lines changed

Diff for: config.md

+13-11
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ Runtimes MUST/SHOULD/MAY implement the following option strings for Linux:
9494
------------------|-------------|-----------------------------------------------------
9595
`async` | MUST | [^1]
9696
`atime` | MUST | [^1]
97-
`bind` | MUST | [^2] (bind mounts)
97+
`bind` | MUST | Bind mount [^2]
9898
`defaults` | MUST | [^1]
9999
`dev` | MUST | [^1]
100100
`diratime` | MUST | [^1]
@@ -115,9 +115,9 @@ Runtimes MUST/SHOULD/MAY implement the following option strings for Linux:
115115
`nostrictatime` | MUST | [^1]
116116
`nosuid` | MUST | [^1]
117117
`nosymfollow` | SHOULD | [^1] (Introduced in kernel 5.10, util-linux 2.38)
118-
`private` | MUST | [^2] (bind mounts)
118+
`private` | MUST | Bind mount propagation [^2]
119119
`ratime` | SHOULD | Recursive `atime` [^3]
120-
`rbind` | MUST | [^2] (bind mounts)
120+
`rbind` | MUST | Recursive bind mount [^2]
121121
`rdev` | SHOULD | Recursive `dev` [^3]
122122
`rdiratime` | SHOULD | Recursive `diratime` [^3]
123123
`relatime` | MUST | [^1]
@@ -131,39 +131,40 @@ Runtimes MUST/SHOULD/MAY implement the following option strings for Linux:
131131
`rnosuid` | SHOULD | Recursive `nosuid` [^3]
132132
`rnosymfollow` | SHOULD | Recursive `nosymfollow` [^3]
133133
`ro` | MUST | [^1]
134-
`rprivate` | MUST | [^2] (bind mounts)
134+
`rprivate` | MUST | Bind mount propagation [^2]
135135
`rrelatime ` | SHOULD | Recursive `relatime` [^3]
136136
`rro` | SHOULD | Recursive `ro` [^3]
137137
`rrw` | SHOULD | Recursive `rw` [^3]
138-
`rshared` | MUST | [^2] (bind mounts)
139-
`rslave` | MUST | [^2] (bind mounts)
138+
`rshared` | MUST | Bind mount propagation [^2]
139+
`rslave` | MUST | Bind mount propagation [^2]
140140
`rstrictatime` | SHOULD | Recursive `strictatime` [^3]
141141
`rsuid` | SHOULD | Recursive `suid` [^3]
142142
`rsymfollow` | SHOULD | Recursive `symfollow` [^3]
143-
`runbindable` | MUST | [^2] (bind mounts)
143+
`runbindable` | MUST | Bind mount propagation [^2]
144144
`rw` | MUST | [^1]
145145
`shared` | MUST | [^1]
146146
`silent` | MUST | [^1]
147-
`slave` | MUST | [^2] (bind mounts)
147+
`slave` | MUST | Bind mount propagation [^2]
148148
`strictatime` | MUST | [^1]
149149
`suid` | MUST | [^1]
150150
`symfollow` | SHOULD | Opposite of `nosymfollow`
151151
`sync` | MUST | [^1]
152152
`tmpcopyup` | MAY | copy up the contents to a tmpfs
153-
`unbindable` | MUST | [^2] (bind mounts)
153+
`unbindable` | MUST | Bind mount propagation [^2]
154154
`idmap` | SHOULD | Indicates that the mount has `uidMappings` and `gidMappings` specified. This option SHOULD NOT be passed to the underlying [`mount(2)`][mount.2] call. If supported, the runtime MUST return an error if this option is provided and either of `uidMappings` or `gidMappings` are empty or not present.
155155
`ridmap` | SHOULD | Indicates that the mount has `uidMappings` and `gidMappings` specified, and the mapping is applied recursively [^3]. This option SHOULD NOT be passed to the underlying [`mount(2)`][mount.2] call. If supported, the runtime MUST return an error if this option is provided and either of `uidMappings` or `gidMappings` are empty or not present.
156156

157157
[^1]: Corresponds to [`mount(8)` (filesystem-independent)][mount.8-filesystem-independent].
158-
[^2]: Corresponds to [`mount(8)` (filesystem-specific)][mount.8-filesystem-specific].
158+
[^2]: Corresponds to [bind mounts and shared subtrees][mount-bind].
159159
[^3]: These `AT_RECURSIVE` options need kernel 5.12 or later. See [`mount_setattr(2)`][mount_setattr.2]
160160

161161
The "MUST" options correspond to [`mount(8)`][mount.8].
162162

163163
Runtimes MAY also implement custom option strings that are not listed in the table above.
164164
If a custom option string is already recognized by [`mount(8)`][mount.8], the runtime SHOULD follow the behavior of [`mount(8)`][mount.8].
165165

166-
Runtimes SHOULD pass unknown options to [`mount(2)`][mount.2] via the fifth argument (`const void *data`).
166+
Runtimes SHOULD treat unknown options as [filesystem-specific ones][mount.8-filesystem-specific])
167+
and pass those as a comma-separated string to the fifth (`const void *data`) argument of [`mount(2)`][mount.2].
167168

168169
### Example (Windows)
169170

@@ -1135,6 +1136,7 @@ Here is a full example `config.json` for reference.
11351136
[mount.8-filesystem-independent]: http://man7.org/linux/man-pages/man8/mount.8.html#FILESYSTEM-INDEPENDENT_MOUNT_OPTIONS
11361137
[mount.8-filesystem-specific]: http://man7.org/linux/man-pages/man8/mount.8.html#FILESYSTEM-SPECIFIC_MOUNT_OPTIONS
11371138
[mount_setattr.2]: http://man7.org/linux/man-pages/man2/mount_setattr.2.html
1139+
[mount-bind]: https://docs.kernel.org/filesystems/sharedsubtree.html
11381140
[getrlimit.2]: http://man7.org/linux/man-pages/man2/getrlimit.2.html
11391141
[getrlimit.3]: http://pubs.opengroup.org/onlinepubs/9699919799/functions/getrlimit.html
11401142
[stdin.3]: http://man7.org/linux/man-pages/man3/stdin.3.html

0 commit comments

Comments
 (0)