If the enable_periodic_fsck option is false in /etc/mke2fs.conf (which
is also the default), s_max_mnt_count needs to be set to -1, instead
of 0. Kernels newer than 3.0 will interpret 0 to disable periodic
checks, but older kernels will print a warning message on each mount,
which will annoy users.
Addresses-Debian-Bug: #632637
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
ext2_filsys fs;
badblocks_list bb_list = 0;
unsigned int journal_blocks;
- unsigned int i, max_mnt_count, checkinterval;
+ unsigned int i, checkinterval;
+ int max_mnt_count;
int val, hash_alg;
int flags;
int old_bitmaps;
for (i = 0, val = 0 ; i < sizeof(fs->super->s_uuid); i++)
val += fs->super->s_uuid[i];
fs->super->s_max_mnt_count += val % EXT2_DFL_MAX_MNT_COUNT;
- }
+ } else
+ fs->super->s_max_mnt_count = -1;
/*
* Override the creator OS, if applicable
return j_blocks;
}
-void print_check_message(unsigned int mnt, unsigned int check)
+void print_check_message(int mnt, unsigned int check)
{
+ if (mnt < 0)
+ mnt = 0;
+ if (!mnt && !check)
+ return;
printf(_("This filesystem will be automatically "
"checked every %d mounts or\n"
"%g days, whichever comes first. "
extern void parse_journal_opts(const char *opts);
extern void check_mount(const char *device, int force, const char *type);
extern unsigned int figure_journal_size(int size, ext2_filsys fs);
-extern void print_check_message(unsigned int, unsigned int);
+extern void print_check_message(int, unsigned int);
extern void dump_mmp_msg(struct mmp_struct *mmp, const char *msg);