xenblk: Add O_DIRECT and O_SYNC support.
A message that is not in the archive (sent off-list or not yet received): [email protected]
Quoted 12 lines · Jens Axboe
Quoted 11 lines
Quoted 3 lines
However, frontend driver could not got the write's flag at all. if we could know the request with
O_SYNCflag should be easy to handle, need not touch filesystem layer.So what does
O_SYNCmean 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? IfO_SYNCis not waiting for completion responses from the block layer, that's a limitation of Linux's generic block subsystem, isn't it?
Quoted 7 lines
The block layer doesn't care, it's async by nature. What makes
O_SYNCwork 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