[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20240515110626-mutt-send-email-mst@kernel.org>
Date: Wed, 15 May 2024 11:07:10 -0400
From: "Michael S. Tsirkin" <mst@...hat.com>
To: Dan Carpenter <dan.carpenter@...aro.org>
Cc: Xuan Zhuo <xuanzhuo@...ux.alibaba.com>,
Jason Wang <jasowang@...hat.com>,
"David S. Miller" <davem@...emloft.net>,
Eric Dumazet <edumazet@...gle.com>,
Jakub Kicinski <kuba@...nel.org>, Paolo Abeni <pabeni@...hat.com>,
virtualization@...ts.linux.dev, netdev@...r.kernel.org,
linux-kernel@...r.kernel.org, kernel-janitors@...r.kernel.org
Subject: Re: [PATCH net-next] virtio_net: Fix error code in
__virtnet_get_hw_stats()
On Wed, May 15, 2024 at 04:50:48PM +0200, Dan Carpenter wrote:
> On Sun, May 12, 2024 at 12:01:55PM -0400, Michael S. Tsirkin wrote:
> > On Fri, May 10, 2024 at 03:50:45PM +0300, Dan Carpenter wrote:
> > > The virtnet_send_command_reply() function returns true on success or
> > > false on failure. The "ok" variable is true/false depending on whether
> > > it succeeds or not. It's up to the caller to translate the true/false
> > > into -EINVAL on failure or zero for success.
> > >
> > > The bug is that __virtnet_get_hw_stats() returns false for both
> > > errors and success. It's not a bug, but it is confusing that the caller
> > > virtnet_get_hw_stats() uses an "ok" variable to store negative error
> > > codes.
> >
> > The bug is ... It's not a bug ....
> >
> > I think what you are trying to say is that the error isn't
> > really handled anyway, except for printing a warning,
> > so it's not a big deal.
> >
> > Right?
> >
>
> No, I'm sorry, that was confusing. The change to __virtnet_get_hw_stats()
> is a bugfix but the change to virtnet_get_hw_stats() was not a bugfix.
> I viewed this all as really one thing, because it's cleaning up the
> error codes which happens to fix a bug. It seems very related. At the
> same time, I can also see how people would disagree.
>
> I'm traveling until May 23. I can resend this. Probably as two patches
> for simpler review.
>
> regards,
> dan carpenter
>
Yea, no rush - bugfixes are fine after 23. And it's ok to combine into
one - we don't want inconsistent code - just please write a clear
commit log message.
--
MST
Powered by blists - more mailing lists