From: Matt Johnston Date: Fri, 14 Feb 2025 01:17:53 +0000 (+0800) Subject: fuse: Return EPERM rather than ENOSYS from link() X-Git-Tag: v6.14.9~728 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=bac922cd0b495d8d03d9dd74f914b71ca3995ed7;p=thirdparty%2Fkernel%2Fstable.git fuse: Return EPERM rather than ENOSYS from link() [ 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 Signed-off-by: Miklos Szeredi Signed-off-by: Sasha Levin --- diff --git a/fs/fuse/dir.c b/fs/fuse/dir.c index 3b031d24d3691..8f699c67561fa 100644 --- a/fs/fuse/dir.c +++ b/fs/fuse/dir.c @@ -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; }