Merge pull request #9054 from macOScontainers/canonicalize-filter-mount-path

Fix usages of `mountinfo.PrefixFilter`
This commit is contained in:
Akihiro Suda
2023-09-27 05:10:27 +09:00
committed by GitHub
7 changed files with 41 additions and 12 deletions

View File

@@ -164,6 +164,11 @@ func openLogFile(path string) (*os.File, error) {
// unmountRecursive unmounts the target and all mounts underneath, starting with
// the deepest mount first.
func unmountRecursive(ctx context.Context, target string) error {
target, err := mount.CanonicalizePath(target)
if err != nil {
return err
}
toUnmount, err := mountinfo.GetMounts(mountinfo.PrefixFilter(target))
if err != nil {
return err