From patchwork Fri Mar 30 15:31:37 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eric Sandeen X-Patchwork-Id: 893383 Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=linux-ext4-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=redhat.com Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 40CQZg6r0Lz9s0y for ; Sat, 31 Mar 2018 02:31:39 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751306AbeC3Pbj (ORCPT ); Fri, 30 Mar 2018 11:31:39 -0400 Received: from mx1.redhat.com ([209.132.183.28]:38662 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751267AbeC3Pbi (ORCPT ); Fri, 30 Mar 2018 11:31:38 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 9C319C0AEE5A for ; Fri, 30 Mar 2018 15:31:38 +0000 (UTC) Received: from [IPv6:::1] (ovpn04.gateway.prod.ext.phx2.redhat.com [10.5.9.4]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 7311A5D6A8 for ; Fri, 30 Mar 2018 15:31:38 +0000 (UTC) To: "linux-ext4@vger.kernel.org" From: Eric Sandeen Subject: [PATCH] e2fsck: warn if checkinterval and broken_system_clock both set Message-ID: <6e050ac3-443f-a38b-8831-92ca6ac2a240@redhat.com> Date: Fri, 30 Mar 2018 10:31:37 -0500 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.11; rv:52.0) Gecko/20100101 Thunderbird/52.7.0 MIME-Version: 1.0 Content-Language: en-US X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.32]); Fri, 30 Mar 2018 15:31:38 +0000 (UTC) Sender: linux-ext4-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org If broken_system_clock is set in e2fsck.conf and this causes the check interval to be ignored, make that clear to the user: # e2fsck /dev/sda1 e2fsck 1.44.1 (24-Mar-2018) /dev/sda1: ignoring check interval, broken_system_clock set /dev/sda1: clean, 11/65536 files, 12955/262144 blocks Signed-off-by: Eric Sandeen Reviewed-by: Lukas Czerner --- (I wasn't sure, maybe this test should go outside all the reason- setting, since this is a not-checking case? But in the end it seemed to make most sense along with all the other tests for these states.) diff --git a/e2fsck/unix.c b/e2fsck/unix.c index faf5af9..3a76be1 100644 --- a/e2fsck/unix.c +++ b/e2fsck/unix.c @@ -396,7 +396,12 @@ static void check_if_skip(e2fsck_t ctx) if (batt && ((ctx->now - fs->super->s_lastcheck) < fs->super->s_checkinterval*2)) reason = 0; + } else if (broken_system_clock && fs->super->s_checkinterval) { + log_out(ctx, "%s: ", ctx->device_name); + log_out(ctx, "%s", + _("ignoring check interval, broken_system_clock set\n")); } + if (reason) { log_out(ctx, "%s", ctx->device_name); log_out(ctx, reason, reason_arg);