Commit bd28d9b
committed
config: Document 'rbind' and 'bind' mount options extensions
They are not filesystem types, so they don't belong in 'type'. The
specs claim mount(2) as inspiration for this modeling (which makes
sense, since that's the syscall Linux runtimes will make to implement
it), and there (recursive) bind is represented by mountflags (MS_REC |
MS_BIND). Currently the 'options' property handles both mount(2)'s
mountflags and data, so 'options' is a good spot for these two
settings.
We may eventually add entries for other mount(8) command-line options
(e.g. --move, --make-shared, ...), but I've left those off until
someone pitches a motivational use case for them.
The example I'm touching used:
"type": "bind",
...
"options": ["rbind", ...]
but I don't see a point to putting 'bind' in 'type' when it's not a
filesystem type and you already have 'rbind' in 'options'. We could
have stuck closer mount(2) by using:
"options": ["recursive", "bind", ...]
but while that approach extends more conveniently to the other
recursive mounts (recursive shared, slave, private, and unbindable
mounts), there has been resistance to a direct MS_REC analog [1]. I
think that resistance is ungrounded (obviously the kernel and mount(2)
feels like a composable MS_REC makes sense), but I'm not a mainainer.
Since there are existing consumers using the old example format and
similar things like:
$ git log --oneline -1 | cat
03e8b89 Merge pull request #176 from hmeng-19/set_oom_score_adj
$ ./ocitools generate --template <(echo '{}') --bind ab:cd:ro | jq '.mounts[0]'
{
"destination": "cd",
"type": "bind",
"source": "ab",
"options": [
"bind",
"ro"
]
}
this may be a breaking change for some spec consumers (although that
ocitools example will still work, because 'options' contains 'bind',
which means the 'type' will be ignored). But even if there are broken
consumers, we're still pre-1.0, the spec never explained what
bind/rbind meant before this commit, and consolidating the Linux mount
spec around mount(8) now will make life less confusing in the future.
[1]: #530 (comment)
Signed-off-by: W. Trevor King <[email protected]>1 parent cfc95a5 commit bd28d9b
2 files changed
Lines changed: 15 additions & 9 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
57 | 57 | | |
58 | 58 | | |
59 | 59 | | |
60 | | - | |
61 | | - | |
62 | | - | |
63 | | - | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
64 | 67 | | |
65 | 68 | | |
66 | 69 | | |
67 | 70 | | |
68 | | - | |
69 | | - | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
70 | 77 | | |
71 | 78 | | |
72 | 79 | | |
| |||
80 | 87 | | |
81 | 88 | | |
82 | 89 | | |
83 | | - | |
84 | 90 | | |
85 | | - | |
| 91 | + | |
86 | 92 | | |
87 | 93 | | |
88 | 94 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
112 | 112 | | |
113 | 113 | | |
114 | 114 | | |
115 | | - | |
| 115 | + | |
116 | 116 | | |
117 | 117 | | |
118 | 118 | | |
| |||
0 commit comments