Commit 0ab4c959 authored by David Howells's avatar David Howells

afs: Fix error propagation from server record check/update

afs_check/update_server_record() should be setting fc->error rather than
fc->ac.error as they're called from within the cursor iteration function.

afs_fs_cursor::error is where the error code of the attempt to call the
operation on multiple servers is integrated and is the final result,
whereas afs_addr_cursor::error is used to hold the error from individual
iterations of the call loop.  (Note there's also an afs_vl_cursor which
also wraps afs_addr_cursor for accessing VL servers rather than file
servers).

Fix this by setting fc->error in the afs_check/update_server_record() so
that any error incurred whilst talking to the VL server correctly
propagates to the final result.

This results in:

	kAFS: Unexpected error from FS.StoreData -512

being seen, even though the store-data op is non-interruptible.  The error
is actually coming from the server record update getting interrupted.

Fixes: d2ddc776 ("afs: Overhaul volume and server record caching and fileserver rotation")
Signed-off-by: default avatarDavid Howells <dhowells@redhat.com>
parent 94f699c9
...@@ -521,8 +521,8 @@ static noinline bool afs_update_server_record(struct afs_fs_cursor *fc, struct a ...@@ -521,8 +521,8 @@ static noinline bool afs_update_server_record(struct afs_fs_cursor *fc, struct a
alist = afs_vl_lookup_addrs(fc->vnode->volume->cell, fc->key, alist = afs_vl_lookup_addrs(fc->vnode->volume->cell, fc->key,
&server->uuid); &server->uuid);
if (IS_ERR(alist)) { if (IS_ERR(alist)) {
fc->ac.error = PTR_ERR(alist); fc->error = PTR_ERR(alist);
_leave(" = f [%d]", fc->ac.error); _leave(" = f [%d]", fc->error);
return false; return false;
} }
...@@ -574,7 +574,7 @@ bool afs_check_server_record(struct afs_fs_cursor *fc, struct afs_server *server ...@@ -574,7 +574,7 @@ bool afs_check_server_record(struct afs_fs_cursor *fc, struct afs_server *server
ret = wait_on_bit(&server->flags, AFS_SERVER_FL_UPDATING, ret = wait_on_bit(&server->flags, AFS_SERVER_FL_UPDATING,
TASK_INTERRUPTIBLE); TASK_INTERRUPTIBLE);
if (ret == -ERESTARTSYS) { if (ret == -ERESTARTSYS) {
fc->ac.error = ret; fc->error = ret;
_leave(" = f [intr]"); _leave(" = f [intr]");
return false; return false;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment