Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp1766920ybl; Sun, 18 Aug 2019 10:00:37 -0700 (PDT) X-Google-Smtp-Source: APXvYqzGiqOd0bbf1qgJKGC0msez2Vh116eHFDEy5vLK+Nx4j5Ng/NCKuST9mYX8auxc5YWNcjJW X-Received: by 2002:a63:f357:: with SMTP id t23mr16780090pgj.421.1566147637378; Sun, 18 Aug 2019 10:00:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1566147637; cv=none; d=google.com; s=arc-20160816; b=uSES7qRY9uHdhVcSvWRGP0teDnUKdlUDVmFthSu9QvGMBV3JkaeUtRQ13ZOIpbj2fZ TlA0BMZXQC/iv5Fg8QLYtfiQUrpHrNcsx/yVEt/E+Htv9+FhJIw38ZV6BQ4cEP6yumhB WCz1HN6OOyJkPfzEfLzQXroEKAdqOt505xsUAcwS1F0M7tdu+9nGCXH7xJhpj1I3o6cl GvayevgcJU/Ttr7rl0nXGj2IFeinfCeGNaxyqVBagMHqqLg2gyocoK54n5lhejrQttrJ DWcpylOYUvXX1K06l5IOtMJW/1MeFbxVUav/ar7rZdPplqKld8umMld5N7PxtE8NXqnP Apgw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature; bh=shWsRWzM35+5Yos+RU2UQmsto+H1BQo5byPAe0Akm68=; b=nuiYuLt0lJIAIhiiJRWKvSHBTxGgRt6sauUzp0R0s4R33FnrskfWGSZaOeKOUfzgnr ncMn9zKh+L63SPnGkRVju0g6U9qMygyxZa2zf0183Nwq2fromJ9lSZADpq6RdskZ3n+R r3whzzkAvFP0JRTwZuNK0ciOEf2wnsTnHGeGs0IYMCkwriaVue4txcdW2DarH2A+d7Wl LyxepbEBWTIxTbh+1aHGKPHjyE+4mpvVqKiLUOfGMqc4Jl9H46Vg5Qim9i6+BKUX26Ck IEmhJCedjrRHk9Nh4Kh25XwtLHJwtBk+IY2cegz2m2MGlH/WhsODtCn4a7T+BBxWLu+u sQYQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=B3e7PTxr; 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=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g7si8384569plq.360.2019.08.18.10.00.23; Sun, 18 Aug 2019 10:00:37 -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; dkim=pass header.i=@gmail.com header.s=20161025 header.b=B3e7PTxr; 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=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726952AbfHRQ7c (ORCPT + 99 others); Sun, 18 Aug 2019 12:59:32 -0400 Received: from mail-pf1-f196.google.com ([209.85.210.196]:32998 "EHLO mail-pf1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726089AbfHRQ7c (ORCPT ); Sun, 18 Aug 2019 12:59:32 -0400 Received: by mail-pf1-f196.google.com with SMTP id g2so5747950pfq.0; Sun, 18 Aug 2019 09:59:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=shWsRWzM35+5Yos+RU2UQmsto+H1BQo5byPAe0Akm68=; b=B3e7PTxrj2DaLWUCNuBoKtm+rwj4kJpzRtXfqb3S6l/65rA1d5fYVCs1Yb1CWqd+kD ZMmybglSMVjQQxS3iAUr6P+Zyx1uhPt4LSAIfhT76d3Sc7FuuTmfZqa3i0y3OqPKrUqX JaqwA6CAcS1tJTfKarwN1LwzB3hHNBUc5jhC8EhBi8WzHX1xRl3WW7Q2c30jCdXLmWiv FTdhcusPbhAcZP9xevzUawo7zWtNXs0rC0vkYntwCrEY+q1PfwI3DMWvkoXF4UEmPsaM Ak6/fh7YLisbbue03omVbf7CxA1bVejQseOGWut9dH9UoK8g7u5QHppD2fu8FLmjvEho E+mQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=shWsRWzM35+5Yos+RU2UQmsto+H1BQo5byPAe0Akm68=; b=nwpnHs295A+uTXlMGmWVOPvcvInNtfkBM71hCwP0CTrm1BVAkTDd9Yw/+CVU/vebJ+ OQJ4j44QjeecgEdlTaOGyYGS1rZLnKBSkoFgZYFGe2G7f1XxEYViaBtM57uGOUYSuVe9 cU6Fb3eAbWCLI6yhzQo2r/4060/7N+LVdqy4Nup0lvFyeh02HP0r9noyZGIPkRHUcOmn D89ejGvdtfxOHovJtm8iNqZA7nC65KQ3LFBM4SANQALvOxyNTiytdOPRes0nSvu0y9yG 6WwUNaYS9qAcVYndPFKylUgQuscHL6bQRf76iRUrfIuHknVtOrrcZdeCqWF6oWtvbPBc ZTsA== X-Gm-Message-State: APjAAAXvQ9ImytvHrN3P+lzsdlZfmXP0I2RFAaibBpZgjZygHNOpPiqh CnrgZjWUhHCcH61HmbHjk0A38A39 X-Received: by 2002:a62:2aca:: with SMTP id q193mr20674597pfq.209.1566147571763; Sun, 18 Aug 2019 09:59:31 -0700 (PDT) Received: from deepa-ubuntu.lan (c-98-234-52-230.hsd1.ca.comcast.net. [98.234.52.230]) by smtp.gmail.com with ESMTPSA id b136sm15732831pfb.73.2019.08.18.09.59.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 18 Aug 2019 09:59:31 -0700 (PDT) From: Deepa Dinamani To: viro@zeniv.linux.org.uk, linux-kernel@vger.kernel.org Cc: linux-fsdevel@vger.kernel.org, y2038@lists.linaro.org, arnd@arndb.de Subject: [PATCH v8 01/20] vfs: Add file timestamp range support Date: Sun, 18 Aug 2019 09:57:58 -0700 Message-Id: <20190818165817.32634-2-deepa.kernel@gmail.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190818165817.32634-1-deepa.kernel@gmail.com> References: <20190818165817.32634-1-deepa.kernel@gmail.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Add fields to the superblock to track the min and max timestamps supported by filesystems. Initially, when a superblock is allocated, initialize it to the max and min values the fields can hold. Individual filesystems override these to match their actual limits. Pseudo filesystems are assumed to always support the min and max allowable values for the fields. Signed-off-by: Deepa Dinamani --- fs/super.c | 2 ++ include/linux/fs.h | 3 +++ include/linux/time64.h | 2 ++ 3 files changed, 7 insertions(+) diff --git a/fs/super.c b/fs/super.c index 36cb5aaf6f08..620c1911bb36 100644 --- a/fs/super.c +++ b/fs/super.c @@ -258,6 +258,8 @@ static struct super_block *alloc_super(struct file_system_type *type, int flags, s->s_maxbytes = MAX_NON_LFS; s->s_op = &default_op; s->s_time_gran = 1000000000; + s->s_time_min = TIME64_MIN; + s->s_time_max = TIME64_MAX; s->cleancache_poolid = CLEANCACHE_NO_POOL; s->s_shrink.seeks = DEFAULT_SEEKS; diff --git a/include/linux/fs.h b/include/linux/fs.h index d97d74f35eb3..93c440d22547 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h @@ -1463,6 +1463,9 @@ struct super_block { /* Granularity of c/m/atime in ns (cannot be worse than a second) */ u32 s_time_gran; + /* Time limits for c/m/atime in seconds */ + time64_t s_time_min; + time64_t s_time_max; #ifdef CONFIG_FSNOTIFY __u32 s_fsnotify_mask; struct fsnotify_mark_connector __rcu *s_fsnotify_marks; diff --git a/include/linux/time64.h b/include/linux/time64.h index a620ee610b9f..19125489ae94 100644 --- a/include/linux/time64.h +++ b/include/linux/time64.h @@ -30,6 +30,8 @@ struct itimerspec64 { /* Located here for timespec[64]_valid_strict */ #define TIME64_MAX ((s64)~((u64)1 << 63)) +#define TIME64_MIN (-TIME64_MAX - 1) + #define KTIME_MAX ((s64)~((u64)1 << 63)) #define KTIME_SEC_MAX (KTIME_MAX / NSEC_PER_SEC) -- 2.17.1