linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Anand Avati <avati@gluster.com>
To: Christoph Hellwig <hch@infradead.org>
Cc: <miklos@szeredi.hu>, <fuse-devel@lists.sourceforge.net>,
	<linux-fsdevel@vger.kernel.org>
Subject: Re: [PATCH v2 2/2] fuse: permit O_DIRECT flag in open()
Date: Thu, 28 Jul 2011 13:44:08 +0530	[thread overview]
Message-ID: <CALmMsH3ECdky8wu3LEd55SJL7fnxda74Y85Y8B7Tq-pVO+XL_g@mail.gmail.com> (raw)
In-Reply-To: <20110727210514.GD9066@infradead.org>

On Thu, Jul 28, 2011 at 2:35 AM, Christoph Hellwig <hch@infradead.org> 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@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

  reply	other threads:[~2011-07-28  8:14 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-07-27 10:56 [PATCH v2 1/2] vfs: pass 'struct file *' as parameter to ->check_flags() methods Anand Avati
     [not found] ` <1311764179-20326-1-git-send-email-avati-+FkPdpiNhgJBDgjK7y7TUQ@public.gmane.org>
2011-07-27 10:56   ` [PATCH v2 2/2] fuse: permit O_DIRECT flag in open() Anand Avati
2011-07-27 21:05     ` Christoph Hellwig
2011-07-28  8:14       ` Anand Avati [this message]
2011-07-28 11:49         ` Christoph Hellwig
2011-07-28 18:12           ` Anand Avati

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CALmMsH3ECdky8wu3LEd55SJL7fnxda74Y85Y8B7Tq-pVO+XL_g@mail.gmail.com \
    --to=avati@gluster.com \
    --cc=fuse-devel@lists.sourceforge.net \
    --cc=hch@infradead.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=miklos@szeredi.hu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).