nfs: Remove dead case from nfs4_map_errors()
Subsystems (2)
PATCH 1/1 nfs: Remove dead case from nfs4_map_errors()
NFS4ERR_ACCESS has number 13 and thus is matched and returned immediately at the beginning of nfs4_map_errors() and there's no point in checking it later.
Coverity-id: 733891
--- fs/nfs/nfs4proc.c | 2 -- 1 file changed, 2 deletions(-)
fs/nfs/nfs4proc.c +0 -2
@@ -158,8 +158,6 @@ static int nfs4_map_errors(int err)return -EACCES ;case -NFS4ERR_MINOR_VERS_MISMATCH :return -EPROTONOSUPPORT ; -case -NFS4ERR_ACCESS : -return -EACCES ;case -NFS4ERR_FILE_OPEN :return -EBUSY ;default :
Signature · 1 line
1.8.1.4
Hi Jan,
Quoted 24 lines · Jan Kara
NFS4ERR_ACCESShas number 13 and thus is matched and returned immediately at the beginning ofnfs4_map_errors()and there's no point in checking it later.Coverity-id: 733891
Signed-off-by Jan Kara <[email protected]>--- fs/nfs/nfs4proc.c | 2 -- 1 file changed, 2 deletions(-)fs/nfs/nfs4proc.c +0
-3@@ -158,8 +158,6 @@ static int nfs4_map_errors(int err)return -EACCES ;case -NFS4ERR_MINOR_VERS_MISMATCH :return -EPROTONOSUPPORT ; -case -NFS4ERR_ACCESS : -return -EACCES ;case -NFS4ERR_FILE_OPEN :return -EBUSY ;default : --
Quoted 2 lines
1.8.1.4
Can you guarantee that EACCES will _always_ take the value 13? I don't think POSIX lists explicit values.
The NFSv4 error codes are sometimes based on old Solaris error code values, and so often coincide with the Linux values, but I'm not comfortable yet with the assumption that will always be the case.
Cheers
Trond
Signature · 5 lines
Trond Myklebust Linux NFS client maintainer, PrimaryData [email protected]
Quoted 27 lines · Trond Myklebust
Hi Jan,
Quoted 24 lines · Jan Kara
NFS4ERR_ACCESShas number 13 and thus is matched and returned immediately at the beginning ofnfs4_map_errors()and there's no point in checking it later.Coverity-id: 733891
Signed-off-by Jan Kara <[email protected]>--- fs/nfs/nfs4proc.c | 2 -- 1 file changed, 2 deletions(-)fs/nfs/nfs4proc.c +0
-3@@ -158,8 +158,6 @@ static int nfs4_map_errors(int err)return -EACCES ;case -NFS4ERR_MINOR_VERS_MISMATCH :return -EPROTONOSUPPORT ; -case -NFS4ERR_ACCESS : -return -EACCES ;case -NFS4ERR_FILE_OPEN :return -EBUSY ;default : --
Quoted 9 lines
Quoted 2 lines
1.8.1.4
Can you guarantee that EACCES will _always_ take the value 13? I don't think POSIX lists explicit values.
The NFSv4 error codes are sometimes based on old Solaris error code values, and so often coincide with the Linux values, but I'm not comfortable yet with the assumption that will always be the case.
D'oh... Never mind. I penetrated the fog of jetlag and now I see what you are saying...
Signature · 5 lines
Trond Myklebust Linux NFS client maintainer, PrimaryData [email protected]