diff options
author | Arnd Bergmann <arnd@arndb.de> | 2018-07-13 16:31:56 +0200 |
---|---|---|
committer | Richard Weinberger <richard@nod.at> | 2018-08-15 00:06:16 +0200 |
commit | 6cff57320275b52d0a84b616602539c79e8d7117 (patch) | |
tree | 66beabeb0cf9d2ddfea68d362d4eebd051cd3de7 /fs/ubifs/tnc_misc.c | |
parent | 0eca0b8067c4dfa405e38abb4c3a87b1df14513c (diff) | |
download | lwn-6cff57320275b52d0a84b616602539c79e8d7117.tar.gz lwn-6cff57320275b52d0a84b616602539c79e8d7117.zip |
ubifs: tnc: use monotonic znode timestamp
The tnc uses get_seconds() based timestamps to check the age of a znode,
which has two problems: on 32-bit architectures this may overflow in
2038 or 2106, and it gives incorrect information when the system time
is updated using settimeofday().
Using montonic timestamps with ktime_get_seconds() solves both thes
problems.
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Richard Weinberger <richard@nod.at>
Diffstat (limited to 'fs/ubifs/tnc_misc.c')
-rw-r--r-- | fs/ubifs/tnc_misc.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/ubifs/tnc_misc.c b/fs/ubifs/tnc_misc.c index 93f5b7859e6f..49f647bc88f0 100644 --- a/fs/ubifs/tnc_misc.c +++ b/fs/ubifs/tnc_misc.c @@ -435,7 +435,7 @@ struct ubifs_znode *ubifs_load_znode(struct ubifs_info *c, zbr->znode = znode; znode->parent = parent; - znode->time = get_seconds(); + znode->time = ktime_get_seconds(); znode->iip = iip; return znode; |