diff options
author | Deepa Dinamani <deepa.kernel@gmail.com> | 2015-12-21 10:51:01 +1100 |
---|---|---|
committer | NeilBrown <neilb@suse.com> | 2016-01-06 11:39:53 +1100 |
commit | 9ebc6ef188a0656f3620835f9be7fe22c1644c1c (patch) | |
tree | 08ac1b7cc613d6afef042e97efe281956dafe482 /drivers/md/md.h | |
parent | 3312c951efaba55080958974047414576b9e5d63 (diff) | |
download | linux-stable-9ebc6ef188a0656f3620835f9be7fe22c1644c1c.tar.gz linux-stable-9ebc6ef188a0656f3620835f9be7fe22c1644c1c.tar.bz2 linux-stable-9ebc6ef188a0656f3620835f9be7fe22c1644c1c.zip |
drivers: md: use ktime_get_real_seconds()
get_seconds() API is not y2038 safe on 32 bit systems and the API
is deprecated. Replace it with calls to ktime_get_real_seconds()
API instead. Change mddev structure types to time64_t accordingly.
32 bit signed timestamps will overflow in the year 2038.
Change the user interface mdu_array_info_s structure timestamps:
ctime and utime values used in ioctls GET_ARRAY_INFO and
SET_ARRAY_INFO to 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_t timestamps to positive values with a max of U32_MAX
when returning from GET_ARRAY_INFO ioctl 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.
Signed-off-by: Deepa Dinamani <deepa.kernel@gmail.com>
Reviewed-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: NeilBrown <neilb@suse.com>
Diffstat (limited to 'drivers/md/md.h')
-rw-r--r-- | drivers/md/md.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/md/md.h b/drivers/md/md.h index 8817e623258a..e16a17c37418 100644 --- a/drivers/md/md.h +++ b/drivers/md/md.h @@ -264,7 +264,7 @@ struct mddev { * managed externally */ char metadata_type[17]; /* externally set*/ int chunk_sectors; - time_t ctime, utime; + time64_t ctime, utime; int level, layout; char clevel[16]; int raid_disks; |