On Thu, Jul 28, 2011 at 2:35 AM, Christoph Hellwig <hch@xxxxxxxxxxxxx> wrote: > On Wed, Jul 27, 2011 at 03:56:19AM -0700, Anand Avati wrote: >> FUSE currently disallows O_DIRECT flag in open(). It is tricky dealing with >> setting/unsetting of O_DIRECT flag on an open file. There are applications >> (primarily VMs and databases) which open files with O_DIRECT flag. These >> applications do not work on FUSE due to this limitation. >> >> The approach with this patch is to permit opens with O_DIRECT, but instead >> disable setting/unsetting of the O_DIRECT flag no matter how the file was >> opened. This limitation is for more practical than disallowing O_DIRECT >> altogether. > > But it's also entirely incorrect. Fix your userspace to have a proper > fallback if O_DIRECT opens fail. It's a feature only supported by a few > filesystems, and very few operating systems. FUSE already has a direct IO implementation (struct file_operations fuse_direct_io_file_operation) but is currently set as a file's f_ops only based on flags returned from the filesystem server (in the reply of an open() call). This patch just lets the filesystem server know a userspace application's intention to open a file with O_DIRECT and leaves it with the decision to pick direct IO mode on the file (just the way it already does before the patch.) There is already a framework for direct IO operations and this patch only bridges O_DIRECT flag with that framework. Do you still think this is entirely incorrect? Avati -- To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html