From: Antonio SJ Musumeci <trapexit@spawn.link>
To: "Christian Kohlschütter" <christian@kohlschutter.com>,
"Miklos Szeredi" <miklos@szeredi.hu>
Cc: Linus Torvalds <torvalds@linux-foundation.org>,
overlayfs <linux-unionfs@vger.kernel.org>,
linux-kernel <linux-kernel@vger.kernel.org>,
linux-fsdevel@vger.kernel.org
Subject: Re: [PATCH] [REGRESSION] ovl: Handle ENOSYS when fileattr support is missing in lower/upper fs
Date: Mon, 18 Jul 2022 11:02:08 -0400 [thread overview]
Message-ID: <0e2af067-6b11-8e61-84c2-c9df25596ffe@spawn.link> (raw)
In-Reply-To: <0B8DA307-7E1F-4534-B864-BC2632740C89@kohlschutter.com>
On 7/18/22 10:25, Christian Kohlschütter wrote:
>> Am 18.07.2022 um 15:13 schrieb Miklos Szeredi <miklos@szeredi.hu>:
>>
>> On Mon, 18 Jul 2022 at 15:03, Christian Kohlschütter
>> <christian@kohlschutter.com> wrote:
>>> Am 18.07.2022 um 14:21 schrieb Miklos Szeredi <miklos@szeredi.hu>:
>>>> On Mon, 18 Jul 2022 at 12:56, Christian Kohlschütter
>>>> <christian@kohlschutter.com> wrote:
>>>>
>>>>> However, users of fuse that have no business with overlayfs suddenly see their ioctl return ENOTTY instead of ENOSYS.
>>>> And returning ENOTTY is the correct behavior. See this comment in
>>>> <asm-generic/errrno.h>:
>>>>
>>>> /*
>>>> * This error code is special: arch syscall entry code will return
>>>> * -ENOSYS if users try to call a syscall that doesn't exist. To keep
>>>> * failures of syscalls that really do exist distinguishable from
>>>> * failures due to attempts to use a nonexistent syscall, syscall
>>>> * implementations should refrain from returning -ENOSYS.
>>>> */
>>>> #define ENOSYS 38 /* Invalid system call number */
>>>>
>>>> Thanks,
>>>> Miklos
>>> That ship is sailed since ENOSYS was returned to user-space for the first time.
>>>
>>> It reminds me a bit of Linus' "we do not break userspace" email from 2012 [1, 2], where Linus wrote:
>>>> Applications *do* care about error return values. There's no way in
>>>> hell you can willy-nilly just change them. And if you do change them,
>>>> and applications break, there is no way in hell you can then blame the
>>>> application.
>> Correct. The question is whether any application would break in this
>> case. I think not, but you are free to prove otherwise.
>>
>> Thanks,
>> Miklos
> I'm not going to do that since I expect any answer I give would not change your position here. All I know is there is a non-zero chance such programs exist.
>
> If you're willing to go ahead with the fuse change you proposed, I see no purpose in debating with you further since you're the kernel maintainer of both file systems.
> That change "fixes" the problem that I had seen in my setup; I do not know the extent of side effects, but I expect some could surface eventually.
>
> Once you're done fixing fuse, please also talk to the folks over at https://github.com/trapexit/mergerfs who explicitly return ENOSYS upon request. Who knows, maybe someone is audacious enough to try mergerfs as a lower filesystem for overlay?
>
> Alas, I think this a clash between the philosophies of writing robust code versus writing against a personal interpretation of some specification.
> You refer to "asm-generic/errno.h" as the specification and rationale for treating ENOSYS as sacrosanct. Note that the comment says "should refrain from", it doesn't say "must not", and that's why we're in this mess.
>
> It therefore wouldn't hurt to be lenient when a lower filesystem returns an error code known to refer to "unsupported operation", and that's what my original patch to ovl does.
>
> I thought this approach would resonate with you, since you must have been following the same logic when you added the special-case check for "EINVAL" as an exception for ntfs-3g in the commit that most likely triggered the regression ("ovl: fix filattr copy-up failure") 9 months ago.
>
> I honestly wonder why you're risking further breakage, having introduced that regression only recently.
>
> So long,
> Christian
Author of mergerfs here. What are you referring to exactly? It's
possible I'm forgetting something but I should only be returning ENOSYS
in similar cases to libfuse where some function is not supported or when
wishing to disable xattr calls.
next prev parent reply other threads:[~2022-07-18 15:03 UTC|newest]
Thread overview: 28+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-07-04 18:36 [PATCH] ovl: Handle ENOSYS when fileattr support is missing in lower/upper fs Christian Kohlschütter
2022-07-18 9:14 ` Miklos Szeredi
2022-07-18 10:10 ` Christian Kohlschütter
2022-07-18 10:31 ` Miklos Szeredi
2022-07-18 10:56 ` Christian Kohlschütter
2022-07-18 12:21 ` Miklos Szeredi
2022-07-18 13:03 ` [PATCH] [REGRESSION] " Christian Kohlschütter
2022-07-18 13:13 ` Miklos Szeredi
2022-07-18 14:25 ` Christian Kohlschütter
2022-07-18 15:02 ` Antonio SJ Musumeci [this message]
2022-07-18 17:23 ` Miklos Szeredi
2022-07-18 18:29 ` Linus Torvalds
2022-07-18 19:04 ` Christian Kohlschütter
2022-07-18 19:17 ` Linus Torvalds
2022-07-18 19:27 ` Miklos Szeredi
2022-07-18 20:12 ` Linus Torvalds
2022-07-18 20:33 ` Christian Kohlschütter
2023-01-18 3:41 ` Jonathan Katz
2023-01-26 13:26 ` Miklos Szeredi
2023-01-30 19:27 ` Jonathan Katz
2023-02-23 23:11 ` Jonathan Katz
2023-03-07 1:12 ` Jonathan Katz
2023-03-07 8:38 ` Miklos Szeredi
2023-03-07 17:14 ` Jonathan Katz
2023-03-09 15:31 ` Miklos Szeredi
2023-03-15 2:43 ` Jonathan Katz
2023-03-22 18:42 ` Jonathan Katz
2023-04-21 14:26 ` Miklos Szeredi
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=0e2af067-6b11-8e61-84c2-c9df25596ffe@spawn.link \
--to=trapexit@spawn.link \
--cc=christian@kohlschutter.com \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-unionfs@vger.kernel.org \
--cc=miklos@szeredi.hu \
--cc=torvalds@linux-foundation.org \
/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).