diff options
-rw-r--r-- | misc/mke2fs.c | 6 | ||||
-rw-r--r-- | misc/util.c | 6 | ||||
-rw-r--r-- | misc/util.h | 2 |
3 files changed, 10 insertions, 4 deletions
diff --git a/misc/mke2fs.c b/misc/mke2fs.c index 3dcb3b71..c439e37d 100644 --- a/misc/mke2fs.c +++ b/misc/mke2fs.c @@ -2196,7 +2196,8 @@ int main (int argc, char *argv[]) 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; @@ -2329,7 +2330,8 @@ int main (int argc, char *argv[]) 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 diff --git a/misc/util.c b/misc/util.c index 05334a61..6c93e1c6 100644 --- a/misc/util.c +++ b/misc/util.c @@ -278,8 +278,12 @@ unsigned int figure_journal_size(int size, ext2_filsys fs) 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. " diff --git a/misc/util.h b/misc/util.h index 56a77656..f872c38c 100644 --- a/misc/util.h +++ b/misc/util.h @@ -23,5 +23,5 @@ extern void check_plausibility(const char *device); 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); |