From: David Howells Date: Tue, 16 Jun 2009 20:36:49 +0000 (+0100) Subject: AFS: Correctly translate auth error aborts and don't failover in such cases X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=005411c3e9147bc3b78215390e847d688dbbc163;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git AFS: Correctly translate auth error aborts and don't failover in such cases Authentication error abort codes should be translated to appropriate Linux error codes, rather than all being translated to EREMOTEIO - which indicates that the server had internal problems. Additionally, a server shouldn't be marked unavailable and the next server tried if an authentication error occurs. This will quickly make all the servers unavailable to the client. Instead the error should be returned straight to the user. Signed-off-by: David Howells Signed-off-by: Linus Torvalds --- diff --git a/fs/afs/misc.c b/fs/afs/misc.c index 2d33a5f7d218..0dd4dafee10b 100644 --- a/fs/afs/misc.c +++ b/fs/afs/misc.c @@ -12,6 +12,7 @@ #include #include #include +#include #include "internal.h" #include "afs_fs.h" @@ -54,6 +55,21 @@ int afs_abort_to_error(u32 abort_code) case 0x2f6df24: return -ENOLCK; case 0x2f6df26: return -ENOTEMPTY; case 0x2f6df78: return -EDQUOT; + + case RXKADINCONSISTENCY: return -EPROTO; + case RXKADPACKETSHORT: return -EPROTO; + case RXKADLEVELFAIL: return -EKEYREJECTED; + case RXKADTICKETLEN: return -EKEYREJECTED; + case RXKADOUTOFSEQUENCE: return -EPROTO; + case RXKADNOAUTH: return -EKEYREJECTED; + case RXKADBADKEY: return -EKEYREJECTED; + case RXKADBADTICKET: return -EKEYREJECTED; + case RXKADUNKNOWNKEY: return -EKEYREJECTED; + case RXKADEXPIRED: return -EKEYEXPIRED; + case RXKADSEALEDINCON: return -EKEYREJECTED; + case RXKADDATALEN: return -EKEYREJECTED; + case RXKADILLEGALLEVEL: return -EKEYREJECTED; + default: return -EREMOTEIO; } } diff --git a/fs/afs/vlocation.c b/fs/afs/vlocation.c index ec2a7431e458..6e689208def2 100644 --- a/fs/afs/vlocation.c +++ b/fs/afs/vlocation.c @@ -65,6 +65,8 @@ static int afs_vlocation_access_vl_by_name(struct afs_vlocation *vl, goto out; goto rotate; case -ENOMEDIUM: + case -EKEYREJECTED: + case -EKEYEXPIRED: goto out; default: ret = -EIO;