All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jakub Kicinski <kuba@kernel.org>
To: Lorenzo Bianconi <lorenzo@kernel.org>
Cc: linux-nfs@vger.kernel.org, lorenzo.bianconi@redhat.com,
	jlayton@kernel.org, neilb@suse.de, chuck.lever@oracle.com,
	netdev@vger.kernel.org
Subject: Re: [PATCH v3] NFSD: convert write_threads, write_maxblksize and write_maxconn to netlink commands
Date: Wed, 4 Oct 2023 10:09:55 -0700	[thread overview]
Message-ID: <20231004100955.32417c33@kernel.org> (raw)
In-Reply-To: <27646a34a3ddac3e0b0ad9b49aaf66b3cee5844f.1695766257.git.lorenzo@kernel.org>

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.

  parent reply	other threads:[~2023-10-04 17:09 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-09-26 22:13 [PATCH v3] NFSD: convert write_threads, write_maxblksize and write_maxconn to netlink commands Lorenzo Bianconi
2023-09-26 23:05 ` NeilBrown
2023-09-26 23:09   ` Chuck Lever III
2023-09-29 13:44   ` Chuck Lever
2023-10-01 16:56     ` Lorenzo Bianconi
2023-10-02 13:25     ` Jeff Layton
2023-10-02 15:19       ` Chuck Lever III
2023-10-02 15:53         ` Jeff Layton
2023-10-04 17:09 ` Jakub Kicinski [this message]
2023-10-05  9:03   ` Lorenzo Bianconi

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20231004100955.32417c33@kernel.org \
    --to=kuba@kernel.org \
    --cc=chuck.lever@oracle.com \
    --cc=jlayton@kernel.org \
    --cc=linux-nfs@vger.kernel.org \
    --cc=lorenzo.bianconi@redhat.com \
    --cc=lorenzo@kernel.org \
    --cc=neilb@suse.de \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.