Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge tag 'nfsd-7.0-1' of git://git.kernel.org/pub/scm/linux/kernel/git/cel/linux

Pull nfsd fixes from Chuck Lever:

- Restore previous nfsd thread count reporting behavior

- Fix credential reference leaks in the NFSD netlink admin protocol

* tag 'nfsd-7.0-1' of git://git.kernel.org/pub/scm/linux/kernel/git/cel/linux:
nfsd: report the requested maximum number of threads instead of number running
nfsd: Fix cred ref leak in nfsd_nl_listener_set_doit().
nfsd: Fix cred ref leak in nfsd_nl_threads_set_doit().

+17 -16
+2 -2
Documentation/netlink/specs/nfsd.yaml
··· 152 152 - compound-ops 153 153 - 154 154 name: threads-set 155 - doc: set the number of running threads 155 + doc: set the maximum number of running threads 156 156 attribute-set: server 157 157 flags: [admin-perm] 158 158 do: ··· 165 165 - min-threads 166 166 - 167 167 name: threads-get 168 - doc: get the number of running threads 168 + doc: get the maximum number of running threads 169 169 attribute-set: server 170 170 do: 171 171 reply:
+11 -11
fs/nfsd/nfsctl.c
··· 377 377 } 378 378 379 379 /* 380 - * write_threads - Start NFSD, or report the current number of running threads 380 + * write_threads - Start NFSD, or report the configured number of threads 381 381 * 382 382 * Input: 383 383 * buf: ignored 384 384 * size: zero 385 385 * Output: 386 386 * On success: passed-in buffer filled with '\n'-terminated C 387 - * string numeric value representing the number of 388 - * running NFSD threads; 387 + * string numeric value representing the configured 388 + * number of NFSD threads; 389 389 * return code is the size in bytes of the string 390 390 * On error: return code is zero 391 391 * ··· 399 399 * Output: 400 400 * On success: NFS service is started; 401 401 * passed-in buffer filled with '\n'-terminated C 402 - * string numeric value representing the number of 403 - * running NFSD threads; 402 + * string numeric value representing the configured 403 + * number of NFSD threads; 404 404 * return code is the size in bytes of the string 405 405 * On error: return code is zero or a negative errno value 406 406 */ ··· 430 430 } 431 431 432 432 /* 433 - * write_pool_threads - Set or report the current number of threads per pool 433 + * write_pool_threads - Set or report the configured number of threads per pool 434 434 * 435 435 * Input: 436 436 * buf: ignored ··· 447 447 * Output: 448 448 * On success: passed-in buffer filled with '\n'-terminated C 449 449 * string containing integer values representing the 450 - * number of NFSD threads in each pool; 450 + * configured number of NFSD threads in each pool; 451 451 * return code is the size in bytes of the string 452 452 * On error: return code is zero or a negative errno value 453 453 */ ··· 1647 1647 if (attr) 1648 1648 nn->min_threads = nla_get_u32(attr); 1649 1649 1650 - ret = nfsd_svc(nrpools, nthreads, net, get_current_cred(), scope); 1650 + ret = nfsd_svc(nrpools, nthreads, net, current_cred(), scope); 1651 1651 if (ret > 0) 1652 1652 ret = 0; 1653 1653 out_unlock: ··· 1657 1657 } 1658 1658 1659 1659 /** 1660 - * nfsd_nl_threads_get_doit - get the number of running threads 1660 + * nfsd_nl_threads_get_doit - get the maximum number of running threads 1661 1661 * @skb: reply buffer 1662 1662 * @info: netlink metadata and command arguments 1663 1663 * ··· 1700 1700 struct svc_pool *sp = &nn->nfsd_serv->sv_pools[i]; 1701 1701 1702 1702 err = nla_put_u32(skb, NFSD_A_SERVER_THREADS, 1703 - sp->sp_nrthreads); 1703 + sp->sp_nrthrmax); 1704 1704 if (err) 1705 1705 goto err_unlock; 1706 1706 } ··· 2000 2000 } 2001 2001 2002 2002 ret = svc_xprt_create_from_sa(serv, xcl_name, net, sa, 0, 2003 - get_current_cred()); 2003 + current_cred()); 2004 2004 /* always save the latest error */ 2005 2005 if (ret < 0) 2006 2006 err = ret;
+4 -3
fs/nfsd/nfssvc.c
··· 239 239 240 240 int nfsd_nrthreads(struct net *net) 241 241 { 242 - int rv = 0; 242 + int i, rv = 0; 243 243 struct nfsd_net *nn = net_generic(net, nfsd_net_id); 244 244 245 245 mutex_lock(&nfsd_mutex); 246 246 if (nn->nfsd_serv) 247 - rv = nn->nfsd_serv->sv_nrthreads; 247 + for (i = 0; i < nn->nfsd_serv->sv_nrpools; ++i) 248 + rv += nn->nfsd_serv->sv_pools[i].sp_nrthrmax; 248 249 mutex_unlock(&nfsd_mutex); 249 250 return rv; 250 251 } ··· 660 659 661 660 if (serv) 662 661 for (i = 0; i < serv->sv_nrpools && i < n; i++) 663 - nthreads[i] = serv->sv_pools[i].sp_nrthreads; 662 + nthreads[i] = serv->sv_pools[i].sp_nrthrmax; 664 663 return 0; 665 664 } 666 665