From patchwork Thu Nov 24 00:47:48 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Deepa Dinamani X-Patchwork-Id: 9444597 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 582F1600BA for ; Thu, 24 Nov 2016 00:50:32 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5453B27D76 for ; Thu, 24 Nov 2016 00:50:32 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 4817227DCD; Thu, 24 Nov 2016 00:50:32 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D0C4927D76 for ; Thu, 24 Nov 2016 00:50:31 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S936132AbcKXAtc (ORCPT ); Wed, 23 Nov 2016 19:49:32 -0500 Received: from mail-pf0-f193.google.com ([209.85.192.193]:35472 "EHLO mail-pf0-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S935138AbcKXAsj (ORCPT ); Wed, 23 Nov 2016 19:48:39 -0500 Received: by mail-pf0-f193.google.com with SMTP id i88so1141331pfk.2; Wed, 23 Nov 2016 16:48:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=miumYiYqPmyhChJ7IUge22/kHXctqHbeiWNLBBy8YoQ=; b=eoCERMJs/kar5Jq7bZNXMjTCDitxM+9ZTWEpVCg1vG8W1PItGyd5sl8JMXeDKFTm1u ULFxpzGNKkb0DKExXQWX11c2xw+RW/ssFkrUWpnuQyxST6qf0zNekT1M/3pCM6f+Vrj6 UCxNxuTLGGqCR6E3M4mEqNzJqWVXA7h1BmS2vU+gYf3URSbA5WTBWoiwoPRvD6wqYq3i Q6eBqhaXt5Wpcq1Jq+z0snJAWI6iTIfjx/mSJqFVjEzVeCB8fvGsp1LR/KPMebRZRWen b8WbTkbUwEv3Alpc3QXNzTQW9Jdp/lLKSdj5tCflDB0H5YTKGsDO7J72+Wf0qoTTl4P0 wK6g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=miumYiYqPmyhChJ7IUge22/kHXctqHbeiWNLBBy8YoQ=; b=Avbz+GT3H8GJLqmLRZEGeN0rSLtiPo/BY7/0XrLZTlxggPNzhdt0HaB20dP8hw9Lyc T3J/dIv1s5+fPyEGvVPMpmXBqWEYPxSltGsti2d8qyMjkqka2Xt2UqL2KddXgH2GgDfL 7oHKBoE4of9kQuo9orovq8M1Y0xFLrzhiIV2eIaNA4wMXLDHjdGckBtJXDMrTrFjJC7l aKnAZLH9TdgGuPBdhTxZEfaODAnizcRov44sY2lH1TRV2sWGgIgjWIUusFz6Ah65vPPW donhm7OTeh0vTC9TlUtBRziwNkZbfB6tioOnz6s64uihGEZuzeJGi1LhUQH3d5N58RrD +NNw== X-Gm-Message-State: AKaTC01LALIBpGMWZ7Omoe9zh0oeC8mnTUs1YP1Yd89Ru7A45Dc/PfAd76eSBd3CNFSD1A== X-Received: by 10.84.179.165 with SMTP id b34mr12500640plc.162.1479948491681; Wed, 23 Nov 2016 16:48:11 -0800 (PST) Received: from localhost.localdomain (c-24-6-102-171.hsd1.ca.comcast.net. [24.6.102.171]) by smtp.gmail.com with ESMTPSA id i11sm37364702pgn.17.2016.11.23.16.48.10 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 23 Nov 2016 16:48:11 -0800 (PST) From: Deepa Dinamani To: linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Cc: arnd@arndb.de, tglx@linutronix.de, gregkh@linuxfoundation.org, akpm@linux-foundation.org, tytso@mit.edu, viro@zeniv.linux.org.uk, y2038@lists.linaro.org, Andreas Dilger , linux-ext4@vger.kernel.org Subject: [RFC 4/6] ext4: Initialize timestamps limits Date: Wed, 23 Nov 2016 16:47:48 -0800 Message-Id: <1479948470-2397-5-git-send-email-deepa.kernel@gmail.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1479948470-2397-1-git-send-email-deepa.kernel@gmail.com> References: <1479948470-2397-1-git-send-email-deepa.kernel@gmail.com> Sender: linux-fsdevel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP ext4 has different overflow limits for max filesystem timestamps based on the extra bytes available. Signed-off-by: Deepa Dinamani Cc: "Theodore Ts'o" Cc: Andreas Dilger Cc: linux-ext4@vger.kernel.org --- fs/ext4/ext4.h | 4 ++++ fs/ext4/super.c | 7 ++++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/fs/ext4/ext4.h b/fs/ext4/ext4.h index aff204f..e15c081 100644 --- a/fs/ext4/ext4.h +++ b/fs/ext4/ext4.h @@ -1636,6 +1636,10 @@ static inline void ext4_clear_state_flags(struct ext4_inode_info *ei) #define EXT4_GOOD_OLD_INODE_SIZE 128 +#define EXT4_EXTRA_TIMESTAMP_MAX (((s64)1 << 34) - 1 + S32_MIN) +#define EXT4_NON_EXTRA_TIMESTAMP_MAX Y2038_EXPIRY_TIMESTAMP +#define EXT4_TIMESTAMP_MIN S32_MIN + /* * Feature set definitions */ diff --git a/fs/ext4/super.c b/fs/ext4/super.c index 72b459d..0519c52 100644 --- a/fs/ext4/super.c +++ b/fs/ext4/super.c @@ -3672,8 +3672,13 @@ static int ext4_fill_super(struct super_block *sb, void *data, int silent) sbi->s_inode_size); goto failed_mount; } - if (sbi->s_inode_size > EXT4_GOOD_OLD_INODE_SIZE) + if (sbi->s_inode_size > EXT4_GOOD_OLD_INODE_SIZE) { sb->s_time_gran = 1 << (EXT4_EPOCH_BITS - 2); + sb->s_time_max = EXT4_EXTRA_TIMESTAMP_MAX; + } else + sb->s_time_max = EXT4_NON_EXTRA_TIMESTAMP_MAX; + + sb->s_time_min = EXT4_TIMESTAMP_MIN; } sbi->s_desc_size = le16_to_cpu(es->s_desc_size);