]> 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:41:54 +0000 (14:41 +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 e4d6cc0d2332a478367d0860ca3165b9fdb97e08..82951a535d2d4d350d3f2318e02a7456c4473d71 100644 (file)
@@ -1121,6 +1121,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;
 }