Chris Wedgwood wrote:
> On Thu, Mar 25, 2004 at 02:00:21PM +0100, Stefan Smietanowski wrote:
>>Grub does it as a workaround.
> It's stupid. How does sync() multiple times in secession work better
> than once?
>>Happens with current tree I can tell you that me and .. Steve I
>>think discussed it on IRC a while back and he looked into the POSIX
>>spec and according to POSIX a filesystem does not have to keep the
>>block device the same as the filesystem after a sync() (or mounting
> Well, not to split hair, sync() means all data needs to hit the disk.
> Accessing it via a bock device for a mounted filesystem will cause bad
> stuff --- is this what grub does?
sync means the filesystem will look the same after a crash, it does
not mean all the data has to hit the disk. In the case of XFS it
does not really mean this. Sync will make sure that the journal
is upto date on disk, so the metadata can be recovered after a
crash. Making sync push all the metadata itself would slow it
Now if grub is opening the block device and reading out of that,
it is looking at the same pages for metadata that xfs is looking
at in memory. There is a bug where you can get corruption if you
access the block device in parallel with the filesystem. Possibly
this is behind the problem.
Christoph has been looking into fixing this.
Does grub just read from the block device, or does it do writes
too? Writes directly in via the block device could really confuse