Fix hardlink traversal of ShredDir

This commit is contained in:
Darryl Nixon 2023-07-16 11:26:11 -07:00
parent c6d797295f
commit 6c9cca49b9

View file

@ -20,13 +20,13 @@ async def get_all_hardlinks(paths: Set[Path]) -> None:
logger.info(f"Getting hardlinks for {path}")
hardlink_count = 0
path.hardlinks = set()
async for link in path.fs_handler.get_hardlinks(path):
async for link in path.fs_handler.get_hardlinks(path.absolute_path):
hardlink_count += 1
path.hardlinks.add(link)
logger.info(f"Found hardlink: {link}")
logger.info(f"Found {hardlink_count} hardlinks for {path.absolute_path}")
if isinstance(path, ShredDir):
await get_all_hardlinks(path.contents)
path.contents = await get_all_hardlinks(path.contents)
return paths