Skip to content

Commit d0ee5a8

Browse files
committed
Merge: nfsd: use threads array as-is in netlink interface
MR: https://gitlab.com/redhat/centos-stream/src/kernel/centos-stream-10/-/merge_requests/1072 JIRA: https://issues.redhat.com/browse/RHEL-96874 Upstream-Status: https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next commit 8ea688a Author: Jeff Layton <[email protected]> Date: Tue, 27 May 2025 20:12:47 -0400 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]> Signed-off-by: Benjamin Coddington <[email protected]> Approved-by: Scott Mayhew <[email protected]> Approved-by: Olga Kornievskaia <[email protected]> Approved-by: CKI KWF Bot <[email protected]> Merged-by: Julio Faracco <[email protected]>
2 parents e8dc17a + 70ba2f2 commit d0ee5a8

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
@@ -1653,7 +1653,7 @@ int nfsd_nl_rpc_status_get_dumpit(struct sk_buff *skb,
16531653
*/
16541654
int nfsd_nl_threads_set_doit(struct sk_buff *skb, struct genl_info *info)
16551655
{
1656-
int *nthreads, count = 0, nrpools, i, ret = -EOPNOTSUPP, rem;
1656+
int *nthreads, nrpools = 0, i, ret = -EOPNOTSUPP, rem;
16571657
struct net *net = genl_info_net(info);
16581658
struct nfsd_net *nn = net_generic(net, nfsd_net_id);
16591659
const struct nlattr *attr;
@@ -1665,12 +1665,11 @@ int nfsd_nl_threads_set_doit(struct sk_buff *skb, struct genl_info *info)
16651665
/* count number of SERVER_THREADS values */
16661666
nlmsg_for_each_attr(attr, info->nlhdr, GENL_HDRLEN, rem) {
16671667
if (nla_type(attr) == NFSD_A_SERVER_THREADS)
1668-
count++;
1668+
nrpools++;
16691669
}
16701670

16711671
mutex_lock(&nfsd_mutex);
16721672

1673-
nrpools = max(count, nfsd_nrpools(net));
16741673
nthreads = kcalloc(nrpools, sizeof(int), GFP_KERNEL);
16751674
if (!nthreads) {
16761675
ret = -ENOMEM;

0 commit comments

Comments
 (0)