summaryrefslogtreecommitdiffstats
path: root/fs/afs/misc.c
diff options
context:
space:
mode:
authorDavid Howells <dhowells@redhat.com>2009-06-16 21:36:49 +0100
committerLinus Torvalds <torvalds@linux-foundation.org>2009-06-16 21:20:14 -0700
commit005411c3e9147bc3b78215390e847d688dbbc163 (patch)
treeed10cb7c73135fbdf7a39798bb0f294e80f987a4 /fs/afs/misc.c
parent519d25679e8ae7433c758b9e74b19144f61b90f8 (diff)
downloadlinux-stable-005411c3e9147bc3b78215390e847d688dbbc163.tar.gz
linux-stable-005411c3e9147bc3b78215390e847d688dbbc163.tar.bz2
linux-stable-005411c3e9147bc3b78215390e847d688dbbc163.zip
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 <dhowells@redhat.com> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'fs/afs/misc.c')
-rw-r--r--fs/afs/misc.c16
1 files changed, 16 insertions, 0 deletions
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 <linux/kernel.h>
#include <linux/module.h>
#include <linux/errno.h>
+#include <rxrpc/packet.h>
#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;
}
}