salvager: Fix volume parsing on 64-bit
authorAndrew Deason <adeason@sinenomine.net>
Wed, 16 Mar 2011 19:44:56 +0000 (14:44 -0500)
committerDerrick Brashear <shadow@dementia.org>
Sun, 20 Mar 2011 02:15:58 +0000 (19:15 -0700)
commitce5e263b488f8cb85662031ee08eea448dab2d27
treee52b8aac23de35d156d811f30b988900cd790903
parentd73d9a1011cc3e1e5acfbc970434373f732c066e
salvager: Fix volume parsing on 64-bit

When an unsigned long is wider than an afs_uint32, comparing the
afs_uint32 vid to ULONG_MAX is always going to be false (which the
compiler can warn us about). Fix this by storing to an unsigned long,
and converting to a volume id after ensuring that the result is not
too large.

Change-Id: Ifbd724dabd988bc4b1ba6ee8f3dc7fa1a0afb226
Reviewed-on: http://gerrit.openafs.org/4244
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Simon Wilkinson <sxw@inf.ed.ac.uk>
Tested-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
src/vol/salvaged.c
src/vol/salvager.c