[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20231004100955.32417c33@kernel.org>
Date: Wed, 4 Oct 2023 10:09:55 -0700
From: Jakub Kicinski <kuba@...nel.org>
To: Lorenzo Bianconi <lorenzo@...nel.org>
Cc: linux-nfs@...r.kernel.org, lorenzo.bianconi@...hat.com,
jlayton@...nel.org, neilb@...e.de, chuck.lever@...cle.com,
netdev@...r.kernel.org
Subject: Re: [PATCH v3] NFSD: convert write_threads, write_maxblksize and
write_maxconn to netlink commands
On Wed, 27 Sep 2023 00:13:15 +0200 Lorenzo Bianconi wrote:
> +int nfsd_nl_threads_set_doit(struct sk_buff *skb, struct genl_info *info)
> +{
> + u32 nthreads;
> + int ret;
> +
> + if (!info->attrs[NFSD_A_CONTROL_PLANE_THREADS])
> + return -EINVAL;
Consider using GENL_REQ_ATTR_CHECK(), it will auto-add nice error
message to the reply on error.
> + nthreads = nla_get_u32(info->attrs[NFSD_A_CONTROL_PLANE_THREADS]);
> +
> + ret = nfsd_svc(nthreads, genl_info_net(info), get_current_cred());
> + return ret == nthreads ? 0 : ret;
> +}
> +
> +static int nfsd_nl_get_dump(struct sk_buff *skb, struct netlink_callback *cb,
> + int cmd, int attr, u32 val)
YNL will dutifully return a list for every dump. If you're only getting
a single reply 'do' will be much better.
Powered by blists - more mailing lists