From patchwork Sun Feb 3 04:44:05 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [3/4] ext4: print error when argument of inode_readahead_blk is invalid From: Theodore Ts'o X-Patchwork-Id: 217725 Message-Id: <1359866646-29876-4-git-send-email-tytso@mit.edu> To: Ext4 Developers List Cc: Jan Kara , "Theodore Ts'o" Date: Sat, 2 Feb 2013 23:44:05 -0500 From: Jan Kara 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: Jan Kara Signed-off-by: "Theodore Ts'o" --- fs/ext4/super.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/fs/ext4/super.c b/fs/ext4/super.c index e8d3c2f..bcd5f12 100644 --- a/fs/ext4/super.c +++ b/fs/ext4/super.c @@ -1558,11 +1558,10 @@ 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 > (1 << 30)) - return -1; - if (arg && !is_power_of_2(arg)) { - ext4_msg(sb, KERN_ERR, "EXT4-fs: inode_readahead_blks" - " must be a power of 2"); + if (arg && (arg > (1 << 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"); return -1; } sbi->s_inode_readahead_blks = arg;