ChangeLog, unix.c:
unix.c (check_if_skip): Adapted patch from Andreas Dilger which prints
the number of mounts or days elapsed since the last check when e2fsck
is forced to check an otherwise clean filesystem.
diff --git a/e2fsck/unix.c b/e2fsck/unix.c
index f7ed56d..816f3ce 100644
--- a/e2fsck/unix.c
+++ b/e2fsck/unix.c
@@ -253,24 +253,30 @@
{
ext2_filsys fs = ctx->fs;
const char *reason = NULL;
+ unsigned int reason_arg = 0;
if (force || bad_blocks_file || cflag || swapfs)
return;
if (fs->super->s_state & EXT2_ERROR_FS)
- reason = _("contains a file system with errors");
+ reason = _(" contains a file system with errors");
else if ((fs->super->s_state & EXT2_VALID_FS) == 0)
- reason = _("was not cleanly unmounted");
+ reason = _(" was not cleanly unmounted");
else if ((fs->super->s_max_mnt_count > 0) &&
(fs->super->s_mnt_count >=
- (unsigned) fs->super->s_max_mnt_count))
- reason = _("has reached maximal mount count");
- else if (fs->super->s_checkinterval &&
+ (unsigned) fs->super->s_max_mnt_count)) {
+ reason = _(" has been mounted %u times without being checked");
+ reason_arg = fs->super->s_mnt_count;
+ } else if (fs->super->s_checkinterval &&
time(0) >= (fs->super->s_lastcheck +
- fs->super->s_checkinterval))
- reason = _("has gone too long without being checked");
+ fs->super->s_checkinterval)) {
+ reason = _(" has gone %u days without being checked");
+ reason_arg = (time(0) - fs->super->s_lastcheck)/(3600*24);
+ }
if (reason) {
- printf(_("%s %s, check forced.\n"), ctx->device_name, reason);
+ fputs(ctx->device_name, stdout);
+ printf(reason, reason_arg);
+ fputs(_(", check forced.\n"), stdout);
return;
}
printf(_("%s: clean, %d/%d files, %d/%d blocks\n"), ctx->device_name,