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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:   Wed, 20 Jul 2022 17:09:06 +0200
From:   Jiri Pirko <jiri@...nulli.us>
To:     Ido Schimmel <idosch@...dia.com>
Cc:     netdev@...r.kernel.org, davem@...emloft.net, kuba@...nel.org,
        petrm@...dia.com, pabeni@...hat.com, edumazet@...gle.com,
        mlxsw@...dia.com, saeedm@...dia.com, snelson@...sando.io
Subject: Re: [patch net-next v2 05/12] mlxsw: core_linecards: Expose HW
 revision and INI version

Wed, Jul 20, 2022 at 05:01:12PM CEST, idosch@...dia.com wrote:
>On Wed, Jul 20, 2022 at 04:59:03PM +0200, Jiri Pirko wrote:
>> Wed, Jul 20, 2022 at 02:43:17PM CEST, idosch@...dia.com wrote:
>> >On Wed, Jul 20, 2022 at 02:27:40PM +0200, Jiri Pirko wrote:
>> >> Wed, Jul 20, 2022 at 10:56:35AM CEST, idosch@...dia.com wrote:
>> >> >On Tue, Jul 19, 2022 at 08:48:40AM +0200, Jiri Pirko wrote:
>> >> >> +int mlxsw_linecard_devlink_info_get(struct mlxsw_linecard *linecard,
>> >> >> +				    struct devlink_info_req *req,
>> >> >> +				    struct netlink_ext_ack *extack)
>> >> >> +{
>> >> >> +	char buf[32];
>> >> >> +	int err;
>> >> >> +
>> >> >> +	mutex_lock(&linecard->lock);
>> >> >> +	if (WARN_ON(!linecard->provisioned)) {
>> >> >> +		err = 0;
>> >> >
>> >> >Why not:
>> >> >
>> >> >err = -EINVAL;
>> >> >
>> >> >?
>> >> 
>> >> Well, a) this should not happen. No need to push error to the user for
>> >> this as the rest of the info message is still fine.
>> >
>> >Not sure what you mean by "the rest of the info message is still fine".
>> >Which info message? If the line card is not provisioned, then it
>> >shouldn't even have a devlink instance and it will not appear in
>> >"devlink dev info" dump.
>> >
>> >I still do not understand why this error is severe enough to print a
>> >WARNING to the kernel log, but not emit an error code to user space.
>> 
>> As I wrote, WARN_ON was a leftover.
>
>It was a leftover in patch #10 where you checked '!linecard->ready'.
>Here I think it's actually correct because it shouldn't happen unless
>I'm missing something

Correct, I confused myself :)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ