-
Notifications
You must be signed in to change notification settings - Fork 66
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
Conversation
d057303
to
58d7a8b
Compare
There was a problem hiding this 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.
58d7a8b
to
88f9015
Compare
There was a problem hiding this 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!
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).