aboutsummaryrefslogtreecommitdiffstats
path: root/fs/nfsd
diff options
context:
space:
mode:
authorJ. Bruce Fields <bfields@redhat.com>2015-01-20 11:51:26 -0500
committerJ. Bruce Fields <bfields@redhat.com>2015-01-23 10:29:11 -0500
commitbbc7f33ac6ff6f48709ce892aa906ddb68b34517 (patch)
tree6b1a31a7692b5f5010a06479ef74dd713a6eac0f /fs/nfsd
parenta97c331f9aa9080706a7835225d9d82e832e0bb6 (diff)
nfsd: fix year-2038 nfs4 state problem
Someone with a weird time_t happened to notice this, it shouldn't really manifest till 2038. It may not be our ownly year-2038 problem. Reported-by: Aaron Pace <Aaron.Pace@alcatel-lucent.com> Signed-off-by: J. Bruce Fields <bfields@redhat.com>
Diffstat (limited to 'fs/nfsd')
-rw-r--r--fs/nfsd/nfs4state.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/fs/nfsd/nfs4state.c b/fs/nfsd/nfs4state.c
index f924f0618cb5..1f4b85b15125 100644
--- a/fs/nfsd/nfs4state.c
+++ b/fs/nfsd/nfs4state.c
@@ -1508,7 +1508,12 @@ unhash_session(struct nfsd4_session *ses)
1508static int 1508static int
1509STALE_CLIENTID(clientid_t *clid, struct nfsd_net *nn) 1509STALE_CLIENTID(clientid_t *clid, struct nfsd_net *nn)
1510{ 1510{
1511 if (clid->cl_boot == nn->boot_time) 1511 /*
1512 * We're assuming the clid was not given out from a boot
1513 * precisely 2^32 (about 136 years) before this one. That seems
1514 * a safe assumption:
1515 */
1516 if (clid->cl_boot == (u32)nn->boot_time)
1512 return 0; 1517 return 0;
1513 dprintk("NFSD stale clientid (%08x/%08x) boot_time %08lx\n", 1518 dprintk("NFSD stale clientid (%08x/%08x) boot_time %08lx\n",
1514 clid->cl_boot, clid->cl_id, nn->boot_time); 1519 clid->cl_boot, clid->cl_id, nn->boot_time);