Skip to content
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

Fix for issue dsync not updating times correctly #560. #622

Merged
merged 2 commits into from
Jan 17, 2025

Conversation

carbonneau1
Copy link
Collaborator

Some file system do not support nanosecond part of the timespec for mtime (last modification time). We were comparing the mtime (tv_nsec nanosecond) regardless of the support to mtime nanosecond. This was causing dsync to add files to the copy to destination list even if the file were identical.

We added a check for source dir and destination dir to verify if the timepsec nanosecond (tv_nsec) was set to 0. In which case we do not compare the mtime nanosecond part of it (tv_nsec).

@carbonneau1 carbonneau1 requested a review from ofaaland January 17, 2025 00:40
@carbonneau1 carbonneau1 changed the title First fix for issue dsync not updating times correctly #560. Fix for issue dsync not updating times correctly #560. Jan 17, 2025
Copy link
Collaborator

@ofaaland ofaaland left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good! I think there's some unused code from earlier testing, and possibly fixes to other bugs (if so, they should go in separate commits).

Some file system do not support nanosecond part of the timespec for
mtime (last modification time). We were comparing the mtime regardless
of the support to mtime nanosecond. This was causing dsync to add files
to the copy to destination list even if the file were identical.

We added a check for source dir and destination dir to verify if the
timepsec nanosecond (tv_nsec) was set to 0. In which case we do not
compare the mtime nanosecond part of it (tv_nsec).

Cleaning up dead code left in the source files.
dsync.c and mfu_flist_copy.c

Cleaned up code of unused code and reverted src/common/mfu_flist_copy.c
The change in mfu_flist_copy.c is for another MR.
Copy link
Collaborator

@ofaaland ofaaland left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure about the case where the stat() calls fail. Looks good to me otherwise, thanks!

@carbonneau1 carbonneau1 merged commit 4409800 into main Jan 17, 2025
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