From 450b39f181e3dc2e0039727f8cedf3bc18e5cf77 Mon Sep 17 00:00:00 2001 From: Chris Goller Date: Thu, 16 May 2024 14:54:08 -0500 Subject: [PATCH] fix: type not added in previous PR Signed-off-by: Chris Goller --- src/utils/mounts.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/utils/mounts.ts b/src/utils/mounts.ts index 24fbed5..f1448f8 100644 --- a/src/utils/mounts.ts +++ b/src/utils/mounts.ts @@ -250,7 +250,7 @@ interface FileSystems { // Returns the paths of all overlayfs mounts that are children of the given path. // This is useful to unmount all child mounts before unmounting the parent. -export async function findOverlayPaths(path: string): Promise { +export async function findOverlayPaths(path: string, seenPaths: Set): Promise { try { const {stdout} = await execa('findmnt', ['-R', '-J', path]) const fs: FileSystems = JSON.parse(stdout) @@ -261,6 +261,7 @@ export async function findOverlayPaths(path: string): Promise { const childTargets = new Set() for (const f of fs.filesystems) { for (const c of f.children ?? []) { + if (seenPaths.has(c.target)) continue childTargets.add(c.target) } }