diff options
author | David Howells <dhowells@redhat.com> | 2009-06-16 16:36:49 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2009-06-17 00:20:14 -0400 |
commit | 005411c3e9147bc3b78215390e847d688dbbc163 (patch) | |
tree | ed10cb7c73135fbdf7a39798bb0f294e80f987a4 /fs | |
parent | 519d25679e8ae7433c758b9e74b19144f61b90f8 (diff) |
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')
-rw-r--r-- | fs/afs/misc.c | 16 | ||||
-rw-r--r-- | fs/afs/vlocation.c | 2 |
2 files changed, 18 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 @@ | |||
12 | #include <linux/kernel.h> | 12 | #include <linux/kernel.h> |
13 | #include <linux/module.h> | 13 | #include <linux/module.h> |
14 | #include <linux/errno.h> | 14 | #include <linux/errno.h> |
15 | #include <rxrpc/packet.h> | ||
15 | #include "internal.h" | 16 | #include "internal.h" |
16 | #include "afs_fs.h" | 17 | #include "afs_fs.h" |
17 | 18 | ||
@@ -54,6 +55,21 @@ int afs_abort_to_error(u32 abort_code) | |||
54 | case 0x2f6df24: return -ENOLCK; | 55 | case 0x2f6df24: return -ENOLCK; |
55 | case 0x2f6df26: return -ENOTEMPTY; | 56 | case 0x2f6df26: return -ENOTEMPTY; |
56 | case 0x2f6df78: return -EDQUOT; | 57 | case 0x2f6df78: return -EDQUOT; |
58 | |||
59 | case RXKADINCONSISTENCY: return -EPROTO; | ||
60 | case RXKADPACKETSHORT: return -EPROTO; | ||
61 | case RXKADLEVELFAIL: return -EKEYREJECTED; | ||
62 | case RXKADTICKETLEN: return -EKEYREJECTED; | ||
63 | case RXKADOUTOFSEQUENCE: return -EPROTO; | ||
64 | case RXKADNOAUTH: return -EKEYREJECTED; | ||
65 | case RXKADBADKEY: return -EKEYREJECTED; | ||
66 | case RXKADBADTICKET: return -EKEYREJECTED; | ||
67 | case RXKADUNKNOWNKEY: return -EKEYREJECTED; | ||
68 | case RXKADEXPIRED: return -EKEYEXPIRED; | ||
69 | case RXKADSEALEDINCON: return -EKEYREJECTED; | ||
70 | case RXKADDATALEN: return -EKEYREJECTED; | ||
71 | case RXKADILLEGALLEVEL: return -EKEYREJECTED; | ||
72 | |||
57 | default: return -EREMOTEIO; | 73 | default: return -EREMOTEIO; |
58 | } | 74 | } |
59 | } | 75 | } |
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, | |||
65 | goto out; | 65 | goto out; |
66 | goto rotate; | 66 | goto rotate; |
67 | case -ENOMEDIUM: | 67 | case -ENOMEDIUM: |
68 | case -EKEYREJECTED: | ||
69 | case -EKEYEXPIRED: | ||
68 | goto out; | 70 | goto out; |
69 | default: | 71 | default: |
70 | ret = -EIO; | 72 | ret = -EIO; |