afs: restore force_if_down check when getting connections 53/12653/3
authorMichael Meffie <mmeffie@sinenomine.net>
Tue, 11 Jul 2017 12:51:08 +0000 (08:51 -0400)
committerBenjamin Kaduk <kaduk@mit.edu>
Wed, 26 Jul 2017 01:57:33 +0000 (21:57 -0400)
commita6ad67485bf23084c06e1de1a424b2e375ee70f3
treefcb175212c97cb4f0ca03267a0c5be9c25d79917
parenta1c072ac562ccf74e5afb8449db1bcef86aef362
afs: restore force_if_down check when getting connections

Commit cb9e029255420608308127b0609179a46d9983ad removed the
force_if_down check in afs_ConnBySA, which effictively turned on
force_if_down flag for every call to afs_ConnBySA. This caused
afs_ConnBySA to always return connections, even for server addresses
marked down and force_if_down set to 0.

One serious consequence of this bug is the cache manager will retry the
preferred vlserver indefinitely when it is unreachable. This is because
the loop in afs_ConnMHosts always tries hosts in preferred order and
expects afs_ConnBySA to return a NULL if the server address has no
connections because it is marked down.

Restore the check for server addresses marked down to honor the
force_if_down flag again so we do not get connections for down servers
unless requested.

Change-Id: Ia117354929a62b0cedc218040649e9e0b8d8ed23
Reviewed-on: https://gerrit.openafs.org/12653
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
src/afs/afs_conn.c