lkml.org 
[lkml]   [1999]   [Mar]   [12]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
SubjectRe: Bugs in NFS client in Linux 2.2.3 - I need your help to debug it.
From
Date
Trond Myklebust <trond.myklebust@fys.uio.no> writes:

> If so, the following patch may help. I must however admit, I'd be very
> surprised if it really is this bug that is causing your problem, as the
> likelihood of it occurring is low unless 'jiffies' takes some very
> large value...

Or unless you reboot very often, since the fact that 'xid' is
initialized from 'jiffies' will tend to bias it to low values that
repeat themselves after every reboot. The following patch will fix
that bias, and ensure that xids don't repeat themselves very often...

Cheers,
Trond


--- linux-2.2.2/net/sunrpc/xprt.c Wed Jan 20 22:44:53 1999
+++ linux/net/sunrpc/xprt.c Fri Mar 12 19:55:28 1999
@@ -46,6 +46,7 @@
#include <linux/malloc.h>
#include <linux/sched.h>
#include <linux/errno.h>
+#include <linux/random.h>
#include <linux/socket.h>
#include <linux/in.h>
#include <linux/net.h>
@@ -1197,7 +1198,7 @@
static u32 xid = 0;

if (!xid)
- xid = jiffies;
+ get_random_bytes(&xid, sizeof(xid));

dprintk("RPC: %4d reserved req %p xid %08x\n", task->tk_pid, req, xid);
task->tk_status = 0;
@@ -1206,6 +1207,8 @@
req->rq_task = task;
req->rq_xprt = xprt;
req->rq_xid = xid++;
+ if (!xid)
+ xid++;
}

/*
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 13:50    [W:0.072 / U:1.856 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site