[PATCH 04/13] fs: legacy: return -EPERM when a driver can't create symlinks

Sascha Hauer s.hauer at pengutronix.de
Wed Nov 18 06:51:54 PST 2026


The VFS returns -EPERM from symlink() when a file system has no symlink
operation, like Linux. The legacy layer has one for all file systems
using it and returns -ENOSYS from it instead when the driver can't
create symlinks, so the error depends on which API a file system
happens to use. Return -EPERM there as well.

Fixes: b3fbfad7ae ("fs: dentry cache implementation")

Signed-off-by: Sascha Hauer <s.hauer at pengutronix.de>
---
 fs/legacy.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/fs/legacy.c b/fs/legacy.c
index 5344737fa6..d90232623e 100644
--- a/fs/legacy.c
+++ b/fs/legacy.c
@@ -257,8 +257,9 @@ static int legacy_symlink(struct inode *dir, struct dentry *dentry,
 	char *pathname;
 	int ret;
 
+	/* like the VFS does when a file system can't create symlinks */
 	if (!legacy_ops->symlink)
-		return -ENOSYS;
+		return -EPERM;
 
 	pathname = dpath(dentry, fsdev->vfsmount.mnt_root);
 

-- 
2.47.3




More information about the barebox mailing list