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

loopback: Utimens: enable Nsec precision for dates after 1970 #131

Merged
merged 1 commit into from
Oct 28, 2016

Conversation

rfjakob
Copy link
Contributor

@rfjakob rfjakob commented Sep 25, 2016

syscall.NsecToTimespec is broken for dates before 1970 but works
fine otherwise.

Fix #100 as well and add a testcase.

}

if m == nil {
ts[1].Nsec = _UTIME_OMIT
} else {
ts[1] = syscall.NsecToTimespec(a.UnixNano())
ts[1].Nsec = 0
ts[1] = syscall.NsecToTimespec(m.UnixNano())
Copy link
Owner

Choose a reason for hiding this comment

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

maybe have our own nsecToTimespec() that does this just once?

@rfjakob
Copy link
Contributor Author

rfjakob commented Sep 28, 2016

Done in the second commit: 6e43fd0

@rfjakob
Copy link
Contributor Author

rfjakob commented Oct 16, 2016

Ping? The typo in files_linux.go#L41 causes crashes in gocryptfs ( rfjakob/gocryptfs#48 ). This is also fixed in this PR.

rfjakob added a commit to rfjakob/gocryptfs that referenced this pull request Oct 16, 2016
rfjakob added a commit to rfjakob/gocryptfs that referenced this pull request Oct 16, 2016
@rfjakob
Copy link
Contributor Author

rfjakob commented Oct 24, 2016

Hi @hanwen , is there anything else I can do to get this merged?

@hanwen
Copy link
Owner

hanwen commented Oct 24, 2016

sorry, this went off my radar. Can you squash the commit, and drop the fuse.test binary from it?

1) Fix the "a" instead of "m" typo in loopbackFile.Utimens.
   Besides the incorrect behavoir, this causes a crash if "a"
   is nil.
   Obsoletes hanwen#100 .

2) Enable nanosecond resolution for dates after 1970.
   syscall.NsecToTimespec is broken for dates before 1970 but
   works fine otherwise, so let's keep the nanoseconds there.

3) Deduplicate the time conversion code in nodefs and paths into
   the new function fuse.UtimeToTimespec.

4) Add a test case.
@rfjakob
Copy link
Contributor Author

rfjakob commented Oct 24, 2016

Squashed and updated. Sorry about that binary! It's gone now as well.

@hanwen hanwen merged commit 6b801d3 into hanwen:master Oct 28, 2016
rfjakob added a commit to rfjakob/gocryptfs that referenced this pull request Oct 30, 2016
The fix at hanwen/go-fuse#131 has been merged.
Drop the workarounds and re-enable the tests.
@rfjakob rfjakob deleted the utimens2 branch December 4, 2016 18:21
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