linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Nikolaus Rath <Nikolaus@rath.org>
To: Mike Marshall <hubcap@omnibond.com>
Cc: Miklos Szeredi <mszeredi@redhat.com>,
	Andrew Gallagher <andrewjcg@fb.com>,
	lkml <linux-kernel@vger.kernel.org>,
	linux-fsdevel <linux-fsdevel@vger.kernel.org>
Subject: Re: commit d7afaec0b564f0609e116f5: fuse: add FUSE_NO_OPEN_SUPPORT flag to INIT
Date: Fri, 11 Nov 2016 09:27:20 -0800	[thread overview]
Message-ID: <87d1i2j5af.fsf@thinkpad.rath.org> (raw)
In-Reply-To: <CAOg9mSShK3mBHAv9WbiGhGTaPEczYwT--NHdtC+wP4xiCarNqg@mail.gmail.com> (Mike Marshall's message of "Fri, 11 Nov 2016 11:53:04 -0500")

On Nov 11 2016, Mike Marshall <hubcap@omnibond.com> wrote:
> On Fri, Nov 11, 2016 at 11:28 AM, Nikolaus Rath <Nikolaus@rath.org> wrote:
>> On Nov 11 2016, Miklos Szeredi <mszeredi@redhat.com> wrote:
>>> On Fri, Nov 11, 2016 at 5:57 AM, Nikolaus Rath <Nikolaus@rath.org> wrote:
>>>> On Nov 11 2016, Miklos Szeredi <mszeredi@redhat.com> wrote:
>>>>> On Thu, Nov 10, 2016 at 11:31 PM, Nikolaus Rath <Nikolaus@rath.org> wrote:
>>>>>> Hi Andrew,
>>>>>>
>>>>>> In commit d7afaec0b564f0609e116f5 you added a new FUSE_NO_OPEN_SUPPORT
>>>>>> flag. But as far as I can tell, the flag is simply accepted without
>>>>>> having any effect (including in libfuse).
>>>>>>
>>>>>> I tried to find related later commits, but did not find anything either.
>>>>>>
>>>>>> Am I missing something?
>>>>>
>>>>> Hmm, if fuse fs detects this flag, then it can return ENOSYS from open
>>>>> resulting in this and subsequent opens succeeding without further
>>>>> calls to userspace.    If fuse fs doesn't detect this flag, it should
>>>>> not return -ENOSYS, as that will result in the open failing, it should
>>>>> instead implement a no-op open method.
>>>>
>>>> That doesn't sound like a good approach to me. That way, the file system
>>>> has to *know* that this flag has been introduced in order to behave
>>>> correctly, i.e. filesystems that predate the introduction of the flag
>>>> will suddenly behave differently.
>>>>
>>>> I think the correct behavior would be to for the kernel to check if
>>>> userspace passed the flag, and treat ENOSYS specially if and only if the
>>>> flag was passed.
>>>
>>> ENOSYS is not a valid return value for any existing syscall.  Fuse
>>> uses that fact to attach this special meaning to ENOSYS.  So
>>> compatibility is not an issue here, old filesystems should never
>>> return ENOSYS from open.
>>
>> Oh, I was under the impression that any FUSE handler is free to return
>> any error it wants. Where does one have to look to determine which
>> return values are valid?
>>
> I try to choose error codes from the appropriate man
> page when vfs calls into Orangefs with
> whatever_operations.action... there's probably better
> ways, like reading the vfs code and seeing what it
> expects <g>...

Yeah, I'd expect most people to do that. But FUSE file systems are often
a little more exotic and produce error conditions that don't match well
with any of the codes documented in the manpages. If there is no good
fit, I'd expect that most people would (as I have done so far) simply
pick something more appropriate from errno(3). If some of these codes
are forbidden (or only a subset allowed) I'd really like to document
this. It's not reasonable to expect every libfuse user to start browsing
the Linux VFS code to determine if they can use a particular error code.


Best,
-Nikolaus

-- 
GPG encrypted emails preferred. Key id: 0xD113FCAC3C4E599F
Fingerprint: ED31 791B 2C5C 1613 AF38 8B8A D113 FCAC 3C4E 599F

             »Time flies like an arrow, fruit flies like a Banana.«

  reply	other threads:[~2016-11-11 17:27 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-11-10 22:31 commit d7afaec0b564f0609e116f5: fuse: add FUSE_NO_OPEN_SUPPORT flag to INIT Nikolaus Rath
2016-11-10 23:12 ` Miklos Szeredi
2016-11-11  4:57   ` Nikolaus Rath
2016-11-11  8:43     ` Miklos Szeredi
2016-11-11 16:28       ` Nikolaus Rath
2016-11-11 16:53         ` Mike Marshall
2016-11-11 17:27           ` Nikolaus Rath [this message]
2016-11-11 17:53             ` Mike Marshall
2016-11-15 15:50               ` Nikolaus Rath
2016-11-15 13:33             ` Miklos Szeredi
2016-11-15 15:53               ` Nikolaus Rath

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=87d1i2j5af.fsf@thinkpad.rath.org \
    --to=nikolaus@rath.org \
    --cc=andrewjcg@fb.com \
    --cc=hubcap@omnibond.com \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mszeredi@redhat.com \
    /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).