From: adilger Date: Sat, 20 Dec 2008 00:39:00 +0000 (+0000) Subject: Branch b1_8 X-Git-Tag: v1_8_0_110~378 X-Git-Url: https://git.whamcloud.com/?a=commitdiff_plain;h=06f5dfd42bf081d8795b35e20c69e0623851f950;p=fs%2Flustre-release.git Branch b1_8 Avoid overflow due to 32-bit time_t in ptlrpc_init_xid(). b=2066 --- diff --git a/lustre/ptlrpc/client.c b/lustre/ptlrpc/client.c index 0d4c0a9..fb16181 100644 --- a/lustre/ptlrpc/client.c +++ b/lustre/ptlrpc/client.c @@ -2330,7 +2330,7 @@ static spinlock_t ptlrpc_last_xid_lock; * NOT want to have an XID per target or similar. * * To avoid an unlikely collision between match bits after a client reboot - * (which would cause old to be delivered into the wrong buffer) we initialize + * (which would deliver old data into the wrong RDMA buffer) we initialize * the XID based on the current time, assuming a maximum RPC rate of 1M RPC/s. * If the time is clearly incorrect, we instead use a 62-bit random number. * In the worst case the random number will overflow 1M RPCs per second in @@ -2347,7 +2347,7 @@ void ptlrpc_init_xid(void) ptlrpc_last_xid >>= 2; ptlrpc_last_xid |= (1ULL << 61); } else { - ptlrpc_last_xid = (now << 20); + ptlrpc_last_xid = (__u64)now << 20; } }