bug-grub
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Double sync required on ext3, Linux 2.4.x


From: Pavel Roskin
Subject: Re: Double sync required on ext3, Linux 2.4.x
Date: Mon, 11 Feb 2002 15:42:12 -0500 (EST)

Hi, Erich!

> This patch you have is in general insufficient to fix this problem.
> 
> The problem is that journaled filesystems (ext3 & XFS both showed
> this problem in different ways) return from "sync" before the metadata
> has settled down, as their journal is considered stable storage.

However, the second sync() immediately after the first sync fixes the
problem on ext3.  I mean, I could not reproduce any errors if double sync
is used.  I believe that the data is marked by sync() somehow so that
another sync() doesn't return until that "marked" data is written to the
disk.

I haven't tried XFS.

> I had a run-around with this on the list a few months ago now, and
> have a partial patch that fixes it somewhat and tests to make sure
> it is correct/retries appropriately without failing with an error.
> 
> I'm currently working on finishing my patch and testing it (it was
> on my list of items to finish for 0.92).

Feel free to use me as beta tester.

I tried to guess what your patch does and found the following 
possibilites:

1) No direct file access under OS.  Should be the safest and the most
portable solution.

2) Force the OS to flush the files needed by GRUB and the metadata
required to access them (i.e. the directories above those files).

3) Flush the whole filesystem by doing some "real sync".

4) Add support for the journal.  This would make it possible to access at
boot the files that were not completely written (i.e. restore their
metadata from the journal).  This code is probably so much fun to write
and to boast about, but it would add extra bloat to stage2 that would only
be helpful in really bad situations (the system must have died immediately
after running grub-install).

-- 
Regards,
Pavel Roskin




reply via email to

[Prev in Thread] Current Thread [Next in Thread]