MCPcopy
hub / github.com/containerd/containerd / Unmount

Method Unmount

plugins/mount/erofs/plugin_linux.go:235–262  ·  view source on GitHub ↗
(ctx context.Context, path string)

Source from the content-addressed store, hash-verified

233}
234
235func (h *erofsMountHandler) Unmount(ctx context.Context, path string) error {
236 // Check what's currently mounted to determine if dm-verity device cleanup is needed
237 var deviceName string
238 mountInfo, err := mount.Lookup(path)
239 if err == nil {
240 source := mountInfo.Source
241 if strings.HasPrefix(source, "/dev/mapper/containerd-erofs-") {
242 deviceName = strings.TrimPrefix(source, "/dev/mapper/")
243 }
244 }
245
246 err = mount.Unmount(path, 0)
247
248 if deviceName != "" {
249 log.G(ctx).WithFields(log.Fields{
250 "mount-point": path,
251 "device": deviceName,
252 }).Debug("attempting to close dm-verity device")
253
254 if closeErr := dmverity.Close(deviceName); closeErr != nil {
255 log.G(ctx).WithError(closeErr).WithField("device", deviceName).Debug("unable to close dm-verity device")
256 } else {
257 log.G(ctx).WithField("device", deviceName).Debug("dm-verity device closed successfully")
258 }
259 }
260
261 return err
262}
263
264type Config struct{}
265

Callers

nothing calls this directly

Calls 3

LookupFunction · 0.92
UnmountFunction · 0.92
CloseFunction · 0.92

Tested by

no test coverage detected