Re: Bug in fat-fs code: file date/time wrong

Peter Samuelson (peter@wire.cadcamlab.org)
Mon, 15 Nov 1999 02:43:36 -0600 (CST)


[Joe Zbiciak]
> This illustrates the power of a GMT-based system.

No argument here. Why do you think I have been using the term "legacy
system"? (:

> This works for updating timestamps. It does not work for reading
> timestamps that were updated when the time offset was different than
> it currently is now.

I realize, but it's a relatively painless solution compared to either
(a) calculating DST in the kernel or (b) adding fields to the stat
structure for userspace to play with or (c) hacking userspace to look
at mount points and know about non-timezoned filesystems. Oh yeah, how
about (d) hack your legacy system, somehow, to store dates as UTC.
Actually there's also (e) use only mtools and skip the kernel FAT
(mtools gets all this right already).

> > I do not know whether FAT already has this behavior on Linux. My
> > system's FAT seems to report times in UTC but I don't know if
> > there's a way to add the "local" offset I describe above.

> From what I understand, FAT stores dates in local time. If you do
> not set a timezone at boot, then local time is GMT/UTC.

So where does the kernel FAT code get its timezone from? hwclock?

> > > For instance, if I create a file while DST is active, and then I
> > > look at it when DST is inactive, I should see the same time-stamp
> > > as I did back when DST was active, not an hour different.
> > With my scheme, you won't (which is why I noted that it would break
> > normal Unix semantics), but at least the file will have been stored
> > the same way on disk as it would have been in your legacy system.
> Essentially, one-way interoperability: I can send data to the legacy
> systems that the legacy systems interpret correctly, but the data I
> see is not quite 100% correct.

Yeah.

> > If you want complete interoperability, you will need to define a
> > non-DST-able time zone and manually change it twice a year.
> Ick. That'll break all the native Unix stuff. Now the file I
> created during DST on the ext2 partition will show a different time
> when I'm not in DST.

This is true. Which of the five alternate solutions I listed above
appeals to you the most? I don't like any of them except (e). Or do
you have a sixth?

-- 
Peter Samuelson
<sampo.creighton.edu!psamuels>

- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu Please read the FAQ at http://www.tux.org/lkml/