[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:26:59 +0100
Cc: "IKARASHI, Seiichi" <ikarashi@xxxxxxxxxxxxxxxx>, linux-xfs@xxxxxxxxxxx
In-reply-to: <20040325132200.GA12333@xxxxxxxxxxxxxxxxxxxxxxx>
References: <4060F7FC.8090602@xxxxxxxxxxxxxxxx> <20040325063902.GA9697@xxxxxxxxxxxxxxxxxxxxxxx> <4062C97A.6030702@xxxxxxxxxxxxxxxx> <20040325124152.GA12078@xxxxxxxxxxxxxxxxxxxxxxx> <4062D7E5.6070501@xxxxxxxxxx> <20040325132200.GA12333@xxxxxxxxxxxxxxxxxxxxxxx>
Sender: linux-xfs-bounce@xxxxxxxxxxx
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7b) Gecko/20040316

>>Grub does it as a workaround.
> It's stupid.  How does sync() multiple times in secession work better
> than once?

I never claimed it was smart :)

>>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?


> I umount/mount should enforce everything is written an consistent.

It does, but you can't unmount and then mount the filesystem if you
don't have a seperate /boot partition.

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

Yup. I'd need to check up if O_DIRECT is supported in the XFS I run.

>>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
> If the filesystem is mounted, grub is doing something it can't rely
> on.  Grub could use O_DIRECT probably to work around this.

Yup. My sentiments exactly. I'll have a look into it and see if
I can't get it to work that way - at least it would work for a few
more cases (those where O_DIRECT is supported).

// Stefan

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