diff options
author | David Howells <dhowells@redhat.com> | 2023-10-25 19:53:33 +0300 |
---|---|---|
committer | David Howells <dhowells@redhat.com> | 2023-12-24 18:22:53 +0300 |
commit | aa453becce5d1ae1b94b7fc22f47d7b05d22b14e (patch) | |
tree | 933b826c996b2688608d7108d04ff03d390b9585 /fs/afs/vlclient.c | |
parent | 6f2ff7e89bd05677f4c08fccafcf625ca3e09c1c (diff) | |
download | linux-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/vlclient.c')
-rw-r--r-- | fs/afs/vlclient.c | 34 |
1 files changed, 23 insertions, 11 deletions
diff --git a/fs/afs/vlclient.c b/fs/afs/vlclient.c index 650534892a20..db7e94584e87 100644 --- a/fs/afs/vlclient.c +++ b/fs/afs/vlclient.c @@ -161,10 +161,13 @@ struct afs_vldb_entry *afs_vl_get_entry_by_name_u(struct afs_vl_cursor *vc, trace_afs_make_vl_call(call); afs_make_call(&vc->ac, call, GFP_KERNEL); afs_wait_for_call_to_complete(call, &vc->ac); + vc->call_abort_code = call->abort_code; + vc->call_error = call->error; + vc->call_responded = call->responded; afs_put_call(call); - if (vc->ac.error) { + if (vc->call_error) { kfree(entry); - return ERR_PTR(vc->ac.error); + return ERR_PTR(vc->call_error); } return entry; } @@ -305,11 +308,14 @@ struct afs_addr_list *afs_vl_get_addrs_u(struct afs_vl_cursor *vc, trace_afs_make_vl_call(call); afs_make_call(&vc->ac, call, GFP_KERNEL); afs_wait_for_call_to_complete(call, &vc->ac); - alist = call->ret_alist; + vc->call_abort_code = call->abort_code; + vc->call_error = call->error; + vc->call_responded = call->responded; + alist = call->ret_alist; afs_put_call(call); - if (vc->ac.error) { + if (vc->call_error) { afs_put_addrlist(alist); - return ERR_PTR(vc->ac.error); + return ERR_PTR(vc->call_error); } return alist; } @@ -656,11 +662,14 @@ struct afs_addr_list *afs_yfsvl_get_endpoints(struct afs_vl_cursor *vc, trace_afs_make_vl_call(call); afs_make_call(&vc->ac, call, GFP_KERNEL); afs_wait_for_call_to_complete(call, &vc->ac); - alist = call->ret_alist; + vc->call_abort_code = call->abort_code; + vc->call_error = call->error; + vc->call_responded = call->responded; + alist = call->ret_alist; afs_put_call(call); - if (vc->ac.error) { + if (vc->call_error) { afs_put_addrlist(alist); - return ERR_PTR(vc->ac.error); + return ERR_PTR(vc->call_error); } return alist; } @@ -769,11 +778,14 @@ char *afs_yfsvl_get_cell_name(struct afs_vl_cursor *vc) trace_afs_make_vl_call(call); afs_make_call(&vc->ac, call, GFP_KERNEL); afs_wait_for_call_to_complete(call, &vc->ac); - cellname = call->ret_str; + vc->call_abort_code = call->abort_code; + vc->call_error = call->error; + vc->call_responded = call->responded; + cellname = call->ret_str; afs_put_call(call); - if (vc->ac.error) { + if (vc->call_error) { kfree(cellname); - return ERR_PTR(vc->ac.error); + return ERR_PTR(vc->call_error); } return cellname; } |