Repository navigation
nfs4: apply time_create as birth time in SETATTR - #175
Merged
Merged
Conversation
Motivation: The macOS NFS client sends a SETATTR with time_create after an exclusive create. OperationSETATTR maps FATTR4_TIME_CREATE to Stat.CTIME, although rfc7530/rfc8881 define time_create as the creation (birth) time, explicitly unrelated to the POSIX change time, and OperationGETATTR already serves time_create from Stat.BTIME. LocalFileSystem then tries to set the non-settable "unix:ctime" attribute, which throws IllegalArgumentException and turns the compound into NFS4ERR_SERVERFAULT. macOS maps SERVERFAULT to EBADRPC, so open(O_CREAT|O_EXCL) fails with errno 72 while the file is created on the server. Modification: map FATTR4_TIME_CREATE to Stat.BTIME in OperationSETATTR, matching the GETATTR side. In LocalFileSystem apply BTIME via "basic:creationTime", drop the "unix:ctime" branch, and fix the ATIME branch that used getCTime(). Result: exclusive create from macOS clients works over NFS 4.0 and 4.1. Fixes: dCache#174 Target: master Signed-off-by: Yves Langisch <yla@iterate.ch>
Member
|
@ylangisc thanks for your contribution |
ylangisc
added a commit
to iterate-ch/nfs4j
that referenced
this pull request
Aug 28, 2026
The time_create fix was merged upstream as c637deb (PR dCache#175) without this comment. Remove it so the file matches upstream and the merge stays conflict free.
ylangisc
added a commit
to iterate-ch/nfs4j
that referenced
this pull request
Aug 28, 2026
…0.28.5 Brings in the upstreamed time_create fix (c637deb, PR dCache#175) so the local variant is superseded, plus the post-0.28.5 development up to ab43a26. Conflict resolution (all in pom.xml, fork identity kept): - version bumped to 0.29.0-SNAPSHOT, following upstream - kept ch.iterate groupId, iterate-ch SCM URLs, S3 distributionManagement, aws-maven extension and the trimmed module list - adopted upstream's removal of the download.dcache.org repositories; oncrpc4j 3.4.3 and sleepycat je 18.3.12 are on Maven Central - kept the local maven-release-plugin config (no useReleaseProfile)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation:
The macOS NFS client sends a SETATTR with time_create after an exclusive create. OperationSETATTR maps FATTR4_TIME_CREATE to Stat.CTIME, although rfc7530/rfc8881 define time_create as the creation (birth) time, explicitly unrelated to the POSIX change time, and OperationGETATTR already serves time_create from Stat.BTIME. LocalFileSystem then tries to set the non-settable "unix:ctime" attribute, which throws IllegalArgumentException and turns the compound into NFS4ERR_SERVERFAULT. macOS maps SERVERFAULT to EBADRPC, so open(O_CREAT|O_EXCL) fails with errno 72 while the file is created on the server.
Modification:
map FATTR4_TIME_CREATE to Stat.BTIME in OperationSETATTR, matching the GETATTR side. In LocalFileSystem apply BTIME via "basic:creationTime", drop the "unix:ctime" branch, and fix the ATIME branch that used getCTime().
Result:
exclusive create from macOS clients works over NFS 4.0 and 4.1.
Fixes: #174
Target: master