From: Keir Fraser Subject: Re: [patch 0/6] xenblk: Add O_DIRECT and O_SYNC support. Date: Wed, 05 Nov 2008 09:43:18 +0000 Message-ID: References: <20081105093758.GI21867@kernel.dk> Mime-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <20081105093758.GI21867@kernel.dk> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: Jens Axboe Cc: Xen-Devel , Kurt Hackel , Greg Marsden , Joe Jin , Shinya Narahara , Wen Gang Wang List-Id: xen-devel@lists.xenproject.org On 5/11/08 09:37, "Jens Axboe" wrote: >>> However, frontend driver could not got the write's flag at all. >>> if we could know the request with O_SYNC flag should be easy to handle, >>> need not touch filesystem layer. >> >> So what does O_SYNC mean to Linux then? If it's not passed down to the >> blkdev layer then it can only mean that requests must be synchronously >> committed as far as that layer. I would therefore imagine you could lose as >> much data natively as you do running on Xen. Where are these megabytes of >> data sitting when they get lost, and why does it not happen when running >> natively? If O_SYNC is not waiting for completion responses from the block >> layer, that's a limitation of Linux's generic block subsystem, isn't it? > > The block layer doesn't care, it's async by nature. What makes O_SYNC > work is that callers will wait on the submitted writes afterwards, not > returning a result until they have reached the drive (that's as far as > that guarentee goes, beyond that you need flushes or barriers). > > So it is definitely NOT a limitation of the block layer, that's very > much how it is designed. The issue at hand is whether Xen's block drivers need to handle O_SYNC specially in any way. It sounds like it is actually handled properly at a higher level (e.g. individual filesystems?) and hence the patches proposed by Oracle make not much sense. -- Keir