mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Christian Kohlschütter" <christian@kohlschutter.com>
To: Miklos Szeredi <miklos@szeredi.hu>, torvalds@linux-foundation.org
Cc: 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 15:03:52 +0200	[thread overview]
Message-ID: <A31096BA-C128-4D0B-B27D-C34560844ED0@kohlschutter.com> (raw)
In-Reply-To: <CAJfpeguDAJpLMABsomBFQ=w6Li0=sBW0bFyALv4EJrAmR2BkpQ@mail.gmail.com>

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.

(Adding Linus for clarification whether his statement is still true in 2022, and marking subject with regression tag for visibility.)

As far as I, a fuse user, understand, fuse uses ENOSYS as a specific marker to indicate permanent failure:

From libfuse https://libfuse.github.io/doxygen/structfuse__lowlevel__ops.html:
> If this request is answered with an error code of ENOSYS, this is treated as a permanent failure with error code EOPNOTSUPP, i.e. all future getxattr() requests will fail with EOPNOTSUPP without being send to the filesystem process.

(also see  https://man.openbsd.org/fuse_new.3)


Again, in summary:
1. I believe the fix should be in ovl, because ovl caused the regression.
2. Fixing in fuse would not be sufficient because other lower filesystems that also return ENOSYS remain affected (a cursory search indicates ecryptfs also returns ENOSYS).
3. Fixing in fuse would break user-space. We do not break userspace.

Cheers,
Christian



[1] https://lkml.org/lkml/2012/12/23/75
[2] https://lkml.org/lkml/2012/12/23/99

  reply	other threads:[~2022-07-18 13:04 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-07-04 18:36 [PATCH] " 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           ` Christian Kohlschütter [this message]
2022-07-18 13:13             ` [PATCH] [REGRESSION] " Miklos Szeredi
2022-07-18 14:25               ` Christian Kohlschütter
2022-07-18 15:02                 ` Antonio SJ Musumeci
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  1:51                                           ` Jonathan Katz
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=A31096BA-C128-4D0B-B27D-C34560844ED0@kohlschutter.com \
    --to=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

all inboxes | Powered by JetHome®