From: Theodore Tso <tytso@MIT.EDU>
To: Tuomo Valkonen <tuomov@iki.fi>
Cc: linux-kernel@vger.kernel.org
Subject: Re: The ext3 way of journalling
Date: Sat, 12 Jan 2008 10:06:21 -0500 [thread overview]
Message-ID: <20080112150621.GC6751@mit.edu> (raw)
In-Reply-To: <20080110134111.GA6254@jolt.modeemi.cs.tut.fi>
On Thu, Jan 10, 2008 at 03:41:11PM +0200, Tuomo Valkonen wrote:
> On 2008-01-10 08:16 -0500, Theodore Tso wrote:
> > > It displays just the right time. On boot anyway. (Linux has had some
> > > serious problems keeping the time after the switch from 2.6.7 to 2.6.14,
> > > advanding even 15 minutes a day -- that ntpd doesn't seem to be able
> > > to keep up with -- requiring running adjtimexconfig every now and
> > > then for new settings. But the cmos clock displays the right time.)
> >
> > What do you mean by "on boot"? Which boot message, precisely? Is the
> > time printed before or after e2fsck is run, and by which program?
>
> The time is right as displayed by `date` after boot, i.e. after it has
> been loaded from the CMOS clock that does keep the (local, IIRC) time
> just allright. But then it often starts advancing very fast.
So running the "date" command after the boot sequence is completely
finished. That doesn't mean that system clock was correct at the time
when fsck is run.
See, here's the the problem. You have the CMOS hardware clock, which
for people who are dual-booting with Windows, is unfortunately ticking
local time, instead of GMT time (or if you want to be pedantic, UTC
time; whatever). When the kernel is first loaded and starts
executing, it will set the Linux system clock from the CMOS hardware
clock. However, it has *no* idea whether the CMOS hardware clock is
ticking localtime or UTC time. The Linux system clock (i.e., what is
returned via the gettimeofday() or time() functions) is always UTC
time.
What happens later is that distribution init scripts will adjust the
system clock either forward or backwards if the system is set up so
that hardware is in Windows bug-compatibility mode where the CMOS
hwclock is ticking localtime. If it is 1400 GMT, then in the
US/Eastern timezone, the clock will be 9:00am, so the clock will be
pushed four hours later. If you are in the Central European Timezone,
then the local time will be 3pm, and the clock will be pushed
*backwards* by one hour.
The question is when does this happen. In some buggy distributions,
this happens *after* e2fsck is run. And it is in those distributions
e2fsck can sometimes get confused about when the last time the
filesystem was checked --- especially if the system is getting
rebooted a lot (which tends to be the case with people who are
dual-booting). So the cases where this happens a lot are (a) people
who are using windows and so the CMOS hwclock is ticking localtime,
(b) distributions that don't adjust the Linux system clock before
e2fsck runs. Unfortunately Ubuntu users in Europe fit this
demographic hugely, and Ubuntu refuses to fix this problem[1], so it's
been personally very vexing, because the users complain to *me*, and I
can't fix the problem, because it's a distribution init script issue.
So what I tell people is to upgrade to the latest e2fsprogs, and then
set in /etc/e2fsck.conf:
[options]
buggy_init_scripts = 1
Maybe someday Ubuntu will get this right --- but I'm not counting on it.
[1] Something about installer CD's, and not wanting to ask the users
any questions, not even what time zone they are in, or some other
crazyness. I never completely understood the argument and their
design constraints.
- Ted
P.S. If there are other scripts which are started, they can also get
confused because the time is getting warped backwards early-on. I
haven't done an analysis to find out which sort programs might be
vulnerable to this, but this is not necessarily an e2fsck-specific
problems. After all, it *is* reasonable to expect that the time
returned by time(0) or gettimeofday() is correct, and many programs do
make that assumption....
next prev parent reply other threads:[~2008-01-12 15:06 UTC|newest]
Thread overview: 83+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-01-08 16:07 The ext3 way of journalling Tuomo Valkonen
2008-01-08 16:35 ` Jan Engelhardt
2008-01-08 16:52 ` Tuomo Valkonen
2008-01-08 17:18 ` Jan Engelhardt
2008-01-08 17:48 ` Tuomo Valkonen
2008-01-08 18:20 ` Jan Engelhardt
2008-01-08 18:32 ` Diego Calleja
2008-01-08 18:42 ` Tuomo Valkonen
2008-01-08 16:39 ` John Stoffel
2008-01-08 16:59 ` Tuomo Valkonen
2008-01-08 21:49 ` John Stoffel
2008-01-09 13:39 ` Mathieu SEGAUD
2008-01-09 14:16 ` Tuomo Valkonen
2008-01-10 13:16 ` Theodore Tso
2008-01-10 13:41 ` Tuomo Valkonen
2008-01-12 15:06 ` Theodore Tso [this message]
2008-01-12 19:24 ` Andrey Vul
2008-01-13 22:13 ` Tuomo Valkonen
2008-01-13 22:23 ` Tuomo Valkonen
2008-01-13 23:11 ` Theodore Tso
2008-01-14 7:15 ` Tuomo Valkonen
2008-01-14 9:42 ` Bernd Petrovitsch
2008-01-14 9:48 ` Tuomo Valkonen
2008-01-14 9:57 ` Bernd Petrovitsch
2008-01-14 10:44 ` Christer Weinigel
2008-01-14 11:11 ` Tuomo Valkonen
2008-01-14 11:18 ` Bernd Petrovitsch
2008-01-14 11:27 ` Tuomo Valkonen
2008-01-14 10:06 ` Krzysztof Halasa
2008-01-14 11:03 ` Tuomo Valkonen
2008-01-14 12:46 ` Krzysztof Halasa
2008-01-14 16:18 ` Lennart Sorensen
2008-01-14 23:13 ` Alejandro Riveira Fernández
2008-01-15 16:31 ` Lennart Sorensen
2008-01-15 1:09 ` Krzysztof Halasa
2008-01-15 16:32 ` Lennart Sorensen
2008-01-14 16:10 ` me
2008-01-14 16:17 ` Tuomo Valkonen
2008-01-14 22:39 ` John Hubbard
2008-01-14 0:36 ` Bernd Eckenfels
2008-01-08 16:48 ` Andre Noll
2008-01-08 17:52 ` Tuomo Valkonen
2008-01-08 18:07 ` Masoud Sharbiani "مسعود شربیانی"
2008-01-08 18:16 ` Tuomo Valkonen
2008-01-08 18:22 ` Alan Cox
2008-01-08 18:11 ` Jan Engelhardt
2008-01-08 18:20 ` Tuomo Valkonen
2008-01-08 18:29 ` Andre Noll
2008-01-08 18:40 ` Tuomo Valkonen
2008-01-08 18:47 ` Alan Cox
2008-01-08 23:06 ` Matthias Schniedermeyer
2008-01-09 7:56 ` Tuomo Valkonen
2008-01-09 10:21 ` Matthias Schniedermeyer
2008-01-09 10:28 ` Matthias Schniedermeyer
2008-01-09 12:30 ` Theodore Tso
2008-01-10 11:30 ` Helge Hafting
2008-01-10 14:02 ` Lennart Sorensen
2008-01-10 14:41 ` Matthias Schniedermeyer
2008-01-09 2:05 ` Bernd Petrovitsch
2008-01-08 16:53 ` Andi Kleen
2008-01-08 17:01 ` Tuomo Valkonen
2008-01-08 18:15 ` Theodore Tso
2008-01-08 20:51 ` Andi Kleen
2008-01-08 21:03 ` Ondrej Zary
2008-01-08 21:57 ` Theodore Tso
2008-01-09 3:21 ` Kyle Moffett
2008-01-09 7:55 ` Valdis.Kletnieks
2008-01-09 12:49 ` Theodore Tso
2008-01-09 8:00 ` BuraphaLinux Server
2008-01-09 8:21 ` Valdis.Kletnieks
2008-01-09 9:54 ` Martin Schwidefsky
2008-01-09 12:25 ` Theodore Tso
2008-01-09 12:44 ` Michal Schmidt
2008-01-09 13:53 ` Martin Schwidefsky
2008-01-09 19:47 ` Martin Schwidefsky
2008-01-08 21:32 ` Pavel Machek
2008-02-08 4:16 ` Rogelio Serrano
[not found] <9JpbI-5yi-9@gated-at.bofh.it>
[not found] ` <9JpEP-6df-25@gated-at.bofh.it>
[not found] ` <9JpYc-6Eb-13@gated-at.bofh.it>
[not found] ` <9Jqhr-7l9-13@gated-at.bofh.it>
[not found] ` <9JqKt-7Z5-9@gated-at.bofh.it>
2008-01-08 22:24 ` Bodo Eggert
[not found] ` <9Jqri-7ym-17@gated-at.bofh.it>
[not found] ` <9JqUn-8bF-15@gated-at.bofh.it>
[not found] ` <9JvKj-85h-41@gated-at.bofh.it>
2008-01-11 16:22 ` Bodo Eggert
2008-01-11 18:39 ` Lennart Sorensen
2008-01-12 1:41 ` Bodo Eggert
2008-01-12 7:10 ` TimC
2008-01-12 10:08 ` Matthias Schniedermeyer
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=20080112150621.GC6751@mit.edu \
--to=tytso@mit.edu \
--cc=linux-kernel@vger.kernel.org \
--cc=tuomov@iki.fi \
/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 NNTP newsgroup(s).