From patchwork Sat Feb 25 01:41:01 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Deepa Dinamani X-Patchwork-Id: 9591419 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 9820060471 for ; Sat, 25 Feb 2017 01:42:17 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 87194281DB for ; Sat, 25 Feb 2017 01:42:17 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 7BBC8275A2; Sat, 25 Feb 2017 01:42:17 +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 38DFE275A2 for ; Sat, 25 Feb 2017 01:42:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751597AbdBYBmC (ORCPT ); Fri, 24 Feb 2017 20:42:02 -0500 Received: from mail-pf0-f195.google.com ([209.85.192.195]:34698 "EHLO mail-pf0-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751584AbdBYBmA (ORCPT ); Fri, 24 Feb 2017 20:42:00 -0500 Received: by mail-pf0-f195.google.com with SMTP id o64so1554536pfb.1; Fri, 24 Feb 2017 17:41:21 -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=2kiqgZOviGbeJPRCgADUV5lVLfayN2f2E/xecRHzyvM=; b=j2cBAj4FJ+lFUXc5DJ3ZyPYNfAhsmtorFQ0c31FwOoHBlNqLAxZRyUxucZ0f5wxFS0 a3dGR41JogrowMWrqeP8UlRA+w2uGRu4e7iI7UiQaeBMt+kOkRbsz5ZryH7MxXCQiZ7a nUOIbR98mH6lb6D5+wOd9mqHLDk8LkjAJA9L3FOGt9vGQn44IxEanhwTC89TcwhQeC1R b9MrA7LEfskQTvKJzdpFVWDHpwXdDsoGObaDKoRV2n7SaMKMV9gL1zlCyjcT4+ZPPJ8g 5EyQjPHL60lE8ECqKS8AYEA7HeGbARYZNxEKJG83rcJCiNcPzG7r/TSKjX999tkzOOXn um1w== 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=2kiqgZOviGbeJPRCgADUV5lVLfayN2f2E/xecRHzyvM=; b=KVyH3gWnTGmdA2Nt6VKi4epRwZYv0zOYvMenf1A7U1nMr1fb/bfy2FhD83bCoapTAm 4Nu/nPB75RsTT+lZqGVXDf0RyRsY0umfdVTuuomgs61iSvd5yiomMgvuXyhcbvM3B1g9 HqeY0yIgXSvarsF0s1GMnmxPOmRnbQXAFhKRWq8CORv6YV4PEzV4kZpN56WairQKqsml ZGGvM398Drf3g1a3WuH1hdrdjl4Gn5vvkFa2+ttemffREcE9deES8T2dscA5NlZBJZP3 Z1UXKz9JsyG1GuWb2At4zN9tMJceUyvXNegpeAj2m9cCOMR7NkZYbChxk+wHyOLeEdGY pJKg== X-Gm-Message-State: AMke39k2zQX0IattQEGE5nkOBgJWw7atcjEBRxRfnQJ0QtIiAYNrmprx9LvICebGvdqBfw== X-Received: by 10.84.205.70 with SMTP id o6mr8058532plh.56.1487986880719; Fri, 24 Feb 2017 17:41:20 -0800 (PST) Received: from deepa-ubuntu.hsd1.ca.comcast.net ([2601:647:5000:6620:d459:bd54:9ed4:a3f5]) by smtp.gmail.com with ESMTPSA id o24sm17175001pfj.78.2017.02.24.17.41.19 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 24 Feb 2017 17:41:20 -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 v4 3/5] ext4: Initialize timestamps limits Date: Fri, 24 Feb 2017 17:41:01 -0800 Message-Id: <1487986863-6005-4-git-send-email-deepa.kernel@gmail.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1487986863-6005-1-git-send-email-deepa.kernel@gmail.com> References: <1487986863-6005-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 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);