summaryrefslogtreecommitdiffstats
path: root/net/sunrpc/auth_gss
diff options
context:
space:
mode:
authorArnd Bergmann <arnd@arndb.de>2017-10-20 16:34:42 +0200
committerArnd Bergmann <arnd@arndb.de>2019-12-18 18:07:32 +0100
commitf559935e7ce4e5d448bb6588f7fa82b0cc2cc2c0 (patch)
tree7f5b52dee60425b1be9bda95980f4f1675491387 /net/sunrpc/auth_gss
parent294ec5b87a8aaef664efb00ba62e4ef6ca05707c (diff)
downloadlinux-stable-f559935e7ce4e5d448bb6588f7fa82b0cc2cc2c0.tar.gz
linux-stable-f559935e7ce4e5d448bb6588f7fa82b0cc2cc2c0.tar.bz2
linux-stable-f559935e7ce4e5d448bb6588f7fa82b0cc2cc2c0.zip
nfs: use time64_t internally
The timestamps for the cache are all in boottime seconds, so they don't overflow 32-bit values, but the use of time_t is deprecated because it generally does overflow when used with wall-clock time. There are multiple possible ways of avoiding it: - leave time_t, which is safe here, but forces others to look into this code to determine that it is over and over. - use a more generic type, like 'int' or 'long', which is known to be sufficient here but loses the documentation of referring to timestamps - use ktime_t everywhere, and convert into seconds in the few places where we want realtime-seconds. The conversion is sometimes expensive, but not more so than the conversion we do today. - use time64_t to clarify that this code is safe. Nothing would change for 64-bit architectures, but it is slightly less efficient on 32-bit architectures. Without a clear winner of the three approaches above, this picks the last one, favouring readability over a small performance loss on 32-bit architectures. Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Diffstat (limited to 'net/sunrpc/auth_gss')
-rw-r--r--net/sunrpc/auth_gss/svcauth_gss.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/net/sunrpc/auth_gss/svcauth_gss.c b/net/sunrpc/auth_gss/svcauth_gss.c
index 0c3e22838ddf..311181720d79 100644
--- a/net/sunrpc/auth_gss/svcauth_gss.c
+++ b/net/sunrpc/auth_gss/svcauth_gss.c
@@ -203,7 +203,7 @@ static int rsi_parse(struct cache_detail *cd,
char *ep;
int len;
struct rsi rsii, *rsip = NULL;
- time_t expiry;
+ time64_t expiry;
int status = -EINVAL;
memset(&rsii, 0, sizeof(rsii));