dir: Protect against circular hash chains
The dir package didn't protect against circular hash chains when
performing directory lookups. A corrupt directory could therefore
cause a client or a fileserver to go into an endless loop if that
directory contained a loop in its hash chain pointers.
Fix this by exiting the lookup if the hash chain has more elements
than the total number of entries in a directory. This maximum number
of entries is taken as being (number of entries per page) * (max
number of pages), which is considerably more than the real maximum
value.
(cherry picked from commit
bb25bdfcb059fc54a57fd4733ce3184e231ca88d)
Change-Id: I7290dbaad66bccfe3b03a843184464f0681f9429
Reviewed-on: http://gerrit.openafs.org/5250
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>