linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Matthew Wilcox <willy@infradead.org>
To: Li zeming <zeming@nfschina.com>
Cc: mcgrof@kernel.org, keescook@chromium.org, yzaikin@google.com,
	linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org
Subject: Re: [PATCH] proc/proc_sysctl: Modify the order of scheduling function calls
Date: Mon, 5 Sep 2022 04:12:11 +0100	[thread overview]
Message-ID: <YxVpCyHBweai9npY@casper.infradead.org> (raw)
In-Reply-To: <20220905012925.3117-1-zeming@nfschina.com>

On Mon, Sep 05, 2022 at 09:29:25AM +0800, Li zeming wrote:
> When the ctl_table_header object is judged to be valid, the scheduling
> check is performed again.

No, we want the check in all cases, even if the header is NULL.

> Signed-off-by: Li zeming <zeming@nfschina.com>
> ---
>  fs/proc/proc_sysctl.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/fs/proc/proc_sysctl.c b/fs/proc/proc_sysctl.c
> index 50ba9e4fb284..36921e2ebeb0 100644
> --- a/fs/proc/proc_sysctl.c
> +++ b/fs/proc/proc_sysctl.c
> @@ -1729,11 +1729,10 @@ static void drop_sysctl_table(struct ctl_table_header *header)
>  void unregister_sysctl_table(struct ctl_table_header * header)
>  {
>  	int nr_subheaders;
> -	might_sleep();
> -
>  	if (header == NULL)
>  		return;
>  
> +	might_sleep();
>  	nr_subheaders = count_subheaders(header->ctl_table_arg);
>  	if (unlikely(nr_subheaders > 1)) {
>  		struct ctl_table_header **subheaders;
> -- 
> 2.18.2
> 

      reply	other threads:[~2022-09-05  3:13 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-05  1:29 [PATCH] proc/proc_sysctl: Modify the order of scheduling function calls Li zeming
2022-09-05  3:12 ` Matthew Wilcox [this message]

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=YxVpCyHBweai9npY@casper.infradead.org \
    --to=willy@infradead.org \
    --cc=keescook@chromium.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mcgrof@kernel.org \
    --cc=yzaikin@google.com \
    --cc=zeming@nfschina.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).