Thread (2 messages) 2 messages, 2 authors, 2023-06-08
STALE1100d

[PATCH] nfs4: don't map EACCESS and EPERM to EIO

From: Tigran Mkrtchyan <hidden>
Date: 2023-06-08 14:58:07
Subsystem: filesystems (vfs and infrastructure), nfs, sunrpc, and lockd clients, the rest · Maintainers: Alexander Viro, Christian Brauner, Trond Myklebust, Anna Schumaker, Linus Torvalds

the nfs4_map_errors function converts NFS specific errors to userland
errors. However, it ignores NFS4ERR_PERM and EPERM, which then get
mapped to EIO.

Signed-off-by: Tigran Mkrtchyan <redacted>
---
 fs/nfs/nfs4proc.c | 2 ++
 1 file changed, 2 insertions(+)
diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c
index d3665390c4cb..795205fe4f30 100644
--- a/fs/nfs/nfs4proc.c
+++ b/fs/nfs/nfs4proc.c
@@ -171,12 +171,14 @@ static int nfs4_map_errors(int err)
 	case -NFS4ERR_LAYOUTTRYLATER:
 	case -NFS4ERR_RECALLCONFLICT:
 		return -EREMOTEIO;
+	case -NFS4ERR_PERM:
 	case -NFS4ERR_WRONGSEC:
 	case -NFS4ERR_WRONG_CRED:
 		return -EPERM;
 	case -NFS4ERR_BADOWNER:
 	case -NFS4ERR_BADNAME:
 		return -EINVAL;
+	case -NFS4ERR_ACCESS:
 	case -NFS4ERR_SHARE_DENIED:
 		return -EACCES;
 	case -NFS4ERR_MINOR_VERS_MISMATCH:
-- 
2.40.1
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help