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
> SYNC).
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?
I umount/mount should enforce everything is written an consistent.
Grub could also use O_DIRECT if it didn't trust direct-block access
was going to be in sync. with the fs after a sync() call (which as you
say strictly speaking it need not be).
> And Grub relies on the filesystem keeping the block device in sync
> with the filesystem after a sync() call. That's a bug in both Grub
> and XFS but XFS isn't the one violating the spec, even though it's a
> bug.
If the filesystem is mounted, grub is doing something it can't rely
on. Grub could use O_DIRECT probably to work around this.
|