You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
cmd/runtimetest/main.go: Unify validateMountsExist and validateMountsOrder
Also increase the error message detail and continue through the
remaining mounts instead of breaking on the first missing/misordered
mount. Based on previous discussion in [1,2]. With this commit,
a configuration like:
"mounts": [
{
"destination": "/tmp",
"type": "tmpfs",
"source": "none"
},
{
"destination": "/tmp",
"type": "tmpfs",
"source": "none"
},
{
"destination": "/dev",
"type": "devtmpfs",
"source": "devtmpfs"
}
]
and mountinfo like:
$ grep -n '/dev \|/tmp ' /proc/self/mountinfo
2:19 17 0:6 / /dev rw,nosuid,relatime - devtmpfs devtmpfs rw,size=10240k,nr_inodes=2043951,mode=755
25:41 17 0:38 / /tmp rw,relatime - tmpfs none rw
will generate errors like:
* mounts[1] {/tmp tmpfs none []} does not exist
* mounts[2] {/dev devtmpfs devtmpfs []} mounted before mounts[0] {/tmp tmpfs none []}
Before this commit, the error was just:
* Mounts[1] /tmp is not mounted in order
I'd prefer errors like:
* mounts[1] {/tmp tmpfs none []} does not exist
* mounts[2] {/dev devtmpfs devtmpfs []} is system mount 1, while mounts[0] {/tmp tmpfs none []} is system mount 24
where grep reports 2 and 25 because it's counting from one, and
runtimetest reports 1 and 24 because it's counting from zero, but Ma
prefers to not mention the system-mount order [3].
[1]: #444 (comment)
[2]: #444 (comment)
[3]: #456 (comment)
Signed-off-by: W. Trevor King <[email protected]>
0 commit comments