nfsd: uniquify cl_confirm values
authorJ. Bruce Fields <bfields@citi.umich.edu>
Tue, 20 Nov 2007 01:31:04 +0000 (20:31 -0500)
committerJ. Bruce Fields <bfields@citi.umich.edu>
Fri, 1 Feb 2008 21:42:05 +0000 (16:42 -0500)
Using a counter instead of the nanoseconds value seems more likely to
produce a unique cl_confirm.

Signed-off-by: J. Bruce Fields <bfields@citi.umich.edu>
fs/nfsd/nfs4state.c

index 035e70a01027a6747d5b28acb5c9220a8e201dde..9f6322e830fadfd9e747373e7bd4807e54f6e6bb 100644 (file)
@@ -491,15 +491,14 @@ gen_clid(struct nfs4_client *clp) {
        clp->cl_clientid.cl_id = current_clientid++; 
 }
 
-static void
-gen_confirm(struct nfs4_client *clp) {
-       struct timespec         tv;
-       u32 *                   p;
+static void gen_confirm(struct nfs4_client *clp)
+{
+       static u32 i;
+       u32 *p;
 
-       tv = CURRENT_TIME;
        p = (u32 *)clp->cl_confirm.data;
-       *p++ = tv.tv_sec;
-       *p++ = tv.tv_nsec;
+       *p++ = get_seconds();
+       *p++ = i++;
 }
 
 static int