From patchwork Sat Feb 18 23:30:06 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Deepa Dinamani X-Patchwork-Id: 9581397 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 3A9886049F for ; Sat, 18 Feb 2017 23:32:25 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 31E03287B7 for ; Sat, 18 Feb 2017 23:32:25 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 16EB8287B0; Sat, 18 Feb 2017 23:32:25 +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.5 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM autolearn=unavailable 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 BDAB3287AF for ; Sat, 18 Feb 2017 23:32:24 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751345AbdBRXbg (ORCPT ); Sat, 18 Feb 2017 18:31:36 -0500 Received: from mail-pf0-f193.google.com ([209.85.192.193]:33704 "EHLO mail-pf0-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750820AbdBRXbJ (ORCPT ); Sat, 18 Feb 2017 18:31:09 -0500 Received: by mail-pf0-f193.google.com with SMTP id e4so6850518pfg.0; Sat, 18 Feb 2017 15:30:45 -0800 (PST) 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=XRKzmViU3imIuFkTyXlaPTrhep6v41dhNnwD/yAHnhY=; b=P3ci+g+5e0ZDfqta+auKotFybMnGCHs0ix4lkh6LDacnvYqVK4UyZtoTRET6e9oSP+ +4l8c6SPTOZDd2mhsPb7l+YubHD7OMrdOtVcsIC+fqkEHBW5YyaY4+8M2WJ912A90HxX fN/VOtqsfncqiTwaznYfFVfx3+RpTdQFRIXQRzwlj94gcyGj6Bj+EHJs8KdWOuLSGjF0 PuXEBW29koFfBQyHhV9BUefQwThNSYG3HpEGX+J8CsfSfL1qbSYb3mm2A34zmROOLZ0/ FrC0krBKtmtDxzuSYYgf5LyuslV0Gbo1EAw8oBUUMzUnVrDEUFAXJyk8/xarSWzyLWXK lBzw== 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=XRKzmViU3imIuFkTyXlaPTrhep6v41dhNnwD/yAHnhY=; b=Pb4XVOiEFNsKiMtt8ECzmia4UZTbS3LBMBEiDjupwBY2SxL4XAhjY9i9pGxjxAB6Xn ZsHjCRhvBF0JUCYQ7n86XFzI3/aSYGC2ZqCLv4uPY7x3/xPh0+D8cp9TyM/16q1zAojv jWAyoT0QnFAJE4mYxACJ2NFqdJhBZhYWeGlpIMZsJgDNUAL50qCOeqB+GzfNdXFq7iu3 SxGNIB/o9QtA9xtHIXm57llKJHmwN2dGrvbDLjDc5I75FznA1CKIx8SFAQmruNg/c9CY PG2VEC+DnbmhObCj7CTbUY855Xu1H6lhjdtVUPDs6dCuYvXM4lRXIUdtISGijsLBVKP8 xswA== X-Gm-Message-State: AMke39l68RmjzGtdbFlMpZrMwtGZyiGlHxnuRXn2zJvw1EBcQWa3IezFV8lwovKaMPJbAQ== X-Received: by 10.84.211.106 with SMTP id b97mr21305745pli.16.1487460644503; Sat, 18 Feb 2017 15:30:44 -0800 (PST) Received: from deepa-ubuntu.hsd1.ca.comcast.net ([2601:647:5000:6620:e8a1:d9de:f814:c176]) by smtp.gmail.com with ESMTPSA id s24sm27278030pgo.25.2017.02.18.15.30.43 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sat, 18 Feb 2017 15:30:44 -0800 (PST) From: Deepa Dinamani To: viro@zeniv.linux.org.uk, tytso@mit.edu, adilger.kernel@dilger.ca, linux-ext4@vger.kernel.org Cc: linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, arnd@arndb.de, y2038@lists.linaro.org Subject: [PATCH v3 3/5] ext4: Initialize timestamps limits Date: Sat, 18 Feb 2017 15:30:06 -0800 Message-Id: <1487460608-15697-4-git-send-email-deepa.kernel@gmail.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1487460608-15697-1-git-send-email-deepa.kernel@gmail.com> References: <1487460608-15697-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 --- 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 2bef0bd..7bac2cd 100644 --- a/fs/ext4/ext4.h +++ b/fs/ext4/ext4.h @@ -1639,6 +1639,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 a673558..a77e11c 100644 --- a/fs/ext4/super.c +++ b/fs/ext4/super.c @@ -3689,8 +3689,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);