Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -584,7 +584,7 @@ public void setattr(Inode inode, Stat stat) throws IOException {
}
if (stat.isDefined(Stat.StatAttribute.ATIME)) {
try {
FileTime time = FileTime.fromMillis(stat.getCTime());
FileTime time = FileTime.fromMillis(stat.getATime());
Files.setAttribute(path, "unix:lastAccessTime", time, NOFOLLOW_LINKS);
} catch (IOException e) {
throw new UnsupportedOperationException("set atime failed: " + e.getMessage(), e);
Expand All @@ -598,12 +598,12 @@ public void setattr(Inode inode, Stat stat) throws IOException {
throw new UnsupportedOperationException("set mtime failed: " + e.getMessage(), e);
}
}
if (stat.isDefined(Stat.StatAttribute.CTIME)) {
if (stat.isDefined(Stat.StatAttribute.BTIME)) {
try {
FileTime time = FileTime.fromMillis(stat.getCTime());
Files.setAttribute(path, "unix:ctime", time, NOFOLLOW_LINKS);
FileTime time = FileTime.fromMillis(stat.getBTime());
Files.setAttribute(path, "basic:creationTime", time, NOFOLLOW_LINKS);
} catch (IOException e) {
throw new UnsupportedOperationException("set ctime failed: " + e.getMessage(), e);
throw new UnsupportedOperationException("set btime failed: " + e.getMessage(), e);
}
}
}
Expand Down
6 changes: 3 additions & 3 deletions core/src/main/java/org/dcache/nfs/v4/OperationSETATTR.java
Original file line number Diff line number Diff line change
Expand Up @@ -185,9 +185,9 @@ static void xdr2fattr(int fattr, Stat stat, Inode inode, CompoundContext context
stat.setATime(realAtime);
break;
case nfs4_prot.FATTR4_TIME_CREATE:
nfstime4 ctime = new nfstime4();
ctime.xdrDecode(xdr);
stat.setCTime(ctime.toMillis());
nfstime4 btime = new nfstime4();
btime.xdrDecode(xdr);
stat.setBTime(btime.toMillis());
break;
case nfs4_prot.FATTR4_TIME_MODIFY_SET:
settime4 setMtime = new settime4();
Expand Down
Loading