Skip to content

Commit fdcb457

Browse files
Trond MyklebustTrond Myklebust
authored andcommitted
NFS: Fix the mapping of the NFSERR_SERVERFAULT error
It was recently pointed out that the NFSERR_SERVERFAULT error, which is designed to inform the user of a serious internal error on the server, was being mapped to an error value that is internal to the kernel. This patch maps it to the error EREMOTEIO, which is exported to userland through errno.h. Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com> Cc: stable@kernel.org
1 parent 7549ad5 commit fdcb457

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

fs/nfs/mount_clnt.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ static struct {
120120
{ .status = MNT3ERR_INVAL, .errno = -EINVAL, },
121121
{ .status = MNT3ERR_NAMETOOLONG, .errno = -ENAMETOOLONG, },
122122
{ .status = MNT3ERR_NOTSUPP, .errno = -ENOTSUPP, },
123-
{ .status = MNT3ERR_SERVERFAULT, .errno = -ESERVERFAULT, },
123+
{ .status = MNT3ERR_SERVERFAULT, .errno = -EREMOTEIO, },
124124
};
125125

126126
struct mountres {

fs/nfs/nfs2xdr.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -699,7 +699,7 @@ static struct {
699699
{ NFSERR_BAD_COOKIE, -EBADCOOKIE },
700700
{ NFSERR_NOTSUPP, -ENOTSUPP },
701701
{ NFSERR_TOOSMALL, -ETOOSMALL },
702-
{ NFSERR_SERVERFAULT, -ESERVERFAULT },
702+
{ NFSERR_SERVERFAULT, -EREMOTEIO },
703703
{ NFSERR_BADTYPE, -EBADTYPE },
704704
{ NFSERR_JUKEBOX, -EJUKEBOX },
705705
{ -1, -EIO }

fs/nfs/nfs4xdr.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4631,7 +4631,7 @@ static int decode_sequence(struct xdr_stream *xdr,
46314631
* If the server returns different values for sessionID, slotID or
46324632
* sequence number, the server is looney tunes.
46334633
*/
4634-
status = -ESERVERFAULT;
4634+
status = -EREMOTEIO;
46354635

46364636
if (memcmp(id.data, res->sr_session->sess_id.data,
46374637
NFS4_MAX_SESSIONID_LEN)) {
@@ -5774,7 +5774,7 @@ static struct {
57745774
{ NFS4ERR_BAD_COOKIE, -EBADCOOKIE },
57755775
{ NFS4ERR_NOTSUPP, -ENOTSUPP },
57765776
{ NFS4ERR_TOOSMALL, -ETOOSMALL },
5777-
{ NFS4ERR_SERVERFAULT, -ESERVERFAULT },
5777+
{ NFS4ERR_SERVERFAULT, -EREMOTEIO },
57785778
{ NFS4ERR_BADTYPE, -EBADTYPE },
57795779
{ NFS4ERR_LOCKED, -EAGAIN },
57805780
{ NFS4ERR_SYMLINK, -ELOOP },
@@ -5801,7 +5801,7 @@ nfs4_stat_to_errno(int stat)
58015801
}
58025802
if (stat <= 10000 || stat > 10100) {
58035803
/* The server is looney tunes. */
5804-
return -ESERVERFAULT;
5804+
return -EREMOTEIO;
58055805
}
58065806
/* If we cannot translate the error, the recovery routines should
58075807
* handle it.

0 commit comments

Comments
 (0)