]> git.baikalelectronics.ru Git - kernel.git/commit
afs: Improve FS server rotation error handling
authorDavid Howells <dhowells@redhat.com>
Fri, 19 Oct 2018 23:57:57 +0000 (00:57 +0100)
committerDavid Howells <dhowells@redhat.com>
Tue, 23 Oct 2018 23:41:07 +0000 (00:41 +0100)
commit35d18f1e4f5d705c68d57d19cd70c9f96ec7ebea
treefe6fbfbc8fcecf89c3d5db4a11d4c4a334e9d5ee
parentb588fc315865e68f9937ab5b91cba275f06d0a54
afs: Improve FS server rotation error handling

Improve the error handling in FS server rotation by:

 (1) Cache the latest useful error value for the fs operation as a whole in
     struct afs_fs_cursor separately from the error cached in the
     afs_addr_cursor struct.  The one in the address cursor gets clobbered
     occasionally.  Copy over the error to the fs operation only when it's
     something we'd be interested in passing to userspace.

 (2) Make it so that EDESTADDRREQ is the default that is seen only if no
     addresses are available to be accessed.

 (3) When calling utility functions, such as checking a volume status or
     probing a fileserver, don't let a successful result clobber the cached
     error in the cursor; instead, stash the result in a temporary variable
     until it has been assessed.

 (4) Don't return ETIMEDOUT or ETIME if a better error, such as
     ENETUNREACH, is already cached.

 (5) On leaving the rotation loop, turn any remote abort code into a more
     useful error than ECONNABORTED.

Fixes: b7b4753fe8b8 ("afs: Overhaul volume and server record caching and fileserver rotation")
Signed-off-by: David Howells <dhowells@redhat.com>
fs/afs/addr_list.c
fs/afs/internal.h
fs/afs/rotate.c