ext4: print error when argument of inode_readahead_blk is invalid
authorJan Kara <jack@suse.cz>
Sun, 3 Feb 2013 04:14:31 +0000 (23:14 -0500)
committerTheodore Ts'o <tytso@mit.edu>
Sun, 3 Feb 2013 04:14:31 +0000 (23:14 -0500)
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 <jack@suse.cz>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
fs/ext4/super.c

index 9b36c11baad98f7fc9d702d215e307faa7e8a7b8..b68f4b671bc7eaec7a311c2f4d05c2eb5372c564 100644 (file)
@@ -1555,11 +1555,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;