mirror of https://gitee.com/openkylin/linux.git
nfs: Send atime and mtime as a 64bit value
RFC 3530 says that the seconds value of a nfstime4 structure is a 64bit value, but we are instead sending a 32-bit 0 and then a 32bit conversion of the 64bit Linux value. This means that if we try to set atime to a value before the epoch (touch -t 196001010101) the client will only send part of the new value due to lost precision. Signed-off-by: Bryan Schumaker <bjschuma@netapp.com> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
This commit is contained in:
parent
549b19cc9f
commit
042ad0b398
|
@ -1058,8 +1058,7 @@ static void encode_attrs(struct xdr_stream *xdr, const struct iattr *iap, const
|
|||
if (iap->ia_valid & ATTR_ATIME_SET) {
|
||||
bmval1 |= FATTR4_WORD1_TIME_ACCESS_SET;
|
||||
*p++ = cpu_to_be32(NFS4_SET_TO_CLIENT_TIME);
|
||||
*p++ = cpu_to_be32(0);
|
||||
*p++ = cpu_to_be32(iap->ia_atime.tv_sec);
|
||||
p = xdr_encode_hyper(p, (s64)iap->ia_atime.tv_sec);
|
||||
*p++ = cpu_to_be32(iap->ia_atime.tv_nsec);
|
||||
}
|
||||
else if (iap->ia_valid & ATTR_ATIME) {
|
||||
|
@ -1069,8 +1068,7 @@ static void encode_attrs(struct xdr_stream *xdr, const struct iattr *iap, const
|
|||
if (iap->ia_valid & ATTR_MTIME_SET) {
|
||||
bmval1 |= FATTR4_WORD1_TIME_MODIFY_SET;
|
||||
*p++ = cpu_to_be32(NFS4_SET_TO_CLIENT_TIME);
|
||||
*p++ = cpu_to_be32(0);
|
||||
*p++ = cpu_to_be32(iap->ia_mtime.tv_sec);
|
||||
p = xdr_encode_hyper(p, (s64)iap->ia_mtime.tv_sec);
|
||||
*p++ = cpu_to_be32(iap->ia_mtime.tv_nsec);
|
||||
}
|
||||
else if (iap->ia_valid & ATTR_MTIME) {
|
||||
|
|
Loading…
Reference in New Issue