diff options
author | Theodore Ts'o <tytso@mit.edu> | 2011-09-28 22:45:12 -0400 |
---|---|---|
committer | Theodore Ts'o <tytso@mit.edu> | 2011-09-28 23:20:56 -0400 |
commit | 14b283ae565930144ef5ace12483d602cc3e7539 (patch) | |
tree | 39d4f8740b1546c9e925890543c68653003648bf | |
parent | 0dbb256124db6dbc4bc47e00839c07c32dc29637 (diff) | |
download | e2fsprogs-14b283ae565930144ef5ace12483d602cc3e7539.tar.gz |
mke2fs: set s_max_mnt_count to -1 by default
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>
-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); |