From: J. Bruce Fields Date: Tue, 20 Jan 2015 16:51:26 +0000 (-0500) Subject: nfsd: fix year-2038 nfs4 state problem X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=bbc7f33ac6ff6f48709ce892aa906ddb68b34517;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git 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 Signed-off-by: J. Bruce Fields --- 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) static int STALE_CLIENTID(clientid_t *clid, struct nfsd_net *nn) { - if (clid->cl_boot == nn->boot_time) + /* + * We're assuming the clid was not given out from a boot + * precisely 2^32 (about 136 years) before this one. That seems + * a safe assumption: + */ + if (clid->cl_boot == (u32)nn->boot_time) return 0; dprintk("NFSD stale clientid (%08x/%08x) boot_time %08lx\n", clid->cl_boot, clid->cl_id, nn->boot_time);