summaryrefslogtreecommitdiffstats
path: root/fs/nfsd/netns.h
diff options
context:
space:
mode:
authorJeff Layton <jlayton@primarydata.com>2014-07-30 08:27:15 -0400
committerJ. Bruce Fields <bfields@redhat.com>2014-08-05 10:55:02 -0400
commit294ac32e99861f6efee548a6b7afb27c32cd502f (patch)
tree0050131c1e101462a193e9cc22115fc2ea37e94d /fs/nfsd/netns.h
parentfd699b8a48c0ca36e782cf705794358b3e4b8c25 (diff)
downloadop-kernel-dev-294ac32e99861f6efee548a6b7afb27c32cd502f.zip
op-kernel-dev-294ac32e99861f6efee548a6b7afb27c32cd502f.tar.gz
nfsd: protect clid and verifier generation with client_lock
The clid counter is a global counter currently. Move it to be a per-net property so that it can be properly protected by the nn->client_lock instead of relying on the client_mutex. The verifier generator is also potentially racy if there are two simultaneous callers. Generate the verifier when we generate the clid value, so it's also created under the client_lock. With this, there's no need to keep two counters as they'd always be in sync anyway, so just use the clientid_counter for both. As Trond points out, what would be best is to eventually move this code to use IDR instead of the hash tables. That would also help ensure uniqueness, but that's probably best done as a separate project. Signed-off-by: Jeff Layton <jlayton@primarydata.com> Signed-off-by: J. Bruce Fields <bfields@redhat.com>
Diffstat (limited to 'fs/nfsd/netns.h')
-rw-r--r--fs/nfsd/netns.h6
1 files changed, 3 insertions, 3 deletions
diff --git a/fs/nfsd/netns.h b/fs/nfsd/netns.h
index e1f479c..3831ef6 100644
--- a/fs/nfsd/netns.h
+++ b/fs/nfsd/netns.h
@@ -92,9 +92,7 @@ struct nfsd_net {
bool nfsd_net_up;
bool lockd_up;
- /*
- * Time of server startup
- */
+ /* Time of server startup */
struct timeval nfssvc_boot;
/*
@@ -103,6 +101,8 @@ struct nfsd_net {
*/
unsigned int max_connections;
+ u32 clientid_counter;
+
struct svc_serv *nfsd_serv;
};
OpenPOWER on IntegriCloud