aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ext4
diff options
context:
space:
mode:
authorJan Kara <jack@suse.cz>2013-02-02 23:14:31 -0500
committerTheodore Ts'o <tytso@mit.edu>2013-02-02 23:14:31 -0500
commite33e60eaed5353c9e6863124ad1081a38640db4b (patch)
tree1217e3b4e4a53c8343a17b61c1aa337a781a64c8 /fs/ext4
parent5f3633e36b8a67c02d2d10cde5f056f9e5da49a1 (diff)
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: Jan Kara <jack@suse.cz> Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Diffstat (limited to 'fs/ext4')
-rw-r--r--fs/ext4/super.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/fs/ext4/super.c b/fs/ext4/super.c
index 9b36c11baad9..b68f4b671bc7 100644
--- a/fs/ext4/super.c
+++ b/fs/ext4/super.c
@@ -1555,11 +1555,10 @@ static int handle_mount_opt(struct super_block *sb, char *opt, int token,
1555 } else if (token == Opt_min_batch_time) { 1555 } else if (token == Opt_min_batch_time) {
1556 sbi->s_min_batch_time = arg; 1556 sbi->s_min_batch_time = arg;
1557 } else if (token == Opt_inode_readahead_blks) { 1557 } else if (token == Opt_inode_readahead_blks) {
1558 if (arg > (1 << 30)) 1558 if (arg && (arg > (1 << 30) || !is_power_of_2(arg))) {
1559 return -1; 1559 ext4_msg(sb, KERN_ERR,
1560 if (arg && !is_power_of_2(arg)) { 1560 "EXT4-fs: inode_readahead_blks must be "
1561 ext4_msg(sb, KERN_ERR, "EXT4-fs: inode_readahead_blks" 1561 "0 or a power of 2 smaller than 2^31");
1562 " must be a power of 2");
1563 return -1; 1562 return -1;
1564 } 1563 }
1565 sbi->s_inode_readahead_blks = arg; 1564 sbi->s_inode_readahead_blks = arg;