From 7b207ccd983350a5dedd132b57c666186dd02a7c Mon Sep 17 00:00:00 2001 From: NeilBrown Date: Fri, 15 Dec 2023 11:56:32 +1100 Subject: svc: don't hold reference for poolstats, only mutex. A future patch will remove refcounting on svc_serv as it is of little use. It is currently used to keep the svc around while the pool_stats file is open. Change this to get the pointer, protected by the mutex, only in seq_start, and the release the mutex in seq_stop. This means that if the nfsd server is stopped and restarted while the pool_stats file it open, then some pool stats info could be from the first instance and some from the second. This might appear odd, but is unlikely to be a problem in practice. Signed-off-by: NeilBrown Reviewed-by: Jeff Layton Signed-off-by: Chuck Lever --- fs/nfsd/netns.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'fs/nfsd/netns.h') diff --git a/fs/nfsd/netns.h b/fs/nfsd/netns.h index ab303a8b77d5..16dbef245dbb 100644 --- a/fs/nfsd/netns.h +++ b/fs/nfsd/netns.h @@ -123,7 +123,9 @@ struct nfsd_net { u32 clientid_counter; u32 clverifier_counter; - struct svc_serv *nfsd_serv; + struct svc_info nfsd_info; +#define nfsd_serv nfsd_info.serv + /* When a listening socket is added to nfsd, keep_active is set * and this justifies a reference on nfsd_serv. This stops * nfsd_serv from being freed. When the number of threads is -- cgit v1.2.3