diff options
author | Chuck Lever <cel@netapp.com> | 2006-05-25 01:40:51 -0400 |
---|---|---|
committer | Trond Myklebust <Trond.Myklebust@netapp.com> | 2006-06-09 09:34:06 -0400 |
commit | bf3fcf89552f24657bcfb6a9d73cd167ebb496c6 (patch) | |
tree | 83ffe1cbdcd4a6358f97b92962f57d557158f317 /net/sunrpc/xprt.c | |
parent | b85d88068444ae5dcb1639bcef770ccbf085dd4e (diff) |
SUNRPC: NFS_ROOT always uses the same XIDs
The XID generator uses get_random_bytes to generate an initial XID.
NFS_ROOT starts up before the random driver, though, so get_random_bytes
doesn't set a random XID for NFS_ROOT. This causes NFS_ROOT mount points
to reuse XIDs every time the client is booted. If the client boots often
enough, the server will start serving old replies out of its DRC.
Use net_random() instead.
Test plan:
I/O intensive workloads should perform well and generate no errors. Traces
taken during client reboots should show that NFS_ROOT mounts use unique
XIDs after every reboot.
Signed-off-by: Chuck Lever <cel@netapp.com>
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Diffstat (limited to 'net/sunrpc/xprt.c')
-rw-r--r-- | net/sunrpc/xprt.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/net/sunrpc/xprt.c b/net/sunrpc/xprt.c index 4dd5b3cfe754..02060d0e7be8 100644 --- a/net/sunrpc/xprt.c +++ b/net/sunrpc/xprt.c | |||
@@ -41,7 +41,7 @@ | |||
41 | #include <linux/types.h> | 41 | #include <linux/types.h> |
42 | #include <linux/interrupt.h> | 42 | #include <linux/interrupt.h> |
43 | #include <linux/workqueue.h> | 43 | #include <linux/workqueue.h> |
44 | #include <linux/random.h> | 44 | #include <linux/net.h> |
45 | 45 | ||
46 | #include <linux/sunrpc/clnt.h> | 46 | #include <linux/sunrpc/clnt.h> |
47 | #include <linux/sunrpc/metrics.h> | 47 | #include <linux/sunrpc/metrics.h> |
@@ -830,7 +830,7 @@ static inline u32 xprt_alloc_xid(struct rpc_xprt *xprt) | |||
830 | 830 | ||
831 | static inline void xprt_init_xid(struct rpc_xprt *xprt) | 831 | static inline void xprt_init_xid(struct rpc_xprt *xprt) |
832 | { | 832 | { |
833 | get_random_bytes(&xprt->xid, sizeof(xprt->xid)); | 833 | xprt->xid = net_random(); |
834 | } | 834 | } |
835 | 835 | ||
836 | static void xprt_request_init(struct rpc_task *task, struct rpc_xprt *xprt) | 836 | static void xprt_request_init(struct rpc_task *task, struct rpc_xprt *xprt) |