| 221 | } |
| 222 | |
| 223 | func doMount(m mount.Mount, target string) error { |
| 224 | if err := fsmount.Fsmount(m, target); err != nil { |
| 225 | // Fall back to traditional mount() if fsmount syscall not available (Linux < 5.2) |
| 226 | if errors.Is(err, unix.ENOSYS) { |
| 227 | log.L.WithError(err).Debug("fsmount not available, falling back to traditional mount") |
| 228 | return m.Mount(target) |
| 229 | } |
| 230 | return err |
| 231 | } |
| 232 | return nil |
| 233 | } |
| 234 | |
| 235 | func (h *erofsMountHandler) Unmount(ctx context.Context, path string) error { |
| 236 | // Check what's currently mounted to determine if dm-verity device cleanup is needed |