From: Yangtao Li <frank.li@vivo.com>
To: Jan Kara <jack@suse.com>
Cc: Yangtao Li <frank.li@vivo.com>, linux-kernel@vger.kernel.org
Subject: [PATCH] quota: check for register_sysctl() failure
Date: Sun, 19 Mar 2023 00:06:39 +0800 [thread overview]
Message-ID: <20230318160640.48461-1-frank.li@vivo.com> (raw)
register_sysctl() might fail, call panic() as with other failure
checks in this function if register_sysctl() failed.
Signed-off-by: Yangtao Li <frank.li@vivo.com>
---
fs/quota/dquot.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/fs/quota/dquot.c b/fs/quota/dquot.c
index 90cb70c82012..1483af271368 100644
--- a/fs/quota/dquot.c
+++ b/fs/quota/dquot.c
@@ -2955,7 +2955,8 @@ static int __init dquot_init(void)
printk(KERN_NOTICE "VFS: Disk quotas %s\n", __DQUOT_VERSION__);
- register_sysctl("fs/quota", fs_dqstats_table);
+ if (!register_sysctl("fs/quota", fs_dqstats_table))
+ panic("Cannot register dquot sysctl");
dquot_cachep = kmem_cache_create("dquot",
sizeof(struct dquot), sizeof(unsigned long) * 4,
--
2.35.1
next reply other threads:[~2023-03-18 16:07 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-03-18 16:06 Yangtao Li [this message]
2023-03-20 11:12 ` Jan Kara
2023-03-20 11:40 ` Yangtao Li
2023-03-20 17:11 ` Jan Kara
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=20230318160640.48461-1-frank.li@vivo.com \
--to=frank.li@vivo.com \
--cc=jack@suse.com \
--cc=linux-kernel@vger.kernel.org \
/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
all inboxes | Powered by JetHome®