Skip to content

Conversation

@gpziemba
Copy link

@gpziemba gpziemba commented Apr 8, 2025

cpdup examines st_dev (inode device id) of source and destination
file tree objects to detect when a directory descent crosses a
mount point, so it can prune the copy at that point.

Filesystems mounted by the automounter can be automatically
unmounted and re-mounted during the copy operation, changing
the inode device ID for all of the filesystem's objects.

This commit adds a consolidated mechanism for

1. caching the inode device IDs of the roots of the source and destination trees; and

2. comparing inode device IDs to the root's ID as the copy proceeds over the source and destination trees.

If a comparison fails, the root inode device ID is refetched and re-compared before declaring a mount point crossing.

    cpdup examines st_dev (inode device id) of source and destination
    file tree objects to detect when a directory descent crosses a
    mount point, so it can prune the copy at that point.

    Filesystems mounted by the automounter can be automatically
    unmounted and re-mounted during the copy operation, changing
    the inode device ID for all of the filesystem's objects.

    This commit adds a consolidated mechanism for

	1. caching the inode device IDs of the roots of the
	   source and destination trees; and

	2. comparing inode device IDs to the root's ID as the
	   copy proceeds over the source and destination trees.

    If a comparison fails, the root inode device ID is refetched
    and re-compared before declaring a mount point crossing.
@liweitianux
Copy link
Member

Thank you for the patch. We'll have a review and handle it accordingly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants