Skip to contentSkip to conversation

nfs: Remove dead case from nfs4_map_errors()

PATCH In review Jan Kara 2 participants 3 messages Oct 23, 2014

Subsystems (2)
lore
Share & tools
lore

Jan Kara

author
#0 lore raw

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
index 405bd95c1f58..f45e6ea1b278 100644
@@ -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
#1 lore raw

Hi Jan,

Quoted 24 lines · Jan Kara

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 -3
index 405bd95c1f58..f45e6ea1b278 100644
@@ -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]
#2 lore raw
Quoted 27 lines · Trond Myklebust

Hi Jan,

Quoted 24 lines · Jan Kara

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 -3
index 405bd95c1f58..f45e6ea1b278 100644
@@ -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]