summaryrefslogtreecommitdiff
path: root/fs/afs/misc.c
diff options
context:
space:
mode:
authorDavid Howells <dhowells@redhat.com>2023-10-25 19:53:33 +0300
committerDavid Howells <dhowells@redhat.com>2023-12-24 18:22:53 +0300
commitaa453becce5d1ae1b94b7fc22f47d7b05d22b14e (patch)
tree933b826c996b2688608d7108d04ff03d390b9585 /fs/afs/misc.c
parent6f2ff7e89bd05677f4c08fccafcf625ca3e09c1c (diff)
downloadlinux-aa453becce5d1ae1b94b7fc22f47d7b05d22b14e.tar.xz
afs: Simplify error handling
Simplify error handling a bit by moving it from the afs_addr_cursor struct to the afs_operation and afs_vl_cursor structs and using the error prioritisation function for accumulating errors from multiple sources (AFS tries to rotate between multiple fileservers, some of which may be inaccessible or in some state of offlinedness). Signed-off-by: David Howells <dhowells@redhat.com> cc: Marc Dionne <marc.dionne@auristor.com> cc: linux-afs@lists.infradead.org
Diffstat (limited to 'fs/afs/misc.c')
-rw-r--r--fs/afs/misc.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/fs/afs/misc.c b/fs/afs/misc.c
index 805328ca5428..b8180bf2281f 100644
--- a/fs/afs/misc.c
+++ b/fs/afs/misc.c
@@ -116,6 +116,8 @@ void afs_prioritise_error(struct afs_error *e, int error, u32 abort_code)
{
switch (error) {
case 0:
+ e->aborted = false;
+ e->error = 0;
return;
default:
if (e->error == -ETIMEDOUT ||
@@ -161,12 +163,16 @@ void afs_prioritise_error(struct afs_error *e, int error, u32 abort_code)
if (e->responded)
return;
e->error = error;
+ e->aborted = false;
return;
case -ECONNABORTED:
- error = afs_abort_to_error(abort_code);
- fallthrough;
+ e->error = afs_abort_to_error(abort_code);
+ e->aborted = true;
+ e->responded = true;
+ return;
case -ENETRESET: /* Responded, but we seem to have changed address */
+ e->aborted = false;
e->responded = true;
e->error = error;
return;