Skip to content

Tolerate device-id changes (due to automounter) amid copying #5

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

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