From: Dan Carpenter <dan.carpenter@oracle.com>
To: "Theodore Ts'o" <tytso@mit.edu>
Cc: Andreas Dilger <adilger.kernel@dilger.ca>,
linux-ext4@vger.kernel.org, kernel-janitors@vger.kernel.org
Subject: [PATCH] ext4: prevent very high s_inode_readahead_blks
Date: Mon, 11 Feb 2019 21:44:59 +0300 [thread overview]
Message-ID: <20190211184459.GB22106@kadam> (raw)
My static checker complains that "arg" can be negative. That does seem
possible. I don't know if it causes an issue at run time but it seems
safest to allow negatives.
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
---
fs/ext4/super.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/fs/ext4/super.c b/fs/ext4/super.c
index 60da0a6e4d86..4e0845708c52 100644
--- a/fs/ext4/super.c
+++ b/fs/ext4/super.c
@@ -1838,7 +1838,7 @@ static int handle_mount_opt(struct super_block *sb, char *opt, int token,
} else if (token == Opt_min_batch_time) {
sbi->s_min_batch_time = arg;
} else if (token == Opt_inode_readahead_blks) {
- if (arg && (arg > (1 << 30) || !is_power_of_2(arg))) {
+ if (arg && (arg > (1U << 30) || !is_power_of_2(arg))) {
ext4_msg(sb, KERN_ERR,
"EXT4-fs: inode_readahead_blks must be "
"0 or a power of 2 smaller than 2^31");
--
2.17.1
next reply other threads:[~2019-02-11 18:45 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-02-11 18:44 Dan Carpenter [this message]
2019-02-11 20:38 ` [PATCH] ext4: prevent very high s_inode_readahead_blks Andreas Dilger
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=20190211184459.GB22106@kadam \
--to=dan.carpenter@oracle.com \
--cc=adilger.kernel@dilger.ca \
--cc=kernel-janitors@vger.kernel.org \
--cc=linux-ext4@vger.kernel.org \
--cc=tytso@mit.edu \
/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