Commit e33e60ea authored by Jan Kara's avatar Jan Kara Committed by Theodore Ts'o

ext4: print error when argument of inode_readahead_blk is invalid

If argument of inode_readahead_blk is too big, we just bail out
without printing any error. Fix this since it could confuse users.
Signed-off-by: default avatarJan Kara <jack@suse.cz>
Signed-off-by: default avatar"Theodore Ts'o" <tytso@mit.edu>
parent 5f3633e3
...@@ -1555,11 +1555,10 @@ static int handle_mount_opt(struct super_block *sb, char *opt, int token, ...@@ -1555,11 +1555,10 @@ static int handle_mount_opt(struct super_block *sb, char *opt, int token,
} else if (token == Opt_min_batch_time) { } else if (token == Opt_min_batch_time) {
sbi->s_min_batch_time = arg; sbi->s_min_batch_time = arg;
} else if (token == Opt_inode_readahead_blks) { } else if (token == Opt_inode_readahead_blks) {
if (arg > (1 << 30)) if (arg && (arg > (1 << 30) || !is_power_of_2(arg))) {
return -1; ext4_msg(sb, KERN_ERR,
if (arg && !is_power_of_2(arg)) { "EXT4-fs: inode_readahead_blks must be "
ext4_msg(sb, KERN_ERR, "EXT4-fs: inode_readahead_blks" "0 or a power of 2 smaller than 2^31");
" must be a power of 2");
return -1; return -1;
} }
sbi->s_inode_readahead_blks = arg; sbi->s_inode_readahead_blks = arg;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment