[systemd-bugs] [Bug 81538] Allow to disable setting the kernel time zone

bugzilla-daemon at freedesktop.org bugzilla-daemon at freedesktop.org
Sat Jul 19 09:40:30 PDT 2014


https://bugs.freedesktop.org/show_bug.cgi?id=81538

--- Comment #2 from Nicolas George <george at nsup.org> ---
I believe you are mistaken on how the kernel timezone works.

The kernel does not have a zoneinfo database. Therefore, it can not take
daylight saving time (DST) into account.

The offset the kernel applies to timestamps on legacy filesystems is constant,
it is the offset corresponding to the instant the kernel timezone was set. As a
consequence, the timestamps of the files created near that time are valid, but
the timestamps of the files modified on the other side of the DST will be off
by one hour.

For example, I am currently in CEST and my kernel booted this morning, that
makes it at +0200. Files modified sometime between November and March would be
in CET, not CEST, at +0100, but the kernel does not know that: therefore, their
timestamps will appear off by one hour. Conversely, files that I modify today
will appear off by one hour in the other direction if I mount them in six
months.

The short of it is that it is NOT POSSIBLE to store timestamps in local time if
there is no timezone indication (if only because the local time - UTC
conversion is not a bijection), and it is EVEN LESS POSSIBLE without a zoneinfo
database. Nobody serious would want a zoneinfo database in the kernel.

The current system produces usually correct timestamps for files created
recently, and older files arguably do not need so much accuracy. This is
probably good enough for most people, but not for people who actually use the
timestamps, and not for me.

When living in a place with DST, the only reasonable thing to do is to store
the timestamps in UTC. The conversion will happen in userspace, exactly as it
happens for ext4 for example. That works perfectly (as long as the files are
not modified on another OS; the Linux community can do nothing about that).

Selecting that option at each mount is error prone and not convenient, better
to do it globally.

(For reference, I use the timestamps to synchronize a collection of files on an
Android phone; due to Android, I can not use a better filesystem, but the
timestamps are only used on systems that consider them UTC.)

-- 
You are receiving this mail because:
You are the QA Contact for the bug.
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/systemd-bugs/attachments/20140719/c7b459ee/attachment-0001.html>


More information about the systemd-bugs mailing list