Skip to content

Commit

Permalink
AFS: Correctly translate auth error aborts and don't failover in such…
Browse files Browse the repository at this point in the history
… 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>
  • Loading branch information
David Howells authored and Linus Torvalds committed Jun 17, 2009
1 parent 519d256 commit 005411c
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
16 changes: 16 additions & 0 deletions fs/afs/misc.c
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down Expand Up @@ -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;
}
}
2 changes: 2 additions & 0 deletions fs/afs/vlocation.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 005411c

Please sign in to comment.