]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
fuse: Return EPERM rather than ENOSYS from link()
authorMatt Johnston <matt@codeconstruct.com.au>
Fri, 14 Feb 2025 01:17:53 +0000 (09:17 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 4 Jun 2025 12:40:02 +0000 (14:40 +0200)
[ Upstream commit 8344213571b2ac8caf013cfd3b37bc3467c3a893 ]

link() is documented to return EPERM when a filesystem doesn't support
the operation, return that instead.

Link: https://github.com/libfuse/libfuse/issues/925
Signed-off-by: Matt Johnston <matt@codeconstruct.com.au>
Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
fs/fuse/dir.c

index c431abbf48e66a18ee1dd772d2e84217b70634d0..0dbacdd7bb0d8a6f5c3b747ce0e6750d8e0fc2fc 100644 (file)
@@ -1068,6 +1068,8 @@ static int fuse_link(struct dentry *entry, struct inode *newdir,
        else if (err == -EINTR)
                fuse_invalidate_attr(inode);
 
+       if (err == -ENOSYS)
+               err = -EPERM;
        return err;
 }