mirror of
https://github.com/armbian/linux.git
synced 2026-01-06 10:13:00 -08:00
NFS: Fix the mapping of the NFSERR_SERVERFAULT error
commit fdcb45777a upstream.
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>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
5ba0facdbe
commit
892faa5a39
@@ -120,7 +120,7 @@ static struct {
|
||||
{ .status = MNT3ERR_INVAL, .errno = -EINVAL, },
|
||||
{ .status = MNT3ERR_NAMETOOLONG, .errno = -ENAMETOOLONG, },
|
||||
{ .status = MNT3ERR_NOTSUPP, .errno = -ENOTSUPP, },
|
||||
{ .status = MNT3ERR_SERVERFAULT, .errno = -ESERVERFAULT, },
|
||||
{ .status = MNT3ERR_SERVERFAULT, .errno = -EREMOTEIO, },
|
||||
};
|
||||
|
||||
struct mountres {
|
||||
|
||||
@@ -699,7 +699,7 @@ static struct {
|
||||
{ NFSERR_BAD_COOKIE, -EBADCOOKIE },
|
||||
{ NFSERR_NOTSUPP, -ENOTSUPP },
|
||||
{ NFSERR_TOOSMALL, -ETOOSMALL },
|
||||
{ NFSERR_SERVERFAULT, -ESERVERFAULT },
|
||||
{ NFSERR_SERVERFAULT, -EREMOTEIO },
|
||||
{ NFSERR_BADTYPE, -EBADTYPE },
|
||||
{ NFSERR_JUKEBOX, -EJUKEBOX },
|
||||
{ -1, -EIO }
|
||||
|
||||
@@ -4554,7 +4554,7 @@ static int decode_sequence(struct xdr_stream *xdr,
|
||||
* If the server returns different values for sessionID, slotID or
|
||||
* sequence number, the server is looney tunes.
|
||||
*/
|
||||
status = -ESERVERFAULT;
|
||||
status = -EREMOTEIO;
|
||||
|
||||
if (memcmp(id.data, res->sr_session->sess_id.data,
|
||||
NFS4_MAX_SESSIONID_LEN)) {
|
||||
@@ -5678,7 +5678,7 @@ static struct {
|
||||
{ NFS4ERR_BAD_COOKIE, -EBADCOOKIE },
|
||||
{ NFS4ERR_NOTSUPP, -ENOTSUPP },
|
||||
{ NFS4ERR_TOOSMALL, -ETOOSMALL },
|
||||
{ NFS4ERR_SERVERFAULT, -ESERVERFAULT },
|
||||
{ NFS4ERR_SERVERFAULT, -EREMOTEIO },
|
||||
{ NFS4ERR_BADTYPE, -EBADTYPE },
|
||||
{ NFS4ERR_LOCKED, -EAGAIN },
|
||||
{ NFS4ERR_SYMLINK, -ELOOP },
|
||||
@@ -5705,7 +5705,7 @@ nfs4_stat_to_errno(int stat)
|
||||
}
|
||||
if (stat <= 10000 || stat > 10100) {
|
||||
/* The server is looney tunes. */
|
||||
return -ESERVERFAULT;
|
||||
return -EREMOTEIO;
|
||||
}
|
||||
/* If we cannot translate the error, the recovery routines should
|
||||
* handle it.
|
||||
|
||||
Reference in New Issue
Block a user