[Top] [All Lists]

Re: synchronization of XFS

To: Stefan Smietanowski <stesmi@xxxxxxxxxx>
Subject: Re: synchronization of XFS
From: Chris Wedgwood <cw@xxxxxxxx>
Date: Thu, 25 Mar 2004 05:22:00 -0800
Cc: "IKARASHI, Seiichi" <ikarashi@xxxxxxxxxxxxxxxx>, linux-xfs@xxxxxxxxxxx
In-reply-to: <4062D7E5.6070501@xxxxxxxxxx>
References: <4060F7FC.8090602@xxxxxxxxxxxxxxxx> <20040325063902.GA9697@xxxxxxxxxxxxxxxxxxxxxxx> <4062C97A.6030702@xxxxxxxxxxxxxxxx> <20040325124152.GA12078@xxxxxxxxxxxxxxxxxxxxxxx> <4062D7E5.6070501@xxxxxxxxxx>
Sender: linux-xfs-bounce@xxxxxxxxxxx
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.

<Prev in Thread] Current Thread [Next in Thread>