linux/fs/fuse
Miklos Szeredi 02c0cab8e7 fuse: ioctl: translate ENOSYS
Overlayfs may fail to complete updates when a filesystem lacks
fileattr/xattr syscall support and responds with an ENOSYS error code,
resulting in an unexpected "Function not implemented" error.

This bug may occur with FUSE filesystems, such as davfs2.

Steps to reproduce:

  # install davfs2, e.g., apk add davfs2
  mkdir /test mkdir /test/lower /test/upper /test/work /test/mnt
  yes '' | mount -t davfs -o ro http://some-web-dav-server/path \
    /test/lower
  mount -t overlay -o upperdir=/test/upper,lowerdir=/test/lower \
    -o workdir=/test/work overlay /test/mnt

  # when "some-file" exists in the lowerdir, this fails with "Function
  # not implemented", with dmesg showing "overlayfs: failed to retrieve
  # lower fileattr (/some-file, err=-38)"
  touch /test/mnt/some-file

The underlying cause of this regresion is actually in FUSE, which fails to
translate the ENOSYS error code returned by userspace filesystem (which
means that the ioctl operation is not supported) to ENOTTY.

Reported-by: Christian Kohlschütter <christian@kohlschutter.com>
Fixes: 72db82115d ("ovl: copy up sync/noatime fileattr flags")
Fixes: 59efec7b90 ("fuse: implement ioctl support")
Cc: <stable@vger.kernel.org>
Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
2022-07-21 16:06:18 +02:00
..
acl.c vfs: add rcu argument to ->get_acl() callback 2021-08-18 22:08:24 +02:00
control.c fuse: remove reliance on bdi congestion 2022-03-22 15:57:00 -07:00
cuse.c
dax.c fuse: avoid unnecessary spinlock bump 2022-07-21 16:02:45 +02:00
dev.c fuse: remove reliance on bdi congestion 2022-03-22 15:57:00 -07:00
dir.c fuse: fix deadlock between atomic O_TRUNC and page invalidation 2022-07-21 16:02:45 +02:00
file.c fuse: fix deadlock between atomic O_TRUNC and page invalidation 2022-07-21 16:02:45 +02:00
fuse_i.h fs: Remove ->readpages address space operation 2022-04-01 13:45:33 -04:00
inode.c fuse: limit nsec 2022-07-21 16:06:18 +02:00
ioctl.c fuse: ioctl: translate ENOSYS 2022-07-21 16:06:18 +02:00
Kconfig dax: remove CONFIG_DAX_DRIVER 2021-12-04 08:58:51 -08:00
Makefile
readdir.c fuse: only update necessary attributes 2021-10-28 09:45:33 +02:00
virtio_fs.c dax: introduce DAX_RECOVERY_WRITE dax access mode 2022-05-16 13:35:56 -07:00
xattr.c fuse: move fuse_invalidate_attr() into fuse_update_ctime() 2021-10-22 17:03:01 +02:00