linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Hannes Frederic Sowa" <hannes@stressinduktion.org>
To: "Kefeng Wang" <wangkefeng.wang@huawei.com>,
	linux-kernel@vger.kernel.org, netdev@vger.kernel.org
Cc: "Daniel Borkmann" <daniel@iogearbox.net>,
	"David Miller" <davem@davemloft.net>,
	"Eric Dumazet" <edumazet@google.com>,
	"Minmin chen" <chenmingmin@huawei.com>,
	"Jakub Kicinski" <kuba@kernel.org>,
	"Greg Kroah-Hartman" <gregkh@linuxfoundation.org>,
	"Andrew Morton" <akpm@linux-foundation.org>
Subject: Re: [PATCH] once: Fix panic when module unload
Date: Tue, 03 Aug 2021 11:59:34 +0200	[thread overview]
Message-ID: <3017d4a6-8f1b-4f8b-9c73-1121f0251fde@www.fastmail.com> (raw)
In-Reply-To: <6b4b7165-5438-df65-3a43-7dcb576dab93@huawei.com>

Hello,

On Tue, Aug 3, 2021, at 04:11, Kefeng Wang wrote:
> Hi ALL, I don't know who maintain the lib/once.c, add Greg and Andrew too,
> 
> Hi David, I check the history, the lib/once.c is from net/core/utils.c 
> since
> 
> commit 46234253b9363894a254844a6550b4cc5f3edfe8
> Author: Hannes Frederic Sowa <hannes@stressinduktion.org>
> Date:   Thu Oct 8 01:20:35 2015 +0200
> 
>      net: move net_get_random_once to lib
> 
> This bug is found in our product test, we want to make sure that whether 
> this solution
> 
> is correct or not, so could David or any others help to review this patch.
> 
> Many thinks.

Thanks for the patch.

I see that it got marked as not applicable for the net trees:
<https://patchwork.kernel.org/project/netdevbpf/patch/20210622022138.23048-1-wangkefeng.wang@huawei.com/>

Back then I added this code via the net/ tree thus I think it should get
picked up nonetheless hopefully.

Regarding your patch, I think it mostly looks fine:

It might be worthwhile to increment the reference counter inside the
preempt disabled bracket in find_module_by_key (and thus also rename
that function to make this fact more clear).

The other option would be to use the macro DO_ONCE and always pass in
THIS_MODULE from there, increment its ref counter in once_disable_jump.
This might be more canonical.

Thanks and sorry for the delay,
Hannes

  reply	other threads:[~2021-08-03 10:00 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-22  2:21 [PATCH] once: Fix panic when module unload Kefeng Wang
2021-07-16  5:03 ` Kefeng Wang
2021-08-03  2:11 ` Kefeng Wang
2021-08-03  9:59   ` Hannes Frederic Sowa [this message]
2021-08-04  1:49     ` Kefeng Wang

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=3017d4a6-8f1b-4f8b-9c73-1121f0251fde@www.fastmail.com \
    --to=hannes@stressinduktion.org \
    --cc=akpm@linux-foundation.org \
    --cc=chenmingmin@huawei.com \
    --cc=daniel@iogearbox.net \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=wangkefeng.wang@huawei.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
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;
as well as URLs for NNTP newsgroup(s).