diff options
author | David Howells <dhowells@redhat.com> | 2019-05-16 09:51:48 -0400 |
---|---|---|
committer | David Howells <dhowells@redhat.com> | 2019-05-16 11:25:20 -0400 |
commit | 0ab4c9594812c4bc5606daf0677ae304bf7ec8c8 (patch) | |
tree | d3041c1bb0bcb3244f9c2879d9d5cdbcc86be26f /fs/afs | |
parent | 94f699c9cdb11b8f53cb70624b69aeae16f26db2 (diff) |
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: d2ddc776a458 ("afs: Overhaul volume and server record caching and fileserver rotation")
Signed-off-by: David Howells <dhowells@redhat.com>
Diffstat (limited to 'fs/afs')
-rw-r--r-- | fs/afs/server.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/fs/afs/server.c b/fs/afs/server.c index 65b33b6da48b..454c6357f51f 100644 --- a/fs/afs/server.c +++ b/fs/afs/server.c | |||
@@ -521,8 +521,8 @@ static noinline bool afs_update_server_record(struct afs_fs_cursor *fc, struct a | |||
521 | alist = afs_vl_lookup_addrs(fc->vnode->volume->cell, fc->key, | 521 | alist = afs_vl_lookup_addrs(fc->vnode->volume->cell, fc->key, |
522 | &server->uuid); | 522 | &server->uuid); |
523 | if (IS_ERR(alist)) { | 523 | if (IS_ERR(alist)) { |
524 | fc->ac.error = PTR_ERR(alist); | 524 | fc->error = PTR_ERR(alist); |
525 | _leave(" = f [%d]", fc->ac.error); | 525 | _leave(" = f [%d]", fc->error); |
526 | return false; | 526 | return false; |
527 | } | 527 | } |
528 | 528 | ||
@@ -574,7 +574,7 @@ retry: | |||
574 | ret = wait_on_bit(&server->flags, AFS_SERVER_FL_UPDATING, | 574 | ret = wait_on_bit(&server->flags, AFS_SERVER_FL_UPDATING, |
575 | TASK_INTERRUPTIBLE); | 575 | TASK_INTERRUPTIBLE); |
576 | if (ret == -ERESTARTSYS) { | 576 | if (ret == -ERESTARTSYS) { |
577 | fc->ac.error = ret; | 577 | fc->error = ret; |
578 | _leave(" = f [intr]"); | 578 | _leave(" = f [intr]"); |
579 | return false; | 579 | return false; |
580 | } | 580 | } |