From patchwork Wed Nov 2 15:04:54 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Deepa Dinamani X-Patchwork-Id: 9409337 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 D86FC6022E for ; Wed, 2 Nov 2016 15:06:07 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id CA1352A2F3 for ; Wed, 2 Nov 2016 15:06:07 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id BEE702A2F5; Wed, 2 Nov 2016 15:06:07 +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 CF6972A2F3 for ; Wed, 2 Nov 2016 15:06:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755741AbcKBPFv (ORCPT ); Wed, 2 Nov 2016 11:05:51 -0400 Received: from mail-yw0-f194.google.com ([209.85.161.194]:34929 "EHLO mail-yw0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755919AbcKBPFP (ORCPT ); Wed, 2 Nov 2016 11:05:15 -0400 Received: by mail-yw0-f194.google.com with SMTP id h14so613369ywa.2; Wed, 02 Nov 2016 08:05:14 -0700 (PDT) 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=U/V3/CMVvYSnfcHtSJiiz0owpxtU0msiS39420aEgzo=; b=IK/AVzeKkBejS9GZI3X2RxD0XcK4ew9akl+BrgG39ENINGWshgL2BBdQ0SHTeXEKk4 bWDan52i7Hs9qqw89S8iSBcD7NuPPB7WqGcb+piS4JUcHTMqYqIh9ZCmLI8TG0Y54ZRx 5t1P2USyXrxYlxuM6+f2HnkGXoJ4xHNKAMfNfzYF07nDKn2V2V/olgul4fAL62MomwLT 82pAxyPBXwG/y/cUR6YNYtjoujmZ5VH4rNtp2SQuKB/vH82le809OyK8ZPyYKwfjf91i vH4gsoSj+3w2R7NVZlfofl5ztSTNubnYQw7dFoiDYjYW1Ytj1mQnFAJfuy2XWoDTMSGc Iq9A== 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=U/V3/CMVvYSnfcHtSJiiz0owpxtU0msiS39420aEgzo=; b=fDxZNC8be/H6B4lbpofmqtik7vofwJvf/dCXguxzTORMw1fYNdMHUmZfT5OWDQkxlQ f3Q4W4MGMaHqZ1hqiWp5z80LogwMbcAqp7F44kwdBzgm7VOrnBbclXhCzZCbh9dS2znu DHgmvFfxptKstK4h9DXhZ+iHloapfyRLcAgCeXFq0tkyDDnp7sebHbMOHP8nFOkKJyRo pmBv5Y1CLVRwdcp+ebfeZO8QzunQMT12GHVKesCDneEYPbIqI5igaLCREendyYUpx78q dV3Z2doQoUlyXw8puTtHE6g4RcgnvrQaui7AEEKihXHj03aRbRihD3Tr7KNPp6av2R0v UD+w== X-Gm-Message-State: ABUngvfm2bfATPrTPhG2dsRpQXBO18AUrDmqkHvY+Gj09zMq6rdnouDR2fQRjINkF/zuNA== X-Received: by 10.129.99.132 with SMTP id x126mr3146899ywb.313.1478099113753; Wed, 02 Nov 2016 08:05:13 -0700 (PDT) Received: from deepa-ubuntu.hil-sfecghh.abq.wayport.net (ip-64-134-56-224.public.wayport.net. [64.134.56.224]) by smtp.gmail.com with ESMTPSA id m126sm723358ywf.14.2016.11.02.08.05.12 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 02 Nov 2016 08:05:13 -0700 (PDT) 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, 2 Nov 2016 08:04:54 -0700 Message-Id: <1478099096-25637-5-git-send-email-deepa.kernel@gmail.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1478099096-25637-1-git-send-email-deepa.kernel@gmail.com> References: <1478099096-25637-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 6789379..fca339a 100644 --- a/fs/ext4/ext4.h +++ b/fs/ext4/ext4.h @@ -1635,6 +1635,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 ab00bff..ebd039d 100644 --- a/fs/ext4/super.c +++ b/fs/ext4/super.c @@ -3633,8 +3633,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);