[Top] [All Lists]

Re: synchronization of XFS

To: Chris Wedgwood <cw@xxxxxxxx>
Subject: Re: synchronization of XFS
From: Stefan Smietanowski <stesmi@xxxxxxxxxx>
Date: Thu, 25 Mar 2004 14:00:21 +0100
Cc: "IKARASHI, Seiichi" <ikarashi@xxxxxxxxxxxxxxxx>, linux-xfs@xxxxxxxxxxx
In-reply-to: <20040325124152.GA12078@xxxxxxxxxxxxxxxxxxxxxxx>
References: <4060F7FC.8090602@xxxxxxxxxxxxxxxx> <20040325063902.GA9697@xxxxxxxxxxxxxxxxxxxxxxx> <4062C97A.6030702@xxxxxxxxxxxxxxxx> <20040325124152.GA12078@xxxxxxxxxxxxxxxxxxxxxxx>
Sender: linux-xfs-bounce@xxxxxxxxxxx
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7b) Gecko/20040316

>>Firstly anaconda executes "grub-install --just-copy", and executes
>>sync() three times.
> grub is braindead then.  Calling sync() once should suffice.

Grub does it as a workaround.

>>Then anaconda runs "grub --batch" to really install grub into MBR of
>>the disk, but grub cannot find files which should have been already
>>written in the partition by sync().
> That sounds like something else.  sync() ensures dirty buffers are
> on-disk.  Even if you don't sync() you can still read-back using the
> buffer-cache/page-cache.

Or.. Should.

>>When I put 1 minutes of sleep() next to sync(), grub finds those
>>files and is installed successfully.
> I'm not sure I follow, but I'n not convinced it's XFS failing to
> sync() to disk unless it's a really old tree.

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).

In the case of XFS it _should_ but doesn't but it's not violating
any specs.

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.

// Stefan

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