diff options
author | David Howells <dhowells@redhat.com> | 2018-02-06 09:26:30 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2018-02-16 22:06:53 +0300 |
commit | 8b690011c27d90bf80585ff25bb15a07a533540d (patch) | |
tree | 0c417932333d87eade8a4ca37042bf71ad14b82f /fs | |
parent | da89b2d752e97b2f5de5fda8cfa1ad4b7717a37e (diff) | |
download | linux-8b690011c27d90bf80585ff25bb15a07a533540d.tar.xz |
afs: Need to clear responded flag in addr cursor
commit 8305e579c653b127b292fcdce551e930f9560260 upstream.
In afs_select_fileserver(), we need to clear the ->responded flag in the
address list when reusing it. We should also clear it in
afs_select_current_fileserver().
To this end, just memset() the object before initialising it.
Fixes: d2ddc776a458 ("afs: Overhaul volume and server record caching and fileserver rotation")
Signed-off-by: David Howells <dhowells@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'fs')
-rw-r--r-- | fs/afs/rotate.c | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/fs/afs/rotate.c b/fs/afs/rotate.c index d04511fb3879..0c0f07d34de2 100644 --- a/fs/afs/rotate.c +++ b/fs/afs/rotate.c @@ -383,6 +383,7 @@ use_server: afs_get_addrlist(alist); read_unlock(&server->fs_lock); + memset(&fc->ac, 0, sizeof(fc->ac)); /* Probe the current fileserver if we haven't done so yet. */ if (!test_bit(AFS_SERVER_FL_PROBED, &server->flags)) { @@ -397,11 +398,8 @@ use_server: else afs_put_addrlist(alist); - fc->ac.addr = NULL; fc->ac.start = READ_ONCE(alist->index); fc->ac.index = fc->ac.start; - fc->ac.error = 0; - fc->ac.begun = false; goto iterate_address; iterate_address: @@ -458,12 +456,10 @@ bool afs_select_current_fileserver(struct afs_fs_cursor *fc) return false; } + memset(&fc->ac, 0, sizeof(fc->ac)); fc->ac.alist = alist; - fc->ac.addr = NULL; fc->ac.start = READ_ONCE(alist->index); fc->ac.index = fc->ac.start; - fc->ac.error = 0; - fc->ac.begun = false; goto iterate_address; case 0: |