Skip to content

Commit 8ea688a

Browse files
jtlaytonchucklever
authored andcommitted
nfsd: use threads array as-is in netlink interface
The old nfsdfs interface for starting a server with multiple pools handles the special case of a single entry array passed down from userland by distributing the threads over every NUMA node. The netlink control interface however constructs an array of length nfsd_nrpools() and fills any unprovided slots with 0's. This behavior defeats the special casing that the old interface relies on. Change nfsd_nl_threads_set_doit() to pass down the array from userland as-is. Fixes: 7f5c330 ("nfsd: allow passing in array of thread counts via netlink") Cc: [email protected] Reported-by: Mike Snitzer <[email protected]> Closes: https://lore.kernel.org/linux-nfs/[email protected]/ Signed-off-by: Jeff Layton <[email protected]> Reviewed-by: Simon Horman <[email protected]> Tested-by: Mike Snitzer <[email protected]> Signed-off-by: Chuck Lever <[email protected]>
1 parent 8b3ac9f commit 8ea688a

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

fs/nfsd/nfsctl.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1611,7 +1611,7 @@ int nfsd_nl_rpc_status_get_dumpit(struct sk_buff *skb,
16111611
*/
16121612
int nfsd_nl_threads_set_doit(struct sk_buff *skb, struct genl_info *info)
16131613
{
1614-
int *nthreads, count = 0, nrpools, i, ret = -EOPNOTSUPP, rem;
1614+
int *nthreads, nrpools = 0, i, ret = -EOPNOTSUPP, rem;
16151615
struct net *net = genl_info_net(info);
16161616
struct nfsd_net *nn = net_generic(net, nfsd_net_id);
16171617
const struct nlattr *attr;
@@ -1623,12 +1623,11 @@ int nfsd_nl_threads_set_doit(struct sk_buff *skb, struct genl_info *info)
16231623
/* count number of SERVER_THREADS values */
16241624
nlmsg_for_each_attr(attr, info->nlhdr, GENL_HDRLEN, rem) {
16251625
if (nla_type(attr) == NFSD_A_SERVER_THREADS)
1626-
count++;
1626+
nrpools++;
16271627
}
16281628

16291629
mutex_lock(&nfsd_mutex);
16301630

1631-
nrpools = max(count, nfsd_nrpools(net));
16321631
nthreads = kcalloc(nrpools, sizeof(int), GFP_KERNEL);
16331632
if (!nthreads) {
16341633
ret = -ENOMEM;

0 commit comments

Comments
 (0)