From: "Michael S. Tsirkin" <mst@redhat•com>
To: Yury Norov <yury.norov@gmail•com>
Cc: linux-kernel@vger•kernel.org, netdev@vger•kernel.org,
Alexander Gordeev <agordeev@linux•ibm.com>,
Borislav Petkov <bp@alien8•de>,
Eric Dumazet <edumazet@google•com>,
Guo Ren <guoren@linux•alibaba.com>,
Jakub Kicinski <kuba@kernel•org>,
Kuniyuki Iwashima <kuniyu@amazon•com>,
Linus Torvalds <torvalds@linux-foundation•org>,
Menglong Dong <imagedong@tencent•com>,
Paolo Abeni <pabeni@redhat•com>, Petr Machata <petrm@nvidia•com>,
Sebastian Andrzej Siewior <bigeasy@linutronix•de>,
andriy.shevchenko@linux•intel.com, caraitto@google•com,
jonolson@google•com, willemb@google•com,
"David S .Miller" <davem@davemloft•net>,
Andrew Jones <ajones@ventanamicro•com>,
amritha.nambiar@intel•com, linux@rasmusvillemoes•dk
Subject: Re: [PATCH] Revert "net: fix cpu_max_bits_warn() usage in netif_attrmask_next{,_and}"
Date: Wed, 19 Oct 2022 07:49:35 -0400 [thread overview]
Message-ID: <20221019074843-mutt-send-email-mst@kernel.org> (raw)
In-Reply-To: <20221017030947.1295426-1-yury.norov@gmail.com>
On Sun, Oct 16, 2022 at 08:09:47PM -0700, Yury Norov wrote:
> This reverts commit 854701ba4c39afae2362ba19a580c461cb183e4f.
>
> The reverted commit makes netif_attr_test_online() network subsystems
> generating warnings, and it breaks syzkaller testing.
>
> https://syzkaller.appspot.com/bug?extid=9abe5ecc348676215427
>
> Signed-off-by: Yury Norov <yury.norov@gmail•com>
Fixes: 854701ba4c39 ("net: fix cpu_max_bits_warn() usage in netif_attrmask_next{,_and}")
Acked-by: Michael S. Tsirkin <mst@redhat•com>
> ---
> include/linux/netdevice.h | 10 ++++++----
> 1 file changed, 6 insertions(+), 4 deletions(-)
>
> diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h
> index a36edb0ec199..eddf8ee270e7 100644
> --- a/include/linux/netdevice.h
> +++ b/include/linux/netdevice.h
> @@ -3663,8 +3663,9 @@ static inline bool netif_attr_test_online(unsigned long j,
> static inline unsigned int netif_attrmask_next(int n, const unsigned long *srcp,
> unsigned int nr_bits)
> {
> - /* n is a prior cpu */
> - cpu_max_bits_warn(n + 1, nr_bits);
> + /* -1 is a legal arg here. */
> + if (n != -1)
> + cpu_max_bits_warn(n, nr_bits);
>
> if (srcp)
> return find_next_bit(srcp, nr_bits, n + 1);
> @@ -3685,8 +3686,9 @@ static inline int netif_attrmask_next_and(int n, const unsigned long *src1p,
> const unsigned long *src2p,
> unsigned int nr_bits)
> {
> - /* n is a prior cpu */
> - cpu_max_bits_warn(n + 1, nr_bits);
> + /* -1 is a legal arg here. */
> + if (n != -1)
> + cpu_max_bits_warn(n, nr_bits);
>
> if (src1p && src2p)
> return find_next_and_bit(src1p, src2p, nr_bits, n + 1);
> --
> 2.34.1
next prev parent reply other threads:[~2022-10-19 12:14 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-10-17 3:09 [PATCH] Revert "net: fix cpu_max_bits_warn() usage in netif_attrmask_next{,_and}" Yury Norov
2022-10-19 11:49 ` Michael S. Tsirkin [this message]
2022-10-19 12:16 ` Christian Borntraeger
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=20221019074843-mutt-send-email-mst@kernel.org \
--to=mst@redhat$(echo .)com \
--cc=agordeev@linux$(echo .)ibm.com \
--cc=ajones@ventanamicro$(echo .)com \
--cc=amritha.nambiar@intel$(echo .)com \
--cc=andriy.shevchenko@linux$(echo .)intel.com \
--cc=bigeasy@linutronix$(echo .)de \
--cc=bp@alien8$(echo .)de \
--cc=caraitto@google$(echo .)com \
--cc=davem@davemloft$(echo .)net \
--cc=edumazet@google$(echo .)com \
--cc=guoren@linux$(echo .)alibaba.com \
--cc=imagedong@tencent$(echo .)com \
--cc=jonolson@google$(echo .)com \
--cc=kuba@kernel$(echo .)org \
--cc=kuniyu@amazon$(echo .)com \
--cc=linux-kernel@vger$(echo .)kernel.org \
--cc=linux@rasmusvillemoes$(echo .)dk \
--cc=netdev@vger$(echo .)kernel.org \
--cc=pabeni@redhat$(echo .)com \
--cc=petrm@nvidia$(echo .)com \
--cc=torvalds@linux-foundation$(echo .)org \
--cc=willemb@google$(echo .)com \
--cc=yury.norov@gmail$(echo .)com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox