The recent discussions on clocks brings to mind something that I have been wondering about for a while, namely what is the size of the clock in a filer. The reason why this is interesting is that filers happily set file times to 32 bit values and this is illegal unless the filer's clock is unsigned or greater than 32 bits.
/Michael
Michael.Salmon@uab.ericsson.se (Michael Salmon) writes
The recent discussions on clocks brings to mind something that I have been wondering about for a while, namely what is the size of the clock in a filer. The reason why this is interesting is that filers happily set file times to 32 bit values and this is illegal unless the filer's clock is unsigned or greater than 32 bits.
I am a bit unclear what is meant by "the size of the clock" here. The range of times that the filer can maintain as its current time, or the range that it can represent in fields in the inode? And what proscription makes anything "illegal" here?
I am not familar with the treatment of time values in CIFS, but in both NFS v2 and v3 time values are passed as a
struct { uint32 seconds; /* seconds since 1 Jan 1970 00:00 UTC */ uint32 nseconds; /* nanoseconds */ };
However, the insistence on unsigned values does not correspond to historical practice. When Sun tightened up their NFS implementation in Solaris 7 so that it refused to set times before 1970, or to transmit such values from existing inodes, quite a few complaints were generated. [There's a rather grubby workround in Solaris 7, and an official "set nfs:nfs_allow_preepoch_time = 1" for /etc/system in Solaris 8, to restore the previous state of affairs.]
Chris Thompson University of Cambridge Computing Service, Email: cet1@ucs.cam.ac.uk New Museums Site, Cambridge CB2 3QG, Phone: +44 1223 334715 United Kingdom.
Chris Thompson wrote:
Michael.Salmon@uab.ericsson.se (Michael Salmon) writes
The recent discussions on clocks brings to mind something that I have been wondering about for a while, namely what is the size of the clock in a filer. The reason why this is interesting is that filers happily set file times to 32 bit values and this is illegal unless the filer's clock is unsigned or greater than 32 bits.
I am a bit unclear what is meant by "the size of the clock" here. The range of times that the filer can maintain as its current time, or the range that it can represent in fields in the inode? And what proscription makes anything "illegal" here?
I am not familar with the treatment of time values in CIFS, but in both NFS v2 and v3 time values are passed as a
struct { uint32 seconds; /* seconds since 1 Jan 1970 00:00 UTC */ uint32 nseconds; /* nanoseconds */ };
However, the insistence on unsigned values does not correspond to historical practice. When Sun tightened up their NFS implementation in Solaris 7 so that it refused to set times before 1970, or to transmit such values from existing inodes, quite a few complaints were generated. [There's a rather grubby workround in Solaris 7, and an official "set nfs:nfs_allow_preepoch_time = 1" for /etc/system in Solaris 8, to restore the previous state of affairs.]
If filers maintain a 32 bit signed clock then they should refuse to accept any times that have the MSB set. The fact that Sun implemented NFS incorrectly doesn't mean that it's OK for others to do so as well.
/Michael