Skip to content

Commit bbc7f33

Browse files
author
J. Bruce Fields
committed
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>
1 parent a97c331 commit bbc7f33

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

fs/nfsd/nfs4state.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1508,7 +1508,12 @@ unhash_session(struct nfsd4_session *ses)
15081508
static int
15091509
STALE_CLIENTID(clientid_t *clid, struct nfsd_net *nn)
15101510
{
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)
15121517
return 0;
15131518
dprintk("NFSD stale clientid (%08x/%08x) boot_time %08lx\n",
15141519
clid->cl_boot, clid->cl_id, nn->boot_time);

0 commit comments

Comments
 (0)