Re: [PATCH v10 09/14] exfat: add misc operations

From: Pali RohÃr
Date: Thu Jan 16 2020 - 11:00:56 EST


On Thursday 16 January 2020 11:23:07 Christoph Hellwig wrote:
> On Thu, Jan 16, 2020 at 11:19:47AM +0100, Pali RohÃr wrote:
> > However, implementations should only record the value 00h for this
> > field when:
> >
> > 1. Local date and time are actually the same as UTC, in which case
> > the value of the OffsetValid field shall be 1
> >
> > 2. Local date and time are not known, in which case the value of the
> > OffsetValid field shall be 1 and implementations shall consider
> > UTC to be local date and time
>
> Given time zones in Linux are per session I think our situation is
> somewhat similar to 2.

Seems that 2. is really similar. Ok, storing by default in UTC make
sense, but still I'm thinking if there should be (or not) a mount option
which override default UTC timezone.

> > > Here I would just convert to UTC, which is what we store in the
> > > in-memory struct inode anyway.
> >
> > Ok. If inode timestamp is always in UTC, we should do same thing also
> > for exFAT.
>
> > Hm... both UTC and sys_tz have positives and negatives. And I'm not
> > sure which option is better.
>
> The one big argument for always UTC is simplicity. Always using UTC
> kills some arcane an unusual (for Linux file systems) code, and given
> how exfat implementations deal with the time zone on reading should
> always interoperate fine with other implementations.

Now I think that using UTC by default is the better option as sys_tz.
Simplicity and "no surprise" (container may use UTC, but kernel has
sys_tz in not in UTC) seems like a good arguments.

--
Pali RohÃr
pali.rohar@xxxxxxxxx