linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Li zeming <zeming@nfschina.com>
To: mcgrof@kernel.org, keescook@chromium.org, yzaikin@google.com
Cc: linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org,
	Li zeming <zeming@nfschina.com>
Subject: [PATCH] proc/proc_sysctl: Modify the order of scheduling function calls
Date: Mon,  5 Sep 2022 09:29:25 +0800	[thread overview]
Message-ID: <20220905012925.3117-1-zeming@nfschina.com> (raw)

When the ctl_table_header object is judged to be valid, the scheduling
check is performed again.

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  1:29 UTC|newest]

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

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