lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Thu, 17 Jan 2013 21:33:47 +0100
From:	Jiri Pirko <jiri@...nulli.us>
To:	Stephen Hemminger <stephen@...workplumber.org>
Cc:	netdev@...r.kernel.org, davem@...emloft.net
Subject: Re: [patch net-next] team: do not use -ENOENT

Thu, Jan 17, 2013 at 04:51:15PM CET, stephen@...workplumber.org wrote:
>On Thu, 17 Jan 2013 11:25:00 +0100
>Jiri Pirko <jiri@...nulli.us> wrote:
>
>> Since this error code means "No such file or directory", change this
>> value in team driver to ones which make more sense.
>> 
>> Signed-off-by: Jiri Pirko <jiri@...nulli.us>
>> ---
>>  drivers/net/team/team.c                   | 4 ++--
>>  drivers/net/team/team_mode_activebackup.c | 2 +-
>>  2 files changed, 3 insertions(+), 3 deletions(-)
>> 
>> diff --git a/drivers/net/team/team.c b/drivers/net/team/team.c
>> index 70d5d6b..3d7cf6e 100644
>> --- a/drivers/net/team/team.c
>> +++ b/drivers/net/team/team.c
>> @@ -1128,7 +1128,7 @@ static int team_port_del(struct team *team, struct net_device *port_dev)
>>  	if (!port || !team_port_find(team, port)) {
>>  		netdev_err(dev, "Device %s does not act as a port of this team\n",
>>  			   portname);
>> -		return -ENOENT;
>> +		return -ENODEV;
>>  	}
>>  
>>  	__team_option_inst_mark_removed_port(team, port);
>> @@ -2320,7 +2320,7 @@ static int team_nl_cmd_options_set(struct sk_buff *skb, struct genl_info *info)
>>  			list_add(&opt_inst->tmp_list, &opt_inst_list);
>>  		}
>>  		if (!opt_found) {
>> -			err = -ENOENT;
>> +			err = -EINVAL;
>>  			goto team_put;
>>  		}
>>  	}
>> diff --git a/drivers/net/team/team_mode_activebackup.c b/drivers/net/team/team_mode_activebackup.c
>> index 6262b4d..2792e13 100644
>> --- a/drivers/net/team/team_mode_activebackup.c
>> +++ b/drivers/net/team/team_mode_activebackup.c
>> @@ -81,7 +81,7 @@ static int ab_active_port_set(struct team *team, struct team_gsetter_ctx *ctx)
>>  			return 0;
>>  		}
>>  	}
>> -	return -ENOENT;
>> +	return -ENODEV;
>>  }
>>  
>>  static const struct team_option ab_options[] = {
>
>To be pedantic.
>Changing errno's means effectively changing the ABI.
>Linus has already rejected similar patches in other areas.

I'm not really sure. But in this case, I do not think that is a problem.

1) I'm most probably the only one (libteam) who is using this api and
libteam does not mind about what err code is returned in these cases.

2) In this case, it is only about different number. And one number or
another, it does not imply userspace to behave differently. In other words,
userspace should not take different actions in case for example -ENOENT
or -ENODEV is returned.

But as I said, I'm not sure.

Thanks

Jiri
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ