Received: with ECARTIS (v1.0.0; list linux-xfs); Thu, 25 Mar 2004 05:22:04 -0800 (PST) Received: from dingdong.cryptoapps.com (postfix@uslink-66.173.43-133.uslink.net [66.173.43.133] (may be forged)) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i2PDM0KO027280 for ; Thu, 25 Mar 2004 05:22:01 -0800 Received: by dingdong.cryptoapps.com (Postfix, from userid 1001) id 1FF02FB839; Thu, 25 Mar 2004 07:22:00 -0600 (CST) Date: Thu, 25 Mar 2004 05:22:00 -0800 From: Chris Wedgwood To: Stefan Smietanowski Cc: "IKARASHI, Seiichi" , linux-xfs@oss.sgi.com Subject: Re: synchronization of XFS Message-ID: <20040325132200.GA12333@dingdong.cryptoapps.com> References: <4060F7FC.8090602@miraclelinux.com> <20040325063902.GA9697@dingdong.cryptoapps.com> <4062C97A.6030702@miraclelinux.com> <20040325124152.GA12078@dingdong.cryptoapps.com> <4062D7E5.6070501@stesmi.com> Mime-Version: 1.0 Content-type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4062D7E5.6070501@stesmi.com> Content-Transfer-Encoding: 8bit X-archive-position: 2589 X-ecartis-version: Ecartis v1.0.0 Sender: linux-xfs-bounce@oss.sgi.com Errors-to: linux-xfs-bounce@oss.sgi.com X-original-sender: cw@f00f.org Precedence: bulk X-list: linux-xfs Content-Length: 1238 Lines: 31 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.