Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp31460ybl; Mon, 12 Aug 2019 11:10:35 -0700 (PDT) X-Google-Smtp-Source: APXvYqymkiQqjJfYprW5gR4GpAweFW7GWCNHXbe/bp9oTHtkPPBvNHGN/AVVL1mvReptvV7yjxOI X-Received: by 2002:a17:90a:7d04:: with SMTP id g4mr517703pjl.41.1565633435018; Mon, 12 Aug 2019 11:10:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1565633435; cv=none; d=google.com; s=arc-20160816; b=QBelwoTqXcPsZE2s7Gy+16CRCHpfp6oj8zMZpUipB1sYuRpsckhcG1XZZZtFJyPqi1 mlRtm7xuVe3gU6rDU2+qvx0TQ/Mdr9Al+LVVmYrMpQpLPjH4lMgKpwftFMncTMxI8TKx IEPx7OwGZO90R5dG43GErc1QTTjFUPIRH9wfc+o5pdytp8rtbVWU7GdLcuK97mVNYM1w WVZAwOVCc6vIe+C8xr86GdiHRIUty10Fwg65sz1vKobxHwQN4+5SfnZK3pNMOWU0JMJm 85FUPOkqbUsfv9qVNSBVyxGXgyCG3/sncHKKe41RDIv++PuYa37RcWjHHYzETc29yeZP lC2g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:organization:references:in-reply-to:date:cc:to:from :subject:message-id; bh=ItpSarhN6oEcK1uiOT00kN4zzJPyQO0FCT5Hgflu8IE=; b=MlsxsqEpNREAhIzzSWd6JCSD+bAy1NevqHtUAAcpXerwAgFosVgzE0g8X9otVqqVb/ rpDBUxTgrNIwGHfreFH0WneypoFSu8V4bLtYnNqRyLB6QXLond/DX8v0Sf7JMcLiYVC4 mCfZhPMme8YhnmlLeFJlN21XY6J2iGdHSuv2rnT9IIQhJqk3BmWgTxYi3vRVLoZoR8Og TSqf0dZyD6eilr7nMTdI+NFrtX3Pb27JBw4Ae50XRrUQynYLUFI8lDzWaFfM9Z93T/K7 bt4HtIf47Y4oB8p17j6RZ97Z+MBanQWZpTiKgfSrYUJp1yd5CsE2SgLqB1OlpVRduVET CbKQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=codethink.co.uk Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id gn22si58316072plb.422.2019.08.12.11.10.18; Mon, 12 Aug 2019 11:10:35 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=codethink.co.uk Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726719AbfHLSIO (ORCPT + 99 others); Mon, 12 Aug 2019 14:08:14 -0400 Received: from imap1.codethink.co.uk ([176.9.8.82]:48853 "EHLO imap1.codethink.co.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726185AbfHLSIN (ORCPT ); Mon, 12 Aug 2019 14:08:13 -0400 Received: from [167.98.27.226] (helo=xylophone) by imap1.codethink.co.uk with esmtpsa (Exim 4.84_2 #1 (Debian)) id 1hxELt-0001w2-Ar; Mon, 12 Aug 2019 18:43:25 +0100 Message-ID: <7edb5c85c29a46cf5edb6fe5033b07884fd068ae.camel@codethink.co.uk> Subject: Re: [Y2038] [PATCH 04/20] mount: Add mount warning for impending timestamp expiry From: Ben Hutchings To: Deepa Dinamani , Arnd Bergmann Cc: Alexander Viro , Linux Kernel Mailing List , Linux FS-devel Mailing List , y2038 Mailman List Date: Mon, 12 Aug 2019 18:43:24 +0100 In-Reply-To: References: <20190730014924.2193-1-deepa.kernel@gmail.com> <20190730014924.2193-5-deepa.kernel@gmail.com> <53df9d81bfb4ee7ec64fabf1089f91d80dceb491.camel@codethink.co.uk> Organization: Codethink Ltd. Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.30.5-1.1 MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, 2019-08-12 at 09:15 -0700, Deepa Dinamani wrote: > On Mon, Aug 12, 2019 at 9:09 AM Deepa Dinamani wrote: > > On Mon, Aug 12, 2019 at 7:11 AM Arnd Bergmann wrote: > > > On Mon, Aug 12, 2019 at 3:25 PM Ben Hutchings > > > wrote: > > > > On Sat, 2019-08-10 at 13:44 -0700, Deepa Dinamani wrote: > > > > > On Mon, Aug 5, 2019 at 7:14 AM Ben Hutchings > > > > > wrote: > > > > > > On Mon, 2019-07-29 at 18:49 -0700, Deepa Dinamani wrote: > > > > > > > The warning reuses the uptime max of 30 years used by the > > > > > > > setitimeofday(). > > > > > > > > > > > > > > Note that the warning is only added for new filesystem mounts > > > > > > > through the mount syscall. Automounts do not have the same warning. > > > > > > [...] > > > > > > > > > > > > Another thing - perhaps this warning should be suppressed for read-only > > > > > > mounts? > > > > > > > > > > Many filesystems support read only mounts only. We do fill in right > > > > > granularities and limits for these filesystems as well. In keeping > > > > > with the trend, I have added the warning accordingly. I don't think I > > > > > have a preference either way. But, not warning for the red only mounts > > > > > adds another if case. If you have a strong preference, I could add it > > > > > in. > > > > > > > > It seems to me that the warning is needed if there is a possibility of > > > > data loss (incorrect timestamps, potentially leading to incorrect > > > > decisions about which files are newer). This can happen only when a > > > > filesystem is mounted read-write, or when a filesystem image is > > > > created. > > > > > > > > I think that warning for read-only mounts would be an annoyance to > > > > users retrieving files from old filesystems. > > > > > > I agree, the warning is not helpful for read-only mounts. An earlier > > > plan was to completely disallow writable mounts that might risk an > > > overflow (in some configurations at least). The warning replaces that > > > now, and I think it should also just warn for the cases that would > > > otherwise have been dangerous. > > > > Ok, I will make the change to exclude new read only mounts. I will use > > __mnt_is_readonly() so that it also exculdes filesystems that are > > readonly also. > > The diff looks like below: > > > > - if (!error && sb->s_time_max && > > + if (!error && !__mnt_is_readonly(mnt) && > > (ktime_get_real_seconds() + TIME_UPTIME_SEC_MAX > sb->s_time_max)) { > > > > Note that we can get rid of checking for non zero sb->s_time_max now. > > One more thing, we will probably have to add a second warning for when > the filesystem is re-mounted rw after the initial readonly mount. Indeed, there would need to be a check for remount-read-write. I didn't check whether remount uses this same code path. Ben. -- Ben Hutchings, Software Developer Codethink Ltd https://www.codethink.co.uk/ Dale House, 35 Dale Street Manchester, M1 2HF, United Kingdom