MCPcopy
hub / github.com/containerd/containerd / RemoveVolatileOption

Function RemoveVolatileOption

core/mount/temp.go:84–106  ·  view source on GitHub ↗

RemoveVolatileOption copies and remove the volatile option for overlay type, since overlayfs doesn't allow to mount again using the same upper/work dirs. REF: https://docs.kernel.org/filesystems/overlayfs.html#volatile-mount TODO: Make this logic conditional once the kernel supports reusing overla

(mounts []Mount)

Source from the content-addressed store, hash-verified

82// TODO: Make this logic conditional once the kernel supports reusing
83// overlayfs volatile mounts.
84func RemoveVolatileOption(mounts []Mount) []Mount {
85 var out []Mount
86 for i, m := range mounts {
87 if m.Type != "overlay" {
88 continue
89 }
90 for j, opt := range m.Options {
91 if opt == "volatile" || opt == "fsync=volatile" {
92 if out == nil {
93 out = copyMounts(mounts)
94 }
95 out[i].Options = append(out[i].Options[:j], out[i].Options[j+1:]...)
96 break
97 }
98 }
99 }
100
101 if out != nil {
102 return out
103 }
104
105 return mounts
106}
107
108// RemoveIDMapOption copies and removes the uidmap/gidmap options on any of the mounts using it.
109func RemoveIDMapOption(mounts []Mount) []Mount {

Callers 3

WithVolumesFunction · 0.92
WithTempMountFunction · 0.85

Calls 1

copyMountsFunction · 0.85

Tested by 1

Used in the wild real call sites across dependent graphs

searching dependent graphs…