]> 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>
Thu, 29 May 2025 09:12:23 +0000 (11:12 +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 3b031d24d36912f28048d66753e8e451cd314f31..8f699c67561fad7dc170f4aa26798f7cc1f20e0d 100644 (file)
@@ -1137,6 +1137,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;
 }