Skip to contentSkip to conversation

nfsd: fix a regression in threads procfile interface

PATCH New Jeff Layton 1 participant 1 message Jun 25, 2024

Subsystems (2)
lore
Share & tools
lore

Jeff Layton

author maintainer
#0 lore raw

PATCH 1/1 nfsd: fix a regression in threads procfile interface

The old threads interface passed in NULL for the pool here which tells svc_set_num_threads to distribute the count over all the available pools. Fix the logic to handle this case correctly.

Fixes bbb07968d5e2 ("nfsd: make nfsd_svc take an array of thread counts")

---
It's probably best to squash this into bbb07968d5e2.

---
 fs/nfsd/nfssvc.c | 7 +++++++
 1 file changed, 7 insertions(+)
fs/nfsd/nfssvc.c +7 -0
index 9edb4f7c4cc2..23e73190687f 100644
@@ -735,6 +735,13 @@ int nfsd_set_nrthreads(int n, int *nthreads, struct net *net)
 	if (nn->nfsd_serv == NULL || n <= 0)
 		return 0;
 
+	/*
+	 * Special case: When n == 1, pass in NULL for the pool, so that the
+	 * change is distributed equally among them.
+	 */
+	if (n == 1)
+		return svc_set_num_threads(nn->nfsd_serv, NULL, nthreads[0]);
+
 	if (n > nn->nfsd_serv->sv_nrpools)
 		n = nn->nfsd_serv->sv_nrpools;
 

---
base-commit: 26086b8c567f3f758cdf3e1fc2ae205095751cb8
change-id: 20240625-nfsd-testing-84df99227eba

Best regards,

Signature · 1 line
Jeff Layton <[email protected]>