[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <Y38vZ/AuQNI0uPjl@nanopsycho>
Date: Thu, 24 Nov 2022 09:46:31 +0100
From: Jiri Pirko <jiri@...nulli.us>
To: Jacob Keller <jacob.e.keller@...el.com>
Cc: netdev@...r.kernel.org, Jiri Pirko <jiri@...dia.com>,
Jakub Kicinski <kuba@...nel.org>
Subject: Re: [PATCH net-next v2 2/9] devlink: report extended error message
in region_read_dumpit
Wed, Nov 23, 2022 at 09:38:27PM CET, jacob.e.keller@...el.com wrote:
[...]
>@@ -6525,8 +6525,14 @@ static int devlink_nl_cmd_region_read_dumpit(struct sk_buff *skb,
>
> devl_lock(devlink);
>
>- if (!attrs[DEVLINK_ATTR_REGION_NAME] ||
>- !attrs[DEVLINK_ATTR_REGION_SNAPSHOT_ID]) {
>+ if (!attrs[DEVLINK_ATTR_REGION_NAME]) {
>+ NL_SET_ERR_MSG(cb->extack, "No region name provided");
>+ err = -EINVAL;
>+ goto out_unlock;
>+ }
>+
>+ if (!attrs[DEVLINK_ATTR_REGION_SNAPSHOT_ID]) {
>+ NL_SET_ERR_MSG(cb->extack, "No snapshot id provided");
> err = -EINVAL;
> goto out_unlock;
> }
>@@ -6541,7 +6547,8 @@ static int devlink_nl_cmd_region_read_dumpit(struct sk_buff *skb,
> }
> }
>
>- region_name = nla_data(attrs[DEVLINK_ATTR_REGION_NAME]);
>+ region_attr = attrs[DEVLINK_ATTR_REGION_NAME];
>+ region_name = nla_data(region_attr);
>
> if (port)
> region = devlink_port_region_get_by_name(port, region_name);
>@@ -6549,6 +6556,7 @@ static int devlink_nl_cmd_region_read_dumpit(struct sk_buff *skb,
> region = devlink_region_get_by_name(devlink, region_name);
>
> if (!region) {
>+ NL_SET_ERR_MSG_ATTR(cb->extack, region_attr, "requested region does not exist");
Any reason why don't start the message with uppercase? It would be
consistent with the other 2 messages you just introduced.
Same goes to the message in the next patch (perhaps some others too)
> err = -EINVAL;
> goto out_unlock;
> }
>--
>2.38.1.420.g319605f8f00e
>
Powered by blists - more mailing lists