From patchwork Mon Jan 22 02:04:24 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Deepa Dinamani X-Patchwork-Id: 10177201 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 CF7A7601D5 for ; Mon, 22 Jan 2018 02:06:12 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C041E28399 for ; Mon, 22 Jan 2018 02:06:12 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B4EC9283BB; Mon, 22 Jan 2018 02:06:12 +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=-7.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_FROM, RCVD_IN_DNSWL_HI 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 27BC8283BF for ; Mon, 22 Jan 2018 02:06:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751229AbeAVCF1 (ORCPT ); Sun, 21 Jan 2018 21:05:27 -0500 Received: from mail-pf0-f196.google.com ([209.85.192.196]:45888 "EHLO mail-pf0-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751050AbeAVCFY (ORCPT ); Sun, 21 Jan 2018 21:05:24 -0500 Received: by mail-pf0-f196.google.com with SMTP id a88so5905028pfe.12; Sun, 21 Jan 2018 18:05:24 -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=V4/3uy3DmJZ3QpxMT4501VEMRbU/nT9ZF+3f9W4T1gg=; b=SfKsq+UfoToP7P3IWuNAzKI5/sE+6mQPlu5JAN1tvs+iXMeaJqWW8Fd64lgStIEvuZ +gEt4QPhZY3J/IyNhSlFKsuZblWHZ0HYjK4beGh4W1iQiFVM+HZgJTV4rc2CrzmS31GI TnjLgeOFnBomymQ9lGdZuTzuIRlRgG7+D338w1s0FoCFn3qlL0lcIQuamldxb1BRhlb3 qQ0C7chmRMVl7MB2T6iu4E7CCRp6xI5sP/ShgfeW4Uxpn0xg5LeCBoE32rNOeWsfMnHB CI0wB9Frh9yF2CaThhubuPbNovTTxHvjZFXoaq9qDpnq2raY8URhqjkA+DSsB57d22Rh Jcxg== 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=V4/3uy3DmJZ3QpxMT4501VEMRbU/nT9ZF+3f9W4T1gg=; b=l900dgVt8ctfD4vfEVmZGYmzF8tXM7TrsXoo8g5M8O+JOYJL6GAtpcmEiWdKQN2Dmu e4rNXuFmkXinb+oaawwAVBHajkPgAJwPxnIerLO6MQ5MqiWcjyhW6atItXRUnquqV/qd oM9Es1tWTY3SSpt7FPm0xb2l+12YDP7rxJgQBJfnVICDJfearwMeXnb7OcQZHYBUg9SW QfUGl3+nJTFW+/wt3/tSTT/MkHXXgy/o9dKEhNYA1dL7sLwq5+/xcMjzOjcJ3FJHrhkq 81zGvrxDEAkX4S8ahD8Z5aBpvc1czFbL5ekytLp7neoVVLLjTXUXFNQ4y8vna9KXPlvo dWXg== X-Gm-Message-State: AKwxytfYhOmf4dliI4vtWVhAxSEcrohdPZ/6fmhpfDzeFjIl6FIRHHmv ItV5efNx5kAxV+4fwzNUPak= X-Google-Smtp-Source: AH8x226PJrLB0FLCoI45B4hwNfD0IstD88mB1oVdkUPTTdqeXbXmcjAfIe69Z+lwwOeCMqEcuLgmtw== X-Received: by 10.98.141.199 with SMTP id p68mr6604022pfk.25.1516586724249; Sun, 21 Jan 2018 18:05:24 -0800 (PST) Received: from deepa-ubuntu.lan (c-67-170-212-194.hsd1.ca.comcast.net. [67.170.212.194]) by smtp.gmail.com with ESMTPSA id y79sm27168472pfb.177.2018.01.21.18.05.23 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 21 Jan 2018 18:05:23 -0800 (PST) From: Deepa Dinamani To: viro@zeniv.linux.org.uk, tytso@mit.edu, adilger.kernel@dilger.ca, linux-ext4@vger.kernel.org Cc: torvalds@linux-foundation.org, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, arnd@arndb.de, y2038@lists.linaro.org Subject: [PATCH v6 2/4] ext4: Initialize timestamps limits Date: Sun, 21 Jan 2018 18:04:24 -0800 Message-Id: <20180122020426.2988-3-deepa.kernel@gmail.com> X-Mailer: git-send-email 2.14.1 In-Reply-To: <20180122020426.2988-1-deepa.kernel@gmail.com> References: <20180122020426.2988-1-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 3241475a1733..fe4d7a168664 100644 --- a/fs/ext4/ext4.h +++ b/fs/ext4/ext4.h @@ -1602,6 +1602,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 S32_MAX +#define EXT4_TIMESTAMP_MIN S32_MIN + /* * Feature set definitions */ diff --git a/fs/ext4/super.c b/fs/ext4/super.c index 0843ebfeace1..7c2b227aa319 100644 --- a/fs/ext4/super.c +++ b/fs/ext4/super.c @@ -3768,8 +3768,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);