Skip to content

Commit df0d6b8

Browse files
namhyungjankara
authored andcommitted
ext3: Cleanup ext3_setup_super()
Fix mount-count check to emit warning only if s_max_mnt_count is greater than 0 according to man tune2fs(8). Also removes unnecessary casts. Signed-off-by: Namhyung Kim <namhyung@gmail.com> Signed-off-by: Jan Kara <jack@suse.cz>
1 parent 86f3cbe commit df0d6b8

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

‎fs/ext3/super.c‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1306,9 +1306,9 @@ static int ext3_setup_super(struct super_block *sb, struct ext3_super_block *es,
13061306
ext3_msg(sb, KERN_WARNING,
13071307
"warning: mounting fs with errors, "
13081308
"running e2fsck is recommended");
1309-
else if ((__s16) le16_to_cpu(es->s_max_mnt_count) >= 0 &&
1309+
else if ((__s16) le16_to_cpu(es->s_max_mnt_count) > 0 &&
13101310
le16_to_cpu(es->s_mnt_count) >=
1311-
(unsigned short) (__s16) le16_to_cpu(es->s_max_mnt_count))
1311+
le16_to_cpu(es->s_max_mnt_count))
13121312
ext3_msg(sb, KERN_WARNING,
13131313
"warning: maximal mount count reached, "
13141314
"running e2fsck is recommended");
@@ -1325,7 +1325,7 @@ static int ext3_setup_super(struct super_block *sb, struct ext3_super_block *es,
13251325
valid forever! :) */
13261326
es->s_state &= cpu_to_le16(~EXT3_VALID_FS);
13271327
#endif
1328-
if (!(__s16) le16_to_cpu(es->s_max_mnt_count))
1328+
if (!le16_to_cpu(es->s_max_mnt_count))
13291329
es->s_max_mnt_count = cpu_to_le16(EXT3_DFL_MAX_MNT_COUNT);
13301330
le16_add_cpu(&es->s_mnt_count, 1);
13311331
es->s_mtime = cpu_to_le32(get_seconds());

0 commit comments

Comments
 (0)