Print this page
7122 fix negative timestamps with nsec == 0 in nfs4_time_ntov()

Split Close
Expand all
Collapse all
          --- old/usr/src/uts/common/fs/nfs/nfs4_subr.c
          +++ new/usr/src/uts/common/fs/nfs/nfs4_subr.c
↓ open down ↓ 487 lines elided ↑ open up ↑
 488  488  #ifndef _LP64
 489  489          if (! NFS4_TIME_OK(ntime->seconds)) {
 490  490                  return (EOVERFLOW);
 491  491          }
 492  492  #endif
 493  493  
 494  494          /* Invalid to specify 1 billion (or more) nsecs */
 495  495          if (ntime->nseconds >= 1000000000)
 496  496                  return (EINVAL);
 497  497  
 498      -        if (ntime->seconds < 0) {
      498 +        if (ntime->seconds < 0 && ntime->nseconds != 0) {
 499  499                  sec = ntime->seconds + 1;
 500  500                  nsec = -1000000000 + ntime->nseconds;
 501  501          } else {
 502  502                  sec = ntime->seconds;
 503  503                  nsec = ntime->nseconds;
 504  504          }
 505  505  
 506  506          vatime->tv_sec = sec;
 507  507          vatime->tv_nsec = nsec;
 508  508  
↓ open down ↓ 2649 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX