ext4: don't warn about mnt_count if it has been disabled
authorTao Ma <boyu.mt@taobao.com>
Wed, 18 May 2011 17:29:57 +0000 (13:29 -0400)
committerTheodore Ts'o <tytso@mit.edu>
Wed, 18 May 2011 17:29:57 +0000 (13:29 -0400)
Currently, if we mkfs a new ext4 volume with s_max_mnt_count set to
zero, and mount it for the first time, we will get the warning:

maximal mount count reached, running e2fsck is recommended

It is really misleading. So change the check so that it won't warn in
that case.

Signed-off-by: Tao Ma <boyu.mt@taobao.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
fs/ext4/super.c

index 26893511825182bafa7f83784c183012457e3f1c..a1f12bab942504e0a0f0cda36439ae31d4bfbf64 100644 (file)
@@ -1914,7 +1914,7 @@ static int ext4_setup_super(struct super_block *sb, struct ext4_super_block *es,
                ext4_msg(sb, KERN_WARNING,
                         "warning: mounting fs with errors, "
                         "running e2fsck is recommended");
-       else if ((__s16) le16_to_cpu(es->s_max_mnt_count) >= 0 &&
+       else if ((__s16) le16_to_cpu(es->s_max_mnt_count) > 0 &&
                 le16_to_cpu(es->s_mnt_count) >=
                 (unsigned short) (__s16) le16_to_cpu(es->s_max_mnt_count))
                ext4_msg(sb, KERN_WARNING,