From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-0.8 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id C0F4CC433FF for ; Wed, 31 Jul 2019 00:48:53 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 9E31720665 for ; Wed, 31 Jul 2019 00:48:53 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726422AbfGaAsw (ORCPT ); Tue, 30 Jul 2019 20:48:52 -0400 Received: from mail.parknet.co.jp ([210.171.160.6]:55550 "EHLO mail.parknet.co.jp" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726369AbfGaAsw (ORCPT ); Tue, 30 Jul 2019 20:48:52 -0400 Received: from ibmpc.myhome.or.jp (server.parknet.ne.jp [210.171.168.39]) by mail.parknet.co.jp (Postfix) with ESMTPSA id 3B5A815F925; Wed, 31 Jul 2019 09:48:51 +0900 (JST) Received: from devron.myhome.or.jp (foobar@devron.myhome.or.jp [192.168.0.3]) by ibmpc.myhome.or.jp (8.15.2/8.15.2/Debian-12) with ESMTPS id x6V0mnIT008251 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT); Wed, 31 Jul 2019 09:48:51 +0900 Received: from devron.myhome.or.jp (foobar@localhost [127.0.0.1]) by devron.myhome.or.jp (8.15.2/8.15.2/Debian-12) with ESMTPS id x6V0mnSu010060 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT); Wed, 31 Jul 2019 09:48:49 +0900 Received: (from hirofumi@localhost) by devron.myhome.or.jp (8.15.2/8.15.2/Submit) id x6V0mnvJ010059; Wed, 31 Jul 2019 09:48:49 +0900 From: OGAWA Hirofumi To: Deepa Dinamani Cc: Alexander Viro , Linux Kernel Mailing List , Linux FS-devel Mailing List , Arnd Bergmann , y2038 Mailman List Subject: Re: [PATCH 12/20] fs: fat: Initialize filesystem timestamp ranges References: <20190730014924.2193-1-deepa.kernel@gmail.com> <20190730014924.2193-13-deepa.kernel@gmail.com> <878ssfc1id.fsf@mail.parknet.co.jp> Date: Wed, 31 Jul 2019 09:48:49 +0900 In-Reply-To: (Deepa Dinamani's message of "Tue, 30 Jul 2019 10:39:41 -0700") Message-ID: <874l33av0u.fsf@mail.parknet.co.jp> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Deepa Dinamani writes: >> At least, it is wrong to call fat_time_fat2unix() before setup parameters >> in sbi. > > All the parameters that fat_time_fat2unix() cares in sbi is accessed through > > static inline int fat_tz_offset(struct msdos_sb_info *sbi) > { > return (sbi->options.tz_set ? > -sbi->options.time_offset : > sys_tz.tz_minuteswest) * SECS_PER_MIN; > } > > Both the sbi fields sbi->options.tz_set and sbi->options.time_offset > are set by the call to parse_options(). And, parse_options() is called > before the calls to fat_time_fat2unix().: > > int fat_fill_super(struct super_block *sb, void *data, int silent, int isvfat, > void (*setup)(struct super_block *)) > { > > > error = parse_options(sb, data, isvfat, silent, &debug, &sbi->options); > if (error) > goto out_fail; > > > > sbi->prev_free = FAT_START_ENT; > sb->s_maxbytes = 0xffffffff; > fat_time_fat2unix(sbi, &ts, 0, cpu_to_le16(FAT_DATE_MIN), 0); > sb->s_time_min = ts.tv_sec; > > fat_time_fat2unix(sbi, &ts, cpu_to_le16(FAT_TIME_MAX), > cpu_to_le16(FAT_DATE_MAX), 0); > sb->s_time_max = ts.tv_sec; > > > } > > I do not see what the problem is. Ouch, you are right. I was reading that patch wrongly, sorry. Thanks. -- OGAWA Hirofumi