drivers: md: use ktime_get_real_seconds()
A message that is not in the archive (sent off-list or not yet received): [email protected]
A message that is not in the archive (sent off-list or not yet received): 4073088.alOdrNRecE@wuerfel
Quoted 28 lines · Arnd Bergmann
Quoted 27 lines · On Wednesday 11 November 2015 19:23:33 Deepa Dinamani wrote:
get_seconds()API is not y2038 safe on 32 bit systems and the API is deprecated. Replace it with calls toktime_get_real_seconds()API instead. Change mddev structure types totime64_taccordingly.32 bit signed timestamps will overflow in the year 2038.
Change the user interface
mdu_array_info_sstructure timestamps:
ctime and utime values used in ioctlsGET_ARRAY_INFOandSET_ARRAY_INFOto unsigned int. This will extend the field to last until the year 2106.
The long term plan is to get rid of ctime and utime values in this structure as this information can be read from the on-disk meta data directly.Clamp the
tim64_ttimestamps to positive values with a max ofU32_MAXwhen returning fromGET_ARRAY_INFOioctl to accommodate above changes in the data type of timestamps to unsigned int.v0.90 on disk meta data uses u32 for maintaining time stamps. So this will also last until year 2106.
Assumption is that the usage of v0.90 will be deprecated by year 2106.Timestamp fields in the on disk meta data for v1.0 version already use 64 bit data types. Remove the truncation of the bits while writing to or reading from these from the disk.
Quoted 9 lines
Quoted 1 line
Signed-off-by Deepa Dinamani <[email protected]>Reviewed-by Arnd Bergmann <[email protected]>The patch looks great, and the changelog is perfect.
I didn't even know we had a
clamp_t()macro for this.
Adding the maintainer lists for md.
_______________________________________________
Y2038 mailing list
[email protected]
https://lists.linaro.org/mailman/listinfo/y2038