Stable Archive mirror
 help / color / mirror / Atom feed
From: "Arnd Bergmann" <arnd@arndb.de>
To: "Bibo Mao" <maobibo@loongson.cn>,
	"Huacai Chen" <chenhuacai@loongson.cn>,
	"Huacai Chen" <chenhuacai@kernel.org>
Cc: loongarch@lists.linux.dev,
	Linux-Arch <linux-arch@vger.kernel.org>,
	"Xuefeng Li" <lixuefeng@loongson.cn>, guoren <guoren@kernel.org>,
	"WANG Xuerui" <kernel@xen0n.name>,
	"Jiaxun Yang" <jiaxun.yang@flygoat.com>,
	linux-kernel@vger.kernel.org, loongson-kernel@lists.loongnix.cn,
	stable@vger.kernel.org
Subject: Re: [PATCH] LoongArch: Define __ARCH_WANT_NEW_STAT in unistd.h
Date: Wed, 15 May 2024 14:25:28 +0000	[thread overview]
Message-ID: <ebf493ee-1e8b-426d-bcf4-d8e17d10844a@app.fastmail.com> (raw)
In-Reply-To: <3937d6b1-119b-195e-8b9b-314a0bfbeaeb@loongson.cn>

On Wed, May 15, 2024, at 09:30, maobibo wrote:
> On 2024/5/11 下午8:17, Arnd Bergmann wrote:
>> On Sat, May 11, 2024, at 12:01, Huacai Chen wrote:
>> 
>> Importantly, we can't just add fstatat64() on riscv32 because
>> there is no time64 version for it other than statx(), and I don't
>> want the architectures to diverge more than necessary.
> yes, I agree. Normally there is newfstatat() on 64-bit architectures but 
> fstatat64() on 32-bit ones.
>
> I do not understand why fstatat64() can be added for riscv32 still.
> 32bit timestamp seems works well for the present, it is valid until
> (0x1UL << 32) / 365 / 24 / 3600 + 1970 == 2106 year. Year 2106 should
> be enough for 32bit system.

There is a very small number of interfaces for which we ended up
not using a 64-bit time_t replacement, but those are only for
relative times, not epoch based offsets. The main problems
here are:

- time_t is defined to be a signed value in posix, and we need
  to handle file timestamps before 1970 in stat(), so changing
  this one to be unsigned is not an option.

- A lot of products have already shipped that will have to
  be supported past 2038 on existing 32-bit hardware. We
  cannot regress on architectures that have already been
  fixed to support this. 

- file timestamps can also be set into the future, so applications
  relying on this are broken before 2038.

      Arnd

  reply	other threads:[~2024-05-15 14:25 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-05-11 10:01 [PATCH] LoongArch: Define __ARCH_WANT_NEW_STAT in unistd.h Huacai Chen
2024-05-11 12:17 ` Arnd Bergmann
2024-05-11 14:28   ` Huacai Chen
2024-05-11 15:38     ` Arnd Bergmann
2024-05-12  3:11       ` Huacai Chen
2024-05-12  7:52         ` Arnd Bergmann
2024-05-15  9:30   ` maobibo
2024-05-15 14:25     ` Arnd Bergmann [this message]
2024-05-16  2:52       ` maobibo

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ebf493ee-1e8b-426d-bcf4-d8e17d10844a@app.fastmail.com \
    --to=arnd@arndb.de \
    --cc=chenhuacai@kernel.org \
    --cc=chenhuacai@loongson.cn \
    --cc=guoren@kernel.org \
    --cc=jiaxun.yang@flygoat.com \
    --cc=kernel@xen0n.name \
    --cc=linux-arch@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lixuefeng@loongson.cn \
    --cc=loongarch@lists.linux.dev \
    --cc=loongson-kernel@lists.loongnix.cn \
    --cc=maobibo@loongson.cn \
    --cc=stable@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).