Follow-up to #8489. We don't need to call Close in the err and success
cases, we can just do it after Readdirnames returns.
Signed-off-by: Danny Canter <danny@dcantah.dev>
There was a couple uses of Readdir/ReadDir here where the only thing the return
value was used for was the Name of the entry. This is exactly what Readdirnames
returns, so we can avoid the overhead of making/returning a bunch of interfaces
and calling lstat everytime in the case of Readdir(-1).
https://cs.opensource.google/go/go/+/refs/tags/go1.20.4:src/os/dir_unix.go;l=114-137
Signed-off-by: Danny Canter <danny@dcantah.dev>
- Add Target to mount.Mount.
- Add UnmountMounts to unmount a list of mounts in reverse order.
- Add UnmountRecursive to unmount deepest mount first for a given target, using
moby/sys/mountinfo.
Signed-off-by: Edgar Lee <edgarhinshunlee@gmail.com>
If containerd crashes while creating a container the shim process stays alive and is never
cleaned up. Details are discussed in issue containerd/containerd#6860. This fixes the code
to cleanup such shim processes on containerd restart.
Signed-off-by: Amit Barve <ambarve@microsoft.com>